Converting to a lower quality fails with Hardware-Accelerated Streaming in Plex Web

PMP is running in Windows 10.
Plex Web is running on recently updated Chrome on the same Windows 10 install.

I’ll also note that I have a second Plex server using Intel-based hardware transcoding and these clients work fine with it, including with the copies of the same video files. They only exhibit the bugged behavior when they transcode these files via the server using Nvidia based transcoding.

The connection is not traversing a firewall. All clients and servers have been on the same LAN. Each server has their own local copies of the videos being transcoded.

Not sure what GPU the OP is using, I’m using a GTX 1660. If I turn off hardware transcoding, software transcoding works fine.

I can’t explain or figure out what’s happening.
There must be something unique to your situation.

  1. It works with your non-windows players.
  2. It works with software transcoding.
  3. PMP should be a DirectPlay anyway – no transcoding at all.

I just had an idea…

Stop PMS.
Delete the codecs.
Start PMS
Retest. (allow for the download of fresh codecs… there will be a short delay starting)

It can’t be too unique or the OP wouldn’t be experiencing it as well.

It’s worth noting that I’m forcing transcoding in PMP and Plex Web. Also Plex Web on MacOS exhibits the same behavior.

I don’t know the players well at all.
I do mostly server and platform work.

Out of all those using Plex/Web, I can’t see what makes Nvidia GPU, 2160->720, into Plex/Web special.

The protocol is the same whether transcoded or direct play.
The transcoder demuxes, transcodes, then packages the same whether hw or software.

If it were the hardware, then no hardware transcoding would work.

See the disconnect? No single facet is common to all use cases.

How do we narrow the number of variables? What is the single ‘thing’ which is common to all?

Tried deleting the codecs, no luck.

Worth noting that source/dest resolution is not a factor. Just threw out 4k-> 720p out as an example.

The problem appears to be Nvidia Transcode + Web/PMP + ? = Failure.

Did you try with the same OS and drivers as I mentioned earlier?

I don’t have Windows or Mac (not even a VM) so can’t test 100% as you have there.
I can’t replicate in Linux (Chrome or FireFox) and there is no PMP for Linux.

@hashworks mind sharing some more information about your setup see if there’s a commonality?

I suspect it may be driver version or OS release related?

Edit: I see that he’s also using the same version of Nvidia drivers. Maybe he’s also using a similar OS environment.

@ChuckPa what version of drivers are you on? What linux distro?

I’m using QNAP 3.0.6 (which is Nvidia equivalent version 430.something)
on the TVS-1282-i7

Seems like this is Ubuntu 20.04 related. This is the same behavior I have: Ubuntu 20.04 upgrade, HW transcoding issues

I’d bet @hashworks is also on 20.04.

Edit: Just tried a fresh install on that same hardware of 18.04 and sure enough it works as it should. The problematic variables are 20.04 + Nvidia Transcode + Web/PMP.

That other thread is mine. I never found a solution so just ended up going back to 18.04 and upgraded the hardware enablement stack so I could install newer packages of things I needed (I needed a newer build of samba because of defects between the latest version on my NAS, and the samba 4.7.x version on Ubuntu 18.04). Seems its still an issue, and its not docker thats the problem or the new Linux Kernel. It’s inherently an issue with Plex and Ubuntu 20.04

I tried blacklisting the intel driver, that didn’t change anything.

$ cat /etc/modprobe.d/blacklist.conf
install i915 /usr/bin/false
install intel_agp /usr/bin/false

I also tried booting with the nvidia-drm.modeset=1 kernel parameter, same result.
I don’t think this is the issue.

For me the bug occurs with both x264 and x265 sources.

As I said in my first post, this happens only on Plex Web and not on any other player I own. Sorry if I haven’t been clear enough.

It doesn’t matter how low the quality is, as long as the resolution or the bitrate is lower than the original file (so it has to transcode). I also posted the transcode parameters before, since it does work sometimes, like 1 out of 10 maybe?

And it will do like 5-7 1080p to 1080p transcodings at a time just fine :wink:

No, I just try to offload work to the GPU. As I said in my first post, transcoding to a lower quality works fine without hardware transcoding with Plex Web.

I’m using Arch Linux. I bet it’s the driver version, since we all have the bug with v440 and @ChuckPa is running 430. @nlundqu What driver version are you using with Ubuntu 18.04, they seem to provide multiple versions?

I’ll try out 430 and get back to you.

So, this took a while. Had to downgrade to my kernel since <440 nvidia-dkms wouldn’t build on higher kernel versions () – 5.3.10 instead of 5.7.7.

Here is my result:

  • 440.100: Bug occurs
  • 440.31: Bug occurs
  • 435.21: Works!

Also we have today’s 450.57 in the Arch staging repository, I’ll try it out later.

@ChuckPa So it’s definitly a driver issue (with nvidia >=440 ). What do we do with that information? I can’t really run my system with downgraded stuff :wink:

Bug is gone with today’s linux 5.7.8 and 450.57 from the Arch testing repo, works just fine!
I’ll mark this as a solution then.

@ChuckPa can you add nvidia 440 as buggy to the wiki page?

1 Like

On my Ubuntu 18.04 instance, the Nvidia 440 drivers do work.

I’d previously tried a reinstall of Ubuntu 20.04 that failed to fix anything. I’m confident the change to 18.04 was the important bit for me.

So I suspect it’s something up with the combination of 5.4ish Kernels and 440.10ish drivers. Good to hear things are resolved in the newer kernels + drivers. Hope this thread helps anyone else who might run into this.

Thank you guys. I updated my test VM on Ubuntu 20.04 to Nvidia Driver 450.51 and hw transcoding is now working as expected.

https://www.nvidia.com/download/driverResults.aspx/160555/en-us

I’m having this issue on Ubuntu 20.04, Linux 5.8.0, Plex on an Nvidia Quadro P2200 (5GB) with Plex Web Player.

I am able to consistently reproduce this issue on both Plex Web and SyncLounge player. I am able to transcode to any arbitrary quality on Plex Android.

Hardware transcoding sometimes works. Changing the quality to any setting other than original on Plex Web Player has a very high chance of killing hwaccel Plex Transcoder. Often Plex will give up on hardware transcoding and resort to software, which pegs all 12c/24t CPU depending on the number of transcodes.

I tried all of the fixes listed in this thread (As indicated by my mismatched kernel version for Ubuntu 20.04).
These problems were happening on nvidia-440 and nvidia-450 (beta) on Ubuntu 18.04 with kernel 4.4.0-generic, so I upgraded to Ubuntu 20.04 with kernel 5.4.X. Still had the same problem. Updated kernel again to 5.8.X and still have the issue.

Current setup:
Kernel && Ubuntu Version

% uname -a && grep DISTRIB_DESCRIPTION /etc/*release
Linux nas 5.8.0-050800rc6-generic #202007192331 SMP Sun Jul 19 23:33:45 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
/etc/lsb-release:DISTRIB_DESCRIPTION="Ubuntu 20.04.1 LTS"

Drivers and Plex groups match

% ls -l /dev/dri && groups plex
total 0
drwxr-xr-x 2 root root       100 Jul 25 11:50 by-path
crw-rw---- 1 root video 226,   0 Jul 25 11:50 card0
crw-rw---- 1 root video 226,   1 Jul 25 11:50 card1
crw-rw---- 1 root video 226, 128 Jul 25 11:50 renderD128
plex : plex video media

Transcoder dies most of the time right after swapping the quality on Plex Web. Plex Web Player hangs indefinitely with 404 errors in js console.

root ~plex/Library/Application Support/Plex Media Server/Logs % \
  ls -1 \
  | grep '[a-z]\.log' \
  | xargs -d '\n' tail -F 2>/dev/null \
  | grep died

Jul 25, 2020 12:16:29.857 [0x7f30877fe700] WARN - Transcode runner appears to have died.
Jul 25, 2020 12:16:29.901 [0x7f2fe9fff700] WARN - Transcode runner appears to have died.

Driver group verification

% ls -l /dev/dri && groups plex
total 0
drwxr-xr-x 2 root root       100 Jul 25 11:50 by-path
crw-rw---- 1 root video 226,   0 Jul 25 11:50 card0
crw-rw---- 1 root video 226,   1 Jul 25 11:50 card1
crw-rw---- 1 root video 226, 128 Jul 25 11:50 renderD128
plex : plex video media

Driver / Package version verification (xserver-xorg installed by recommends, headless server)

% apt list --installed 2>/dev/null| grep nvidia | grep -v libnvidia
nvidia-compute-utils-450/focal,now 450.57-0ubuntu0~0.20.04.2 amd64 [installed]
nvidia-dkms-450/focal,now 450.57-0ubuntu0~0.20.04.2 amd64 [installed,automatic]
nvidia-driver-450/focal,now 450.57-0ubuntu0~0.20.04.2 amd64 [installed]
nvidia-kernel-common-450/focal,now 450.57-0ubuntu0~0.20.04.2 amd64 [installed,automatic]
nvidia-kernel-source-450/focal,now 450.57-0ubuntu0~0.20.04.2 amd64 [installed,automatic]
nvidia-prime/focal,focal,now 0.8.14 all [installed,automatic]
nvidia-settings/focal-updates,now 440.82-0ubuntu0.20.04.1 amd64 [installed,automatic]
nvidia-utils-450/focal,now 450.57-0ubuntu0~0.20.04.2 amd64 [installed,automatic]
xserver-xorg-video-nvidia-450/focal,now 450.57-0ubuntu0~0.20.04.2 amd64 [installed]

CPU information (2x Xeon 5650s, dual socket motherboard)

% grep model\ name /proc/cpuinfo | head -n1
model name      : Intel(R) Xeon(R) CPU           X5650  @ 2.67GHz

Display information

% lshw -C display
  *-display
       description: VGA compatible controller
       product: GP106GL [Quadro P2200]
       vendor: NVIDIA Corporation
            physical id: 0
       bus info: pci@0000:06:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
       configuration: driver=nvidia latency=0
       resources: irq:45 memory:dd000000-ddffffff memory:c0000000-cfffffff memory:be000000-bfffffff ioport:fc80(size=128) memory:dc000000-dc07ffff
  *-display
        description: VGA compatible controller
            product: MGA G200eW WPCM450
                vendor: Matrox Electronics Systems Ltd.
       physical id: 3
            bus info: pci@0000:07:03.0
                version: 0a
       width: 32 bits
       clock: 33MHz
       capabilities: pm vga_controller bus_master cap_list rom
       configuration: driver=mgag200 latency=32 maxlatency=32 mingnt=16
            resources: irq:19 memory:d0000000-d07fffff memory:de7fc000-de7fffff memory:de800000-deffffff memory:c0000-dffff

Memory information was 8GiB (crashing), upgraded to 24GiB today (no difference).

% free -m
              total        used        free      shared  buff/cache   available
Mem:          24080         601        1925           2       21554       23062
Swap:             0           0           0

nvidia-smi when working, processes field is obviously empty when it dies

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 450.57       Driver Version: 450.57       CUDA Version: 11.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  Quadro P2200        Off  | 00000000:06:00.0 Off |                  N/A |
| 49%   39C    P0    30W /  75W |    296MiB /  5059MiB |      4%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A     35952      C   ...diaserver/Plex Transcoder      294MiB |
+-----------------------------------------------------------------------------+

This is what the log looks like when it struggles to play (converting 1080p to 720p any quality)

% tail -F Plex\ Media\ Server.log | grep "hardware\|died"
Plex Media Server.log:Jul 25, 2020 12:39:01.068 [0x7f079effd700] DEBUG - Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Input/output error
Plex Media Server.log:Jul 25, 2020 12:39:01.068 [0x7f079effd700] DEBUG - Codecs: hardware transcoding: testing API nvdec
Plex Media Server.log:Jul 25, 2020 12:39:01.289 [0x7f079effd700] DEBUG - Codecs: hardware transcoding: testing API nvenc
Plex Media Server.log:Jul 25, 2020 12:39:01.546 [0x7f079effd700] DEBUG - Codecs: hardware transcoding: testing API vaapi
Plex Media Server.log:Jul 25, 2020 12:39:01.547 [0x7f079effd700] DEBUG - Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Input/output error
Plex Media Server.log:Jul 25, 2020 12:39:01.547 [0x7f079effd700] DEBUG - Codecs: hardware transcoding: testing API nvdec
Plex Media Server.log:Jul 25, 2020 12:39:01.654 [0x7f07967fc700] DEBUG - TPU: hardware transcoding: using hardware decode accelerator nvdec
Plex Media Server.log:Jul 25, 2020 12:39:01.655 [0x7f07967fc700] DEBUG - TPU: hardware transcoding: zero-copy support present
Plex Media Server.log:Jul 25, 2020 12:39:01.655 [0x7f07967fc700] DEBUG - TPU: hardware transcoding: using zero-copy transcoding
Plex Media Server.log:Jul 25, 2020 12:39:01.655 [0x7f07967fc700] DEBUG - TPU: hardware transcoding: final decoder: nvdec, final encoder: nvenc

Have censored VERBOSE+DEBUG log snapshot of this crash available on request. Not 100% confident in my log censoring so I’m not comfortable publishing it publicly.

  1. Please turn off VERBOSE logging. A, it’s not needed, B. it over complicates this task.
  2. Restart PMS to get a fresh set of DEBUG logs started
  3. Recreate the problem (just let it start, run 30 seconds, then stop)
  4. Let the logs flush to disk (30 seconds)
  5. Download the Logs ZIP (Settings - Server - Troubleshooting - Download Logs)
  6. Attach the ZIP

@ChuckPa,

Here are the logs you requested with VERBOSE disabled.
plex-logs-2020-07-25.zip (100.0 KB)

Hi Chuck - I just setup a new Plex Server over Ubuntu 20.04 running official plex docker. This server also running jellyfin and I can validate that the hardware transcoding is working as expected with the latest nvidea drivers. I have gone through all the past forums related to the topic and have tried everything, plex will not play movies on web player or iOS if it requires transcoding, I could see its using the hw transcoding but wont play the movie. Attaching the logs as suggested by you.

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 450.57       Driver Version: 450.57       CUDA Version: 11.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  Quadro P5000        Off  | 00000000:3B:00.0 Off |                  Off |
| 26%   38C    P0    40W / 180W |    350MiB / 16278MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1638      G   /usr/lib/xorg/Xorg                  4MiB |
|    0   N/A  N/A      5895      G   /usr/lib/xorg/Xorg                  4MiB |
|    0   N/A  N/A   1778225      C   ...diaserver/Plex Transcoder      336MiB |
+-----------------------------------------------------------------------------+

Plex Media Server Logs_2020-07-26_11-36-39.zip (2.6 MB)