Hardware transcoding not working, while PMS in kvm in docker

I have read almost all the posts and still have no solution. Sincerely ask for help.

Server Version#: 1.20.2.3402
Player Version#: 1.20.2.3402(web)

  • CPU: i3-8100 (no other gpu card)

  • Host: ESXI

  • KVM: Debian 10

  • Docker Images: plexinc/pms-docker:1.20.2.3402-0fec14d92

  • Log: Plex Media Server.log (417.6 KB)

  • /dev/dir

    ls -l /dev/dri
    
    drwxrwxrwx 2 nobody users       80 10月  3 15:17 by-path
    crwxrwxrwx 1 nobody users 226,   0 10月  3 15:17 card0
    crwxrwxrwx 1 nobody users 226, 128 10月  3 15:17 renderD128
    

may the key Information is

Oct 10, 2020 09:11:15.771 [0x7efd20ff9700] DEBUG - [Transcode] Codecs: hardware transcoding: testing API nvenc
Oct 10, 2020 09:11:15.772 [0x7efd20ff9700] ERROR - [Transcode] [FFMPEG] - Cannot load libcuda.so.1
Oct 10, 2020 09:11:15.772 [0x7efd20ff9700] ERROR - [Transcode] [FFMPEG] - Could not dynamically load CUDA
Oct 10, 2020 09:11:15.772 [0x7efd20ff9700] DEBUG - [Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Unknown error occurred
Oct 10, 2020 09:11:15.772 [0x7efd20ff9700] DEBUG - [Transcode] Codecs: testing vp9 (decoder) with hwdevice vaapi
Oct 10, 2020 09:11:15.772 [0x7efd20ff9700] DEBUG - [Transcode] Codecs: hardware transcoding: testing API vaapi
Oct 10, 2020 09:11:15.772 [0x7efd20ff9700] DEBUG - [Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Input/output error
Oct 10, 2020 09:11:15.772 [0x7efd20ff9700] DEBUG - [Transcode] Codecs: testing vp9 (decoder) with hwdevice nvdec

How is the CPU ending up with nobody:users ?
That is not how the kernel does it by default.

Please add the UID/GID for user plex , the runtime user (if not plex)
and their associated groups.

Also please add if udev is installed

I’m not really understanding why you’re performing the double abstraction:
a. KVM
b. Docker within the KVM

You do realize that’s making it more complex and subject to this kind of problem?

Hi Chucpa,

/dev/dri default permission is root:root, but from the plex log, found no hardware decode accelerator found error, so, I try root:plex and nobody:users, then the errors are all probably not supported by this system, error: Input/output error.

Plex env is b, docker within the debian kvm.

This machine is not exclusive to plex, there are many dockers and other kvm (win + centos) exist.

Thanks.

Is anything else accessing / laying claim to /dev/dri?

If so, then that explains the failure to init & detect.

On your system is udev package installed?

On my Debian 10 VM,

chuck@debian10:~/Downloads$ 
chuck@debian10:~/Downloads$ ls -la /dev/dri
total 0
drwxr-xr-x   3 root root        100 Aug 20 23:05 .
drwxr-xr-x  17 root root       3260 Oct 10 21:56 ..
drwxr-xr-x   2 root root         80 Aug 20 23:05 by-path
crw-rw----+  1 root render 226,   0 Oct 10 21:56 card0
crw-rw----+  1 root render 226, 128 Aug 20 23:05 renderD128
chuck@debian10:~/Downloads$ 

All you need to make it work is obtain the GID used and assign it to the PGID of the container or add the PUID username to that group (should be render)

I am starting to think either:

a. The ESXi passthrough isn’t granting full permission
b. The Debian (host OS for the PMS container) needs udev package and tweaking of PUID & PGID

Just because the machine is running many other VMs doesn’t mean you can’t lean-out the one with Plex in. Docker requires you to setup everything yourself. Running the “native” package does all the setup for you, It’s still atomic. (/usr/lib/plexmediaserver and /var/lib/plexmediaserver)

what I’m hinting at is: You’ve got ESXi , why make it tough by adding docker? Instead, leverage ESXi. I have VMware Workstation here and have 13 VMs each with native PMS – No docker.

Follow you suggestin, add the user root to group render, as follows,

On debian 10 VM,

root@debian:/dev/dri# pwd
/dev/dri
root@debian:/dev/dri# ls -l
总用量 0
drwxrwxrwx 2 root root         80 10月  3 15:17 by-path
crwxrwxrwx 1 root render 226,   0 10月  3 15:17 card0
crwxrwxrwx 1 root render 226, 128 10月  3 15:17 renderD128

In docker container (same group id, render in docker container is video1) ,

root@debian:/dev/dri# pwd
/dev/dri
root@debian:/dev/dri# ls -l
total 0
crwxrwxrwx 1 root video1 226,   0 Oct 11 03:32 card0
crwxrwxrwx 1 root video1 226, 128 Oct 11 03:32 renderD128

Docker env list:

PLEX_UID: 0(root)
PLEX_GID: 0(root)

Also, undev package is installed,

root@debian:/dev/dri# apt list | grep udev

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

bilibop-udev/stable 0.5.6 amd64
brightness-udev/stable 0.4-1 all
gir1.2-gudev-1.0/stable 232-2 amd64
hdmi2usb-udev/stable 0.0.1-2 all
ledger-wallets-udev/stable 0.2 all
libgudev-1.0-0/stable 232-2 amd64
libgudev-1.0-dev/stable 232-2 amd64
libgudev1.0-cil-dev/stable 0.1-4 all
libgudev1.0-cil/stable 0.1-4 all
librust-libudev-sys-dev/stable 0.1.4-1 amd64
libtss2-udev/stable 2.1.0-4 all
libu2f-udev/stable 1.1.9-1 all
libudev-dev/stable 241-7~deb10u4 amd64
libudev1/stable,now 241-7~deb10u4 amd64 [已安装]
libyubikey-udev/stable 1.19.3-3+deb10u1 all
limesuite-udev/stable 18.06.0+dfsg-1 all
ludevit/stable 8.1 all
monodoc-gudev-manual/stable 0.1-4 all
python-pyudev/stable 0.21.0-1 all
python3-pyudev/stable 0.21.0-1 all
sg3-utils-udev/stable 1.44-1 all
system-config-printer-udev/stable 1.5.11-4 amd64
udev/stable,now 241-7~deb10u4 amd64 [已安装]
udevil/stable 0.4.4-2 amd64
uudeview/stable 0.5.20-11 amd64

But the result is still the same,

Oct 11, 2020 04:02:26.785 [0x7f3fa97fa700] DEBUG - [Transcode] Codecs: hardware transcoding: testing API vaapi
Oct 11, 2020 04:02:26.786 [0x7f3fa97fa700] DEBUG - [Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Input/output error
Oct 11, 2020 04:02:26.786 [0x7f3fa97fa700] DEBUG - [Transcode] Codecs: testing h264_nvenc (encoder)
Oct 11, 2020 04:02:26.786 [0x7f3fa97fa700] DEBUG - [Transcode] Codecs: hardware transcoding: testing API nvenc
Oct 11, 2020 04:02:26.786 [0x7f3fa97fa700] ERROR - [Transcode] [FFMPEG] - Cannot load libcuda.so.1
Oct 11, 2020 04:02:26.786 [0x7f3fa97fa700] ERROR - [Transcode] [FFMPEG] - Could not dynamically load CUDA
Oct 11, 2020 04:02:26.786 [0x7f3fa97fa700] DEBUG - [Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Unknown error occurred
Oct 11, 2020 04:02:26.786 [0x7f3fa97fa700] DEBUG - [Transcode] Codecs: testing vp9 (decoder) with hwdevice vaapi

Is there a way to know which hwa implementations and which gpu device the plex uses? It would be great if user can set the hardware detailed configuration in the web ui, such as VAAPI device.

what I’m hinting at is: You’ve got ESXi , why make it tough by adding docker? Instead, leverage ESXi. I have VMware Workstation here and have 13 VMs each with native PMS – No docker.

Beacuse all data disks direct pass-through to kvm, in order to debian can control S.M.A.R.T.

If use native plex package, everythins will be ok, but the reason for using docker is easy to monitor all apps status, and don’t worry about breaking the host. For users, docker is simple.

I guess we have two different philosophies.

  1. I let the NAS handle all the data disks. All media is network share mounted.
  2. Each OS VM is minimal for the task (but still a “workstation” distribution.
  3. I never run things as “root” because of the inherent network share issues.
  4. PMS, whether in VM or native, is unprivleged.
  5. Were I to stand up a container, and do passthrough, I’d probably install PMS on the host for the setup of udev and then let it sit disabled and have the container use the Plex UID/GID. I

Did you install a server distro or a workstation distro as the VM base?

I’m trying to figure out why my VMs are passing through without issue when yours are not. That wreaks of VM privilege at the ESXi level. I’d check if I could but don’t have any ESXi boxes setup right not.

Afterthought: What about apparmour ? Is it running on that machine?
I know it caused problems with SNAP installations attempting to access the hardware and blocked that access until updated.

Well, thank you so much for your patient explanation.

According to various attempts, it should be my local env problem.

Next, i will try,

a. adjust esxi gpu config
b. add other unique gpu card for debian kvm

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