Linux Plex is not using my Nvidia GPU to HW Transcoding

I’ve had this feature enabled for a really long time and thought it was working when I had my GTX 770 in my server. I just updated my Plex server today and found that Plex is not even able to detect the new RTX 2060. My drivers are installed and work since I can get the GPU to display a picture, but it seems the server does not know that it’s supposed to use the GPU instead of the Intel integrated Graphics (i5 4770k).

Did I miss a step during my initial installation? Is there a command that I still need to run on my linux box to get it working. Plex server is configured to use HW Transcoding, and I can see it tries during remote streams. I really need help on this part.

You didn’t miss a step but your nvidia drivers might need updating to support the new card.

SSH in to the server and type ‘lspci -v’ and see which kernel driver is assigned to the graphics card. If it’s nouveau then the drivers aren’t installed correctly.

I see…
I ran that command and confirmed the ‘nouveau’ driver

01:00.0 VGA compatible controller: NVIDIA Corporation TU106 [GeForce RTX 2060 Rev. A] (rev a1) (prog-if 00 [VGA controller])
Subsystem: ZOTAC International (MCO) Ltd. TU106 [GeForce RTX 2060 Rev. A]
Flags: bus master, fast devsel, latency 0, IRQ 33
Memory at d2000000 (32-bit, non-prefetchable) [size=16M]
Memory at c0000000 (64-bit, prefetchable) [size=256M]
Memory at d0000000 (64-bit, prefetchable) [size=32M]
I/O ports at e000 [size=128]
Expansion ROM at 000c0000 [disabled] [size=128K]
Capabilities:
Kernel driver in use: nouveau
Kernel modules: nvidia

So I’m guessing I have to delete that driver and load in the correct one?
Do we know which driver I’m looking for??

I’m thinking you need to install nvidia-driver-510. That’s what I have and while I don’t use Ubuntu as my Plex server I have used my Linux desktop with an NVIDIA GeForce RTX 2060 SUPER/PCIe/SSE2 card to transcode things in a Docker container (note I had to install nvidia-docker2 for that) using Tdarr (see: GitHub - HaveAGitGat/Tdarr: Tdarr - Distributed transcode automation using FFmpeg/HandBrake + Audio/Video library analytics + video health checking (Windows, macOS, Linux & Docker)) so I know the driver is installed and transcodes.

0a:00.0 VGA compatible controller: NVIDIA Corporation TU106 [GeForce RTX 2060 SUPER] (rev a1) (prog-if 00 [VGA controller]). Corp. TU106 [GeForce RTX 2060 SUPER]
        Flags: bus master, fast devsel, latency 0, IRQ 108, IOMMU group 16
        Memory at fb000000 (32-bit, non-prefetchable) [size=16M]
        Memory at d0000000 (64-bit, prefetchable) [size=256M]
        Memory at e0000000 (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: [250] Latency Tolerance Reporting
        Capabilities: [258] L1 PM Substates
        Capabilities: [128] Power Budgeting <?>
        Capabilities: [420] Advanced Error Reporting
        Capabilities: [600] Vendor Specific Information: ID=0001 Rev=1 Len=024 <?>
        Capabilities: [900] Secondary PCI Express
        Capabilities: [bb0] Physical Resizable BAR
        Kernel driver in use: nvidia
        Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia

Yes, with the nouveau kernel Plex will not see the card and won’t use it for transcode. With HW ticked in Plex it will try and use the CPU.

You need to blacklist the nouveau driver first. Use these commands: -

sudo bash -c "echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf"

sudo bash -c "echo options nouveau modset=0 >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf"

sudo update-initramfs -u

Now reboot

Enter ‘lspci -v’ and it should show that no Kernal driver is loaded.

We need some libraries to install the NVIDIA driver now: -

sudo apt install build-essential libglvnd-dev pkg-config

Now run the NVIDIA installer from wherever it’s located on your machine.

** sudo ./NVIDIA-Linux-x86_64-###.##.##.run**

Where the # is the version number of the driver you downloaded.

After the install you can type ‘lspci -v’ again and it should show the card using the NVIDIA kernel drivers.

If you now enter nvidia-smi you will see a status of the card: -

±----------------------------------------------------------------------------+
| NVIDIA-SMI 510.60.02 Driver Version: 510.60.02 CUDA Version: 11.6 |
|-------------------------------±---------------------±---------------------+
| 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 NVIDIA GeForce … Off | 00000000:01:00.0 Off | N/A |
| 33% 24C P8 5W / 180W | 2MiB / 8192MiB | 0% Default |
| | | N/A |
±------------------------------±---------------------±---------------------+

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

If you now try doing a transcode in Plex and run the above command you should show a process running down in the area where it says ‘No running processes found’.

And it should be using the NVIDIA card for transcoding.

If I may add?

I use ubuntu server 20.04 without graphical desktop.

You’ll probably find the drivers being updated soon after installation.

[chuck@lizum ~.2002]$ gog nvidia-smi
Mon Jun  6 18:35:28 2022       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 510.73.05    Driver Version: 510.73.05    CUDA Version: 11.6     |
|-------------------------------+----------------------+----------------------+
| 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        On   | 00000000:07:00.0 Off |                  N/A |
| 48%   38C    P8     4W /  75W |      1MiB /  5120MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+
[chuck@lizum ~.2003]$ 

That seems to be the hard way to do it. For the record, I do not even have an /etc/modprobe.d/blacklist-nvidia-nouveau.conf file at all. I’m pretty sure I just did sudo apt install nvidia-driver-510 and it installed the driver and updated the kernel and after a reboot everything was fine. You might want to try that first before trying the hard way outlined above.

I also downloaded the source for nvtop (top(1) for Nvidia) and it shows me when my GPUs are being used for ffmpeg transcoding.

I’m using Ubuntu Server 20.04 and installing the drivers didn’t overwrite the kernel when I installed. It seems to be different for different cards I guess.

Whatever works and gets it going, the above process worked for me.

Whatever works indeed. I’m just saying it might be easier to try the apt install first and if that doesn’t work try your more detailed way of installing.

I’ve found Nvidia confusing and welcome an easier approach of just using apt.

THIS…Fixed it

thank you soooo much. I had the NVIDIA driver installed from an earlier reply, but that last part I needed was to block the nouveau kernal. I just tested the Transcoding and I can see Plex Transcoder listed under process:


+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A       924      G   /usr/lib/xorg/Xorg                 23MiB |
|    0   N/A  N/A      1079      G   xfwm4                               2MiB |
|    0   N/A  N/A      2202      C   ...diaserver/Plex Transcoder      657MiB |
+-----------------------------------------------------------------------------+

Yippie!

Odd that I did not have to block the nouveau to get this to work.

Good to see, glad that it’s working for you. It does seem to work differently for different cards.

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