Ubuntu 22.04 - nVidia GTX 1050 Ti 4GB GPU . Hardware acceleration not working for 4K HDR transcoding

Server Version#: 1.30.1.6497
Player Version#: N/A, Unsure, Plex web

I have a Plex Pass and installed the above GPU in my Plex Media Server desktop PC.
I have all the correct settings under Transcoder, including advanced settings .
The GPU isn’t getting used for transcodes of 4K HDR media, specifically the UHD version of 2001 Space Odyssey for playback on any client that requires transcoding (Plex web, Chromecast Ultra, Raspberry Pi 3B, etc, attached to HD SDR displays).
The CPU (i5-6600k, overclocked to 4.4 GHz) isn’t able to keep up when HDR tonemapping is enabled, which is required for this content. Network is definitely not the issue. Server has a 10 Gbps connection, and so does one of the clients with Plexweb. Dashboard shows CPU at 80-93% and the word “hw” does not appear in the transcode details.
I’m using the nVidia driver version 525 . Ubuntu 22.04 is up to date.

The server log contains the following :
Dec 19, 2022 21:06:23.605 [0x7fa38daefb38] DEBUG - [GPU] Got device: GP107 [GeForce GTX 1050 Ti], nvidia@unknown, default true, best true, ID /dev/dri/renderD128, DevID [10de:1c82:1462:8c96], flags 0xe

Questions :

  1. is this GPU capable of transcoding 4K/HDR content ?
  2. if yes, why isn’t the GPU getting used in this case ? I’m happy to provide further logs if I know which to send.
  3. if not, is there another GPU that is capable ? I was under the impression the 1050Ti should be OK for one 4K stream.

I rebooted the system. Very strangely, the server is now using hardware. It’s showing this.

image

Unfortunately, it’s still buffering terribly.

Bandwidth peaks at 25 Mbps.
CPU is now a straight line around 65% - reduced from the 80+%…

RAM is at 20%.

This is between two machines each connected through a 10 gig switch - no Internet in the picture - no Wifi, no bandwidth issue.

The client in this case is an AMD 5950X with 64GB RAM and 3060Ti GPU, with Plex web in a browser.
Server as previously mentioned is i5-6600k OC at 4.4 GHz , 32GB RAM, and 1050Ti GPU.

Obviously the client can play the movie when using the native Plex Windows client as that uses DirectPlay (and tons more bandwidth).

Some of the other clients I have on my LAN/WLAN can’t use DirectPlay, though. They require transcoding, even with their native clients. And in every case with this content, there is pretty awful buffering (every 0.5s-2s).

We don’t care about the client machine .

Basic checks of the server:

  1. nvidia-smi shows the card
  2. /dev/dri shows the card ? (/dev/dri/renderD129)
  3. On a machine with both iGPU and Nvidia, HardwareDevicePath="/dev/dri/renderD129" has been added to Preferences.xml with Plex stopped ?

It’s interesting that the playback information display is showing the bandwidth requirement as 10 Gbps. That should normally show the actual average bitrate of the media (or a close approximation). Have you had that in your library for long? Deep analysis runs as a scheduled task overnight, if enabled. I wonder if that might be interfering with the transcode in some way.

I know. I’ve asked.

1 Like
  1. yes, nvidia-smi shows the card
    This is what it shows when PMS is stopped:
# nvidia-smi
Wed Dec 21 14:19:00 2022       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.60.11    Driver Version: 525.60.11    CUDA Version: 12.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  NVIDIA GeForce ...  Off  | 00000000:02:00.0 Off |                  N/A |
| 45%   24C    P8    N/A /  75W |     63MiB /  4096MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      3489      G   /usr/lib/xorg/Xorg                 55MiB |
|    0   N/A  N/A      3708      G   /usr/bin/gnome-shell                4MiB |
+-----------------------------------------------------------------------------+

Here is what it shows when I restart the server, and try playing 2001 again in Plex Web under Chrome on my client :

root@server10g:/var/lib/plexmediaserver/Library/Application Support/Plex Media Server# nvidia-smi
Wed Dec 21 14:33:09 2022       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.60.11    Driver Version: 525.60.11    CUDA Version: 12.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  NVIDIA GeForce ...  Off  | 00000000:02:00.0 Off |                  N/A |
| 45%   32C    P0    N/A /  75W |    709MiB /  4096MiB |      4%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      3489      G   /usr/lib/xorg/Xorg                 55MiB |
|    0   N/A  N/A      3708      G   /usr/bin/gnome-shell                4MiB |
|    0   N/A  N/A     42837      C   ...diaserver/Plex Transcoder      644MiB |
+-----------------------------------------------------------------------------+

I also ran the following during that transcode. It shows very low utilization. But both the encoders and decoders are being used, still.

Every 2.0s: nvidia-smi -q -d UTILIZATION                                                     server10g: Wed Dec 21 14:35:53 2022


==============NVSMI LOG==============

Timestamp                                 : Wed Dec 21 14:35:53 2022
Driver Version                            : 525.60.11
CUDA Version                              : 12.0

Attached GPUs                             : 1
GPU 00000000:02:00.0
    Utilization
        Gpu                               : 4 %
        Memory                            : 2 %
        Encoder                           : 4 %
        Decoder                           : 3 %
    GPU Utilization Samples
        Duration                          : 11.71 sec
        Number of Samples                 : 71
        Max                               : 8 %
        Min                               : 2 %
        Avg                               : 3 %
    Memory Utilization Samples
        Duration                          : 11.71 sec
        Number of Samples                 : 71
        Max                               : 3 %
        Min                               : 0 %
        Avg                               : 1 %
    ENC Utilization Samples
        Duration                          : 11.71 sec
        Number of Samples                 : 71
        Max                               : 16 %
        Min                               : 0 %
        Avg                               : 5 %
    DEC Utilization Samples
        Duration                          : 11.71 sec
        Number of Samples                 : 71
        Max                               : 8 %
        Min                               : 3 %
        Avg                               : 3 %

So, it looks like’s using the card now, although the GPU utilization seems to be very low.

2./dev/dri/renderD128 shows the card
3. I don’t have this setting in Preferences.xml with Plex stopped. My iGPU is disabled on this machine. There is a single monitor attached to the nVidia GTX 1050 Ti is active.

I just tried to play another movie, Matrix Resurrections. In this case, it does not trigger the transcode. Plex web does DirectStream. And the bandwidth shown is much less.

image

nvidia-smi shows 0% utilization in this case with DirectStream, as expected.

I have got no idea why it shows 10 Gbps requirement for 2001 . 10 Gbps is the speed of the NIC.
It’s using nowhere near that amount of bandwidth when I bring up task manager to look at the Ethernet stats. The client is buffering most of the time and stalled.

My 2001 movie is an MKV file. I believe I created it by ripping my original disc of the movie with Imgburn/Anydvd. I then used MakeMKV to create the MKV. I can play this MKV fine in other players. JRiver Media Center shows it’s got a variable bit rate fluctuating between 60 and 80 Mbps. The MKV fille is 84GB.

2001 is my favorite movie of all time, so not being able to play it is a big bummer for me. I know I could do a manual transcode to a lower resolution, but I put the GPU in my Plex server precisely so that I didn’t have to do thaT.

Looking at those 2 movies above, it looks like 2001 shows as “Dovi/HDR10” whereas Matrix resurrections showed as HDR10 only. I tried a third movie, Star Wars: Episode IX. I believe I generated the MKV file the same way as the 2001 disc.

It’s shows as follows in Plex dashboard, and buffering is the same as with 2001. No “DoVi” indication there, but it still shows “10 Gbps”.

image

I forced a transcode to 480p and it is using the GPU successfully for this case, with no buffering.

![image|458x656](upload://lMTwlG6mPwz1JGYhh01QGFtYy7A.png)

Every 2.0s: nvidia-smi -q -d UTILIZATION                                                     server10g: Wed Dec 21 15:03:27 2022


==============NVSMI LOG==============

Timestamp                                 : Wed Dec 21 15:03:27 2022
Driver Version                            : 525.60.11
CUDA Version                              : 12.0

Attached GPUs                             : 1
GPU 00000000:02:00.0
    Utilization
        Gpu                               : 0 %
        Memory                            : 0 %
        Encoder                           : 0 %
        Decoder                           : 0 %
    GPU Utilization Samples
        Duration                          : 11.71 sec
        Number of Samples                 : 71
        Max                               : 20 %
        Min                               : 0 %
        Avg                               : 0 %
    Memory Utilization Samples
        Duration                          : 11.71 sec
        Number of Samples                 : 71
        Max                               : 32 %
        Min                               : 0 %
        Avg                               : 1 %
    ENC Utilization Samples
        Duration                          : 11.71 sec
        Number of Samples                 : 71
        Max                               : 7 %
        Min                               : 0 %
        Avg                               : 0 %
    DEC Utilization Samples
        Duration                          : 11.71 sec
        Number of Samples                 : 71
        Max                               : 83 %
        Min                               : 0 %
        Avg                               : 3 %

Seems like this comes down to a bug in Plex where transcode doesn’t work on my Imgburn/AnyDVD/MakeMKV generated MKV files of 2001 and Star Wars Episode IX.

The Matrix Resurrections file isn’t one of those and doesn’t have the problem.

Future reference.:

[chuck@glockner ~.2003]$ nvidia-smi
Wed Dec 21 18:16:11 2022       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.86.01    Driver Version: 515.86.01    CUDA Version: 11.7     |
|-------------------------------+----------------------+----------------------+
| 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 |
| 47%   40C    P0    21W /  75W |     65MiB /  5120MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A    705812      C   ...diaserver/Plex Transcoder       61MiB |
+-----------------------------------------------------------------------------+
[chuck@glockner ~.2004]$ 

When debugging at this level (basic functionality), we don’t need the command line options. the basic command tells me everything i need to see.

As for the media, I cannot advise your ripping method.

I use MakeMKV and MKVtoolnix

-rw-r--r--   1 chuck chuck 76645830961 Apr 16  2021 2001: A Space Odyssey (1968).mkv
[chuck@glockner 2001: A Space Odyssey (1968).2008]$ mediainfo 2001\:\ A\ Space\ Odyssey\ \(1968\).mkv 
General
Unique ID                                : 198995725149077563329206436046719461759 (0x95B52EBE04F7E9CB51E74D1A0FF0A97F)
Complete name                            : 2001: A Space Odyssey (1968).mkv
Format                                   : Matroska
Format version                           : Version 4
File size                                : 71.4 GiB
Duration                                 : 2 h 28 min
Overall bit rate mode                    : Variable
Overall bit rate                         : 68.7 Mb/s
Movie name                               : 2001: A Space Odyssey (1968) 4k
Encoded date                             : UTC 2021-04-16 20:31:14
Writing application                      : mkvmerge v53.0.0 ('Fool's Gold') 64-bit
Writing library                          : libebml v1.4.2 + libmatroska v1.6.2

Thanks. My mkv file looks as follows . Looks like it’s got a higher bit rate than yours.

I can try to rip it again with MakeMKV directly.

Still, the fact that JRiver has no issue with this MKV file, and many others, tells me may be a bug in Plex Media Server here. IMO, it should be able to handle my MKV files without having to re-rip them, which is an inconvenience.

mediainfo 2001-\ A\ Space\ Odyssey.mkv  |more
General
Unique ID                                : 235148032101885753679915460898940165464 (0xB0E7DD176FF4DF9F75EF84A042F29D58)
Complete name                            : 2001- A Space Odyssey.mkv
Format                                   : Matroska
Format version                           : Version 2
File size                                : 78.2 GiB
Duration                                 : 2 h 28 min
Overall bit rate mode                    : Variable
Overall bit rate                         : 75.3 Mb/s
Movie name                               : 2001: A Space Odyssey
Encoded date                             : UTC 2021-07-23 09:50:38
Writing application                      : MakeMKV v1.16.4 win(x64-release)
Writing library                          : libmakemkv v1.16.4 (1.3.10/1.5.2) win(x64-release)
  1. The bitrate shown there also includes the subtitles and other audio tracks.
    I have only the the main.

  2. I only have MKV files. I’m not experiencing any issues like this. If there were an issue with MKVs, PMS wouldn’t have been released at all.

  1. Just because you aren’t running into a specific bug with your MKV files, doesn’t mean others aren’t with their MKV files. MKV is a complex format. As a software engineer, I can promise you that bugs do happen. It is likely specific to a subset of MKV files, not to all MKV files, obviously. Indeed, I have some MKV files that work with PMS, and others that don’t work. Most of my 4K MKV files don’t work with PMS, unfortunately, and I’d like to see that fixed. I may be misremembering the specific way I ripped some of them, but I don’t think it matters. The end result is that PMS doesn’t handle some MKV files that other apps handle OK.

Is there a way to open a ticket and submit the problematic MKV files so that this can be looked at by Plex ?

FYI, I uninstalled AnyDVD on my Windows PC, rebooted, installed the latest MakeMKV, and re-ripped the physical media with it. I then moved it to my Linux NAS and restarted PMS with systemctl. I’m seeing the same problem with buffering. But now it’s no longer using the GPU again, and CPU is peaked once more.
This is what Dashboard now shows (no hw, sigh - I didn’t change a single setting in PMS, just restarted it) :

image

I just rebooted the system and now PMS is back to doing this :

image

Ie. it’s doing hardware transcode again. But unfortunately, still buffering.

The brand new MKV file looks like this :

root@server10g:/array/zfs/MKV Movies/4K# mediainfo 2001.mkv  |more
General
Unique ID                                : 269164277855482373454313285611217514189 (0xCA7F277E1DA340811B4B3F05F6546ECD)
Complete name                            : 2001.mkv
Format                                   : Matroska
Format version                           : Version 2
File size                                : 78.2 GiB
Duration                                 : 2 h 28 min
Overall bit rate mode                    : Variable
Overall bit rate                         : 75.3 Mb/s
Movie name                               : 2001: A Space Odyssey
Encoded date                             : UTC 2022-12-21 23:34:35
Writing application                      : MakeMKV v1.17.2 win(x64-release)
Writing library                          : libmakemkv v1.17.2 (1.3.10/1.5.2) win(x64-release)

I really think there is a bug here, probably multiple bugs .

  1. PMS dashboard should never show 10 Gbps as the bit rate. That’s the speed of my Aquantia NIC on the Plex TV client at 192.168.1.3, not the video’s bit rate. The Linux server hosting PMS at 192.168.1.50 also has the same Aquantia 10 Gbps NIC.
  2. PMS seems to sometimes use the GPU for transcodes, sometimes not, without changing any settings on either client or server. Rebooting the system that’s hosting PMS fixed it twice. “systemctl restart plexmediaserver” would not fix it, only a reboot did.
  3. Even when PMS does successfully use the GPU for transcodes, there is still buffering on the client.

I’m not worried about bug #1 - that’s a display issue, most likely.
Bug #2 is very annoying. Bug #3 is a showstopper, though. I can’t transcode the movie at all, with either CPU or GPU.

May I see the DEBUG logs ZIP file which captures this please ?

I am running the movie right now.

The most obvious difference is the Nvidia driver version

I have had other users experience problems with 525.
They also had to rerun updateinitramfs -u and reboot after downgrading.

Has the machine been rebooted since 525 drivers installed ?

You will see DoVi/HDR10 on HEVC encoded files because HEVC can carry the DoVi metadata or plain HDR10 where VC-1 cannot.

Yes, the machine has rebooted multiple times since the 525 drivers were installed. I had major other problems with the 515 driver version . My NIC stopped working with that driver version.
See 22.04 - nVidia GTX 1050Ti conflicts with Aquantia AQC107 10Gbe NIC
Versions 520 and 525 work fine with my NIC.

I suspect nvidia-smi shows protocol version 12.0 ?

Yes. It shows CUDA version 12.0, per my posts above with the nvidia-smi output.

How do I send you a PM with the logs ?