Hardware Transcoding in Debian 11, or Ubuntu 22.04 Failing

Server Version#:plexmediaserver_1.40.2.8395-c67dce28e_amd64.deb
GPU NVIDIA Quadro P2000
NVIDIA driver 550.90.07 CUDA Version: 12.4

Hello, I have been trying for several weeks now to utilize my Quatro P2000 to transcode video in several different Linux distros. My original plan was to utilize an LXC container within the Proxmox environment to pass my GPU through to the container. I chose this method because I don’t plan on utilizing Plex constantly and could use other lxc containers for other gpu functions. After watching this done in several videos and following the steps I was able to pass the GPU through and use it for programs like hashcat with no issue; however, no matter what it would fail with Plex. When hardware transcoding was active, the video will simply freeze and never restart.

Assuming this was a issue passing the GPU through to the container I utilized the same system and installed Windows 10 as he base and only OS. Using Plex installed with the NVIDIA driver worked fine. Running nvidia-smi showed Plex operated fine. This convinced me that none of the issues were hardware in nature.

After numerous different installs of several Linux distros including Ubuntu 20.04, Ubuntu 22.04, Debian 11 as a base OS, NONE have successfully worked. I attempted adding NVIDIA encode and decode packages and this didn’t help. I also installed the Cuda library from the developer sdks with no help.

I am looking for any ideas on what I am missing. I even tried different versions of Plex with no success. Grepping Plex logs didn’t reveal any obvious issues. During all the installs Plex recognizes the NVIDIA GPU and the Quadro P2000 appears in the Plex Media Server Log so I don’t think permissions are the issue. Here is an example from the log:

./Logs/Plex Media Server.log:Jun 12, 2024 12:52:15.593 [140225283722040] DEBUG - [Req#97c/Transcode] Codecs: testing h264 (decoder) with hwdevice nvdec

./Logs/Plex Media Server.log:Jun 12, 2024 10:23:15.186 [140225290050360] DEBUG - [Req#641/Transcode] Codecs: hardware transcoding: testing API nvdec for device ‘pci:0000:01:00.0’ (GP106GL [Quadro P2000])

Looking for any help as I am out of ideas.

Can you please provide the DEBUG logs ZIP of the entire playback attempt?
Two lines is insufficient.

Points when using PMS in a LXC and passing the Nvidia GPU.

  1. You must create the container with the Nvidia driver runtimes passed
    -OR-
    You must install the Nvidia drivers (the .run bundle) with the --no-kernel-modules option to install the client-side runtime

  2. You must add the device (GPU) to the container config.
    This is my generic script to add it

[chuck@lizum lxc.2008]$ cat add-gpu

#
# Argument #1 is LXC container to add

[ -z "$1" ] && "Error: missing container name" && exit 1
if [ "$(lxc list | grep "$1")" == "" ]; then
  echo "Error: Unknown container name '$1'"
  exit 2
fi

# Make certain /dev/dri/renderD128 exists
if [ ! -e /dev/dri/renderD128 ]; then
  echo Error:  This host does not have hardware transcoding ability /dev/dri/renderD128
  exit 3
fi

Gid="$(stat -c %g /dev/dri/renderD128)"

# Add it
 lxc config device add "$1" gpu gpu gid=$Gid

Thank you so much for the quick reply.
logs.zip (630.4 KB)
I uploaded my logs. As for my current lxc.config this is what I have:

lxc.cgroup2.devices.allow = c 195%3A0 rw

Pass through device files

arch: amd64
cores: 4
hostname: plex-test-4
memory: 4096
net0: name=eth0,bridge=vmbr0,hwaddr=C6:B2:4C:FD:8D:34,ip=dhcp,type=veth
ostype: ubuntu
rootfs: local-lvm:vm-100-disk-0,size=75G
swap: 512
lxc.cgroup2.devices.allow: c 195:0 rw
lxc.cgroup2.devices.allow: c 195:255 rw
lxc.cgroup2.devices.allow: c 195:254 rw
lxc.cgroup2.devices.allow: c 237:0 rw
lxc.cgroup2.devices.allow: c 237:1 rw
lxc.cgroup2.devices.allow: c 10:144 rw
lxc.mount.entry: /dev/nvidia0 dev/nvidia0 none bind,optional,create=file
lxc.mount.entry: /dev/nvidiactl dev/nvidiactl none bind,optional,create=file
lxc.mount.entry: /dev/nvidia-modeset dev/nvidia-modeset none bind,optional,create=file
lxc.mount.entry: /dev/nvidia-uvm dev/nvidia-uvm none bind,optional,create=file
lxc.mount.entry: /dev/nvidia-uvm-tools dev/nvidia-uvm-tools none bind,optional,create=file
lxc.mount.entry: /dev/nvram dev/nvram none bind,optional,create=file

When running the NVIDIA drivers in the lxc I did use the --no-kernel-module option. Here is the output from my LSPCI -V:

01:00.0 VGA compatible controller: NVIDIA Corporation GP106GL [Quadro P2000] (rev a1) (prog-if 00 [VGA controller])
Subsystem: Hewlett-Packard Company GP106GL [Quadro P2000]
Physical Slot: 3
Flags: bus master, fast devsel, latency 0, IRQ 30
Memory at f6000000 (32-bit, non-prefetchable) [size=16M]
Memory at e0000000 (64-bit, prefetchable) [size=256M]
Memory at f0000000 (64-bit, prefetchable) [size=32M]
I/O ports at e000 [size=128]
Expansion ROM at 000c0000 [virtual] [disabled] [size=128K]
Capabilities: [60] Power Management version 3
Capabilities: [68] MSI: Enable+ Count=1/1 Maskable- 64bit+
Capabilities: [78] Express Legacy Endpoint, MSI 00
Capabilities: [100] Virtual Channel
Capabilities: [128] Power Budgeting <?> Capabilities: [420] Advanced Error Reporting Capabilities: [600] Vendor Specific Information: ID=0001 Rev=1 Len=024 <?>
Kernel driver in use: nvidia
Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia

When I ran it in the LXCs it was the same. Other than installing the NVIDIA drivers do any other libraries need to be installed other than the required NVIDIA dependencies?

I will definitely try your script. Can you provide me an example of how its run? I assume would run it as ./scriptname.sh 101 (101 being the lxc number). Also I see the screenshot you provided but am not sure what it is an example of.

Is this on ProxMox?

“101” sounds like a Proxmox container id.

My script is intended for use with LXC native on Linux with LXD.

If this is Proxmox, discard what I’ve said.
There are multiple How-To’s here in the forum to setup Nvidia with Proxmox.

Yes, it is within Proxmox. I believe I have followed all of the steps on setting up in proxmox lxc; however, I can’t even get transcoding to function within any Linux environment. So I am very interested if you can spot anything in the logs or believe I missed any steps or libraries that are required.

PMS will natively support the P2000 on Debian.
(I have a P2200 on Ubuntu 22.04)

I am using nvidia drivers 535.

There are two important modules you must also install.

  1. libnvidia-decode
  2. libnvidia-encode

On my machine, these are the core packages installed.

ii  libnvidia-common-535-server            535.161.08-0ubuntu2.22.04.1              all          Shared files used by the NVIDIA libraries
ii  libnvidia-compute-535-server:amd64     535.161.08-0ubuntu2.22.04.1              amd64        NVIDIA libcompute package
ii  libnvidia-decode-535-server:amd64      535.161.08-0ubuntu2.22.04.1              amd64        NVIDIA Video Decoding runtime libraries
ii  libnvidia-encode-535-server:amd64      535.161.08-0ubuntu2.22.04.1              amd64        NVENC Video Encoding runtime library

Notice, They epressly call out nvdec and nvenc capability – which is what PMS needs in addition to the base Nvidia driver

This might be what you’re missing.

So I have been trying to install libnvidia-compute-535-server:amd64, libnvidia-decode-535-server:amd64, libnvidia-encode-535-server:amd64 after installing NVIDIA-Linux-x86_64-535.161.07.run. I keep getting “Failed to initialize NVML: Driver/library version mismatch NVML library version: 535.161” the driver is 535.161.07 and the libnvidia-compute-535-server:amd64 is 535.161.08. I can’t figure out how to force the install of the libraries to match the driver version. I keep getting the error when I install libnvidia-compute-535-server:amd64. Do you have any suggestions? I have Ubuntu 22.04 installed on a computer so this is not a virtualized or containerized environment.

After you install , you must update the initramfs so the runtime libraries and the kernel drivers (which load during OS load from the init-ramdisk) and then reboot

hint: sudo update-initramfs :slight_smile:

Ok so I was never able to get those libraries to install without conflicting with the NVIDIA-SMI even after a sudo update-initramfs; however, I was successful in getting plex to transcode with a quatro P2000 running on Ubuntu 22.04 using the 535.161.07 driver.

However, when I went back to trying my initial goal of running plex from an LXC container in Proxmox using Ubuntu 22.04 and the 535.161.07 driver it fails.

I have followed the process I’ve found in several youtube videos. The container will run GPU programs like hashcat and doing an NVIDIA SMI from proxmox shows it using the GPU. I’m using proxmox 7.4-18

Can you point me at any current documentation that has worked to your knowledge? Everything I have found is at least 2 years old. Although I don’t think that would be an issue, I haven’t been successful in any manner. One note worthy thing is that the /dev/dri is not shown in the LXC. Plex only offers auto for selecting the transcoder and does not show the P2000 like installed as a base OS. I suspect this may be an issue; however, none of the videos or documentation I have seen address this as the Plex versions were older. I even tried adding the address of the P2000 obtained from lspci to the plex preferences, but this did not help.

Success. So after finding a post from you from back in 2017 I was able to pass the /dev/dri files through to the lxc container. A combination of using NVIDIA 535.161.07, Ubuntu 22.04 as the LXC container, the newest version of PLEX plexmediaserver_1.40.3.8555-fef15d30c_amd64.deb, and selecting the P2000 GPU after passing through the /dev/dri files was the successful combination. Thank you for the help.

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