Ubuntu 20.04 upgrade, HW transcoding issues

Server Version#: 1.19.1.2701
Player Version#: 4.22.3
OS: Upgrade Ubuntu 18:04 to 20:04

Hi all,

So yesterday I upgraded my Media Server from Ubuntu 18:04 to 20:04. After the upgrade everything was fine except that PreRoll and Transcoding stopped working. After some troubleshooting I found that it could still hw transcode to mobile app devices, but not to webplayer. It also errors when trying to transcode to Windows 10 Plex app.

My setup is an NVIDIA GTX1070 passed to an Ubuntu VM, with LinuxServer.io Plex in Docker (Docker 19.03).

From what I can tell my setup in Ubuntu looks just fine…

@mediabox:~$ lspci | grep NVIDIA
03:00.0 VGA compatible controller: NVIDIA Corporation GP104 [GeForce GTX 1070] (rev a1)
03:00.1 Audio device: NVIDIA Corporation GP104 High Definition Audio Controller (rev a1)
y@mediabox:~$ ls -la /dev/dri
total 0
drwxr-xr-x  3 root root       120 Apr 27 01:57 .
drwxr-xr-x 20 root root      4260 Apr 27 13:25 ..
drwxr-xr-x  2 root root       100 Apr 27 01:57 by-path
crw-rw----  1 root video 226,   0 Apr 27 01:57 card0
crw-rw----  1 root video 226,   1 Apr 27 01:57 card1
crw-rw----  1 root video 226, 128 Apr 27 01:57 renderD128
@mediabox:~$ udevadm info -a -n /dev/dri/renderD128

  looking at device '/devices/pci0000:00/0000:00:02.2/0000:03:00.0/drm/renderD128':
    KERNEL=="renderD128"
    SUBSYSTEM=="drm"
    DRIVER==""

  looking at parent device '/devices/pci0000:00/0000:00:02.2/0000:03:00.0':
    KERNELS=="0000:03:00.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="nvidia"

I updated the Driver from 430.xx to 440.xx, reapplied the nvdec patch and the stream limit patch.

@mediabox:~$ nvidia-smi
Mon Apr 27 13:39:38 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.82       Driver Version: 440.82       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 1070    Off  | 00000000:03:00.0 Off |                  N/A |
| 20%   40C    P5    11W / 185W |      0MiB /  8119MiB |      2%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

I’ve Updated the Linuxserver.io docker container to the latest version and rebuilt my docker container

build_version	Linuxserver.io version:- 1.19.1.2701-6327e27bf-ls90 Build-date:- 2020-04-23T18:59:44-04:00

If I try to transcode with the web player, the video just stays on Direct Stream and audio transcodes:

If I try to transcode with the Windows 10 Plex app it just gives an error:

Transcoding to Mobile app does work but it takes up to a minute for the stream to initialize and start when switching quality

In the stream that fails to transcode video, I can see these lines in Plex Media Server.log

Apr 27, 2020 02:03:26.884 [0x7f80dffff700] DEBUG - Jobs: '/usr/lib/plexmediaserver/Plex Transcoder' exit code for process 907 is -9 (signal: Killed)
Apr 27, 2020 02:03:26.893 [0x7f80777fe700] DEBUG - TPU: hardware transcoding: enabled, but no hardware decode accelerator found
Apr 27, 2020 02:03:26.903 [0x7f80777fe700] DEBUG - [Universal] Using local file path instead of URL: /movies/Bad Boys for Life.2020.1080p.Bluray.DTS-HD.MA.5.1.X264-EVO/Bad Boys for Life.2020.1080p.Bluray.DTS-HD.MA.5.1.X264-EVO.mkv
Apr 27, 2020 02:03:26.903 [0x7f80777fe700] DEBUG - TPU: hardware transcoding: final decoder: , final encoder: 
Apr 27, 2020 02:03:26.903 [0x7f80527fc700] DEBUG - [Now] Adding 1 sessions.
Apr 27, 2020 02:03:26.904 [0x7f80d7fff700] DEBUG - Completed: [192.168.1.204:61268] 200 GET /status/sessions (13 live) TLS GZIP 34ms 3392 bytes (pipelined: 19)
Apr 27, 2020 02:03:26.904 [0x7f80d7fff700] DEBUG - Completed: [192.168.1.209:53744] 200 GET /status/sessions (13 live) TLS GZIP 33ms 3392 bytes (pipelined: 14)
Apr 27, 2020 02:03:26.920 [0x7f80777fe700] DEBUG - Job running: EAE_ROOT='/tmp/pms-299d597b-1f04-4597-b94f-5793c855df63/EasyAudioEncoder' FFMPEG_EXTERNAL_LIBS='/config/Library/Application\ Support/Plex\ Media\ Server/Codecs/99c90e0-3095-linux-x86_64/' XDG_CACHE_HOME='/config/Library/Application Support/Plex Media Server/Cache' XDG_DATA_HOME='/usr/lib/plexmediaserver/Resources' X_PLEX_TOKEN='xxxxxxxxxxxxxxxxxxxx' '/usr/lib/plexmediaserver/Plex Transcoder' '-codec:0' 'h264' '-codec:1' 'ac3' '-ss' '115' '-noaccurate_seek' '-analyzeduration' '20000000' '-probesize' '20000000' '-i' '/movies/Bad Boys for Life.2020.1080p.Bluray.DTS-HD.MA.5.1.X264-EVO/Bad Boys for Life.2020.1080p.Bluray.DTS-HD.MA.5.1.X264-EVO.mkv' '-filter_complex' '[0:1] aresample=async=1:ocl='\''stereo'\'':osr=48000[0]' '-map' '0:0' '-codec:0' 'copy' '-map' '[0]' '-metadata:s:1' 'language=eng' '-codec:1' 'aac' '-b:1' '256k' '-f' 'dash' '-seg_duration' '5' '-init_seg_name' 'init-stream$RepresentationID$.m4s' '-media_seg_name' 'chunk-stream$RepresentationID$-$Number%05d$.m4s' '-window_size' '5' '-delete_removed' 'false' '-skip_to_segment' '24' '-time_delta' '0.0625' '-manifest_name' 'http://127.0.0.1:32400/video/:/transcode/session/boenm2gikqwsz85nem82lfqo/c7a8414f-fd55-4946-8636-50a75f5d5a2e/manifest?X-Plex-Http-Pipeline=infinite' '-avoid_negative_ts' 'disabled' '-map_metadata' '-1' '-map_chapters' '-1' 'dash' '-start_at_zero' '-copyts' '-y' '-nostats' '-loglevel' 'quiet' '-loglevel_plex' 'error' '-progressurl' 'http://127.0.0.1:32400/video/:/transcode/session/boenm2gikqwsz85nem82lfqo/c7a8414f-fd55-4946-8636-50a75f5d5a2e/progress'

Apr 27, 2020 02:03:47.200 [0x7f801adf5700] DEBUG - Codecs: testing h264 (decoder) with hwdevice vaapi
Apr 27, 2020 02:03:47.200 [0x7f801adf5700] DEBUG - Codecs: hardware transcoding: testing API vaapi
Apr 27, 2020 02:03:47.201 [0x7f801adf5700] DEBUG - Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Input/output error
Apr 27, 2020 02:03:47.201 [0x7f801adf5700] DEBUG - Codecs: testing h264 (decoder) with hwdevice nvdec
Apr 27, 2020 02:03:47.201 [0x7f801adf5700] DEBUG - Codecs: hardware transcoding: testing API nvdec

I’m at a loss as to what the problem is and why it works on mobile but not the web app
It was working flawlessly on Ubuntu 18:04. Attached the PMS logs as well…any help would be appreciated…

Plex Media Server Logs_2020-04-27_02-04-19.zip (4.2 MB)

If the error (13) were a normal Linux error, it would be ā€œPermission Deniedā€ but I find no such error

Given this is a container and relies on the host, where the drivers were previously installed correctly, What is the likelihood of the upgrade having disturbed the driver installation? It can happen and especially when things like the default X11 drivers are installed (nouveau).

I just completed going completely through all your logs.

The error you pointed out about VAAPI is expected & normal on a Ryzen CPU which doesn’t have the QSV ASIC in it. It will fail with the I/O error.

The only other thing I don’t like is the CURL 60 error, which is a Self-Signed certificate error. At this point, I deem it inconsequential to the larger issue.

I dont think its a file permission issue…as I can transcode from a mobile device (albeit slow to start and intermittant)

I’m unsure if the upgrade touched the drivers. I noticed the issue after the upgrade to Ubuntu 20.04 but then as part of troubelshooting I updated the drivers. I blacklisted nouveau and removed and reinstalled the Nvidia driver from their .run file.
(NVIDIA-Linux-x86_64-440.82.run)

@mediabox:~$ lsmod | grep nvidia
nvidia_uvm            966656  2
nvidia_drm             49152  0
nvidia_modeset       1114112  1 nvidia_drm
nvidia              20467712  14 nvidia_uvm,nvidia_modeset
ipmi_msghandler       106496  2 ipmi_devintf,nvidia
drm_kms_helper        184320  4 qxl,nvidia_drm
drm                   491520  5 drm_kms_helper,qxl,nvidia_drm,ttm

I do have a backup of my 18:04 VM, perhaps I may restore that to a secondary VM and do some comparison.

you just introduced a layer of complexity not previously stated.

This is in a Docker container, in a VM, on which kind of host ?

Please provide the full details and what exactly was upgraded because, at this point, the VM introduces an entirely new set of variables

AMD Ryzen 3950x w/ GTX1070
UnRAID 6.8.3 Host
Ubuntu VM
Docker w/ LinuxServer.io Plex container

Nothing has changed at the host level, the only change initially was an upgrade of Ubuntu from 18:04 to 20:04. After noticing the problem and checking permission issues for Plex user (abc) to the transcode path and testing that transcoding worked fine in CPU, I upgraded the Nvidia drivers. Still experiencing the same issue I did a Docker pull on the Plex container.

Before Upgrade it was using Nvidia Driver 435.21 and working fine. It was still running this driver after the Ubuntu upgrade. Upgrading the driver to 440.82 didn’t make a difference.

I do not know where to start with this.

It’s broken in the middle of a configuration which is really complex.

There are users who run the docker directly on UnRaid (which is how it’s most commonly done).

Given it works under 18 but now does not under 20, that is just too much change and too many variables. I just upgraded to 20. There are a LOT of kernel changes.

My best recommendation is to start simplifying. Complexity is nobody’s friend.

As supplemental caveat, there are bugs in 20.04. One might have caught you too.

I built another new Ubuntu 20.04 server fresh. Nvidia 440 driver, nvidia-docker2, docker 19.03 and linuxserver/plex – same issue. I did realise that nvidia-docker2 installs an older version (19.10), theres no 20.04 package of it. It doesnt give any errors but could be related.

I restored my old Ubuntu 18.04 VM and it works perfectly with all the same driver/docker package versions (apart from nvidia-docker2). So seems to be something kernel related or possibly nvidia-docker2 compatibility.

At this point i’m just sticking with the older version now its rolled back; give 20.04 some time to work out bugs.

1 Like

Did you install this container?

Ok since you have an additional VM you might not have.
May I ask why you don’t run the containers directly in unraid? Imho there is no need to run a VM to use docker. Unraid has that built in.

I do have Linuxserver UnRAID Nvidia build installed, but I didnt need it before I even moved the Ubuntu VM to the new server.

To answer your question,there are 2 reasons why its running in Docker on my Ubuntu VM. The first is that I migrated the Ubuntu VM from my old server (VMware), which was already configured with all my mediaserver related apps and custom scripts. The second is that I have virtual lab machines and other automation machines for other tasks running on the host, so it keeps it more ā€˜simple’ compartmentalizing and keeping things that belong together, together.

I’d be interested to see if others have an issue running the latest Plex 1.19.xxxx with HW transcoding in a docker on Ubuntu 20.04 and what their configuration is to make it work properly. I very much doubt that my nested virtualization is related as i’m using IOMMU and essentially its transparent as far as Ubuntu is concerned. Especially as I’d pointed out in my OP, that transcoding does work to mobile app devices (e.g Plex on Android)…i’m only seeing the HW issues under the Web Player and Windows 10 app.

It’s very complicated though as I believe there was possibly transcoder changes in 1.19? Also Docker Nvidia support has changed in Docker 19.03, and theres no Ubuntu 20.04 build of nvidia-docker2. Happy just to leave this thread though and stay on Ubuntu 18.04 and wait to see if other topics pop up given how new 20.04 LTS release is.

Have you installed Audio Video Codecs? it appears Ubunutu 20.04 LTS doesnt install them anymore by default

https://linuxhint.com/install_multimedia_codecs_ubuntu/

No, arent they just for local playback with a media player? Plex should grab its own…e.g https://plex.tv/api/codecs

I haven’t seen any codec related errors.

Resolved by upgrading from Nvidia driver 440.xx to 450.xx thanks to this thread

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.