Plex hw transcoding does not work after 24.10 upgrade

Hello, first I want to thank truenas for 24.10, I have been looking forward to going to Docker.

unfortuantly, I have run into a bit of an issue when it come to transcoding using a nvidia 2070. Priror to 24.10 everything was working well.

After the update I did get the
Expected [uuid] to be set for GPU inslot [] in [nvidia_gpu_selection]) error, I was able to fix this using the method from the release notes (thank you for that).

I can confirm nvidia drivers are installed and working
±----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.127.05 Driver Version: 550.127.05 CUDA Version: 12.4 |
|-----------------------------------------±-----------------------±---------------------+
| 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 RTX 2060 Off | 00000000:42:00.0 Off | N/A |
| 22% 28C P0 39W / 190W | 1MiB / 6144MiB | 0% Default |
| | | N/A |
±----------------------------------------±-----------------------±---------------------+
| 1 NVIDIA GeForce RTX 2070 Off | 00000000:61:00.0 Off | N/A |
| 39% 31C P0 N/A / 215W | 1MiB / 8192MiB | 0% Default |
| | | N/A |
±----------------------------------------±-----------------------±---------------------+

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

Plex docker ( stable Version: 1.0.27) is working and is running Version 1.41.1.9057 of plex. I can see both my video cards and have the 2070 selected in the docker. In plex I have “Use hardware acceleration when available” selected and “Use hardware-accelerated video encoding”. under “Hardware transcoding device” I can also see my 2070 and have it selected.

When I go to start a video it plays fine provided I have not dropped the quality. Once I drop the quality (start trancoding) it plays for about 5 seconds then stops. The same happens regardless of what device i am trying to play on. When I stop the docker edit it and deselect the 2070, so it does not load. Then I fire back up plex, it will transcode then, however using the cpu is not ideal at all. This however does confirm that the rest of the setup works.

Below is the errors I am getting from the console in plex. Please understand I would not post here if I have not already tried to find a fix in these forms and elsewhere. Any help would be very welcome. Please let me know if you need any more info to help you help me. lol

Nov 07, 2024 10:11:20.889 [139750745742136] Error — [Req#a35] Unknown metadata type: folder
Nov 07, 2024 10:11:20.890 [139750745742136] Warning — [Req#a35] QueryParser: Invalid field ‘contentDirectoryID’ found, ignoring.
Nov 07, 2024 10:11:20.890 [139750745742136] Warning — [Req#a35] QueryParser: Invalid field ‘pinnedContentDirectoryID’ found, ignoring.
Nov 07, 2024 10:11:20.890 [139751139597112] Warning — [Req#a34] QueryParser: Invalid field ‘sectionID’ found, ignoring.
Nov 07, 2024 10:11:20.890 [139751139597112] Warning — [Req#a34] QueryParser: Invalid field ‘contentDirectoryID’ found, ignoring.
Nov 07, 2024 10:11:20.890 [139751139597112] Warning — [Req#a34] QueryParser: Invalid field ‘pinnedContentDirectoryID’ found, ignoring.
Nov 07, 2024 10:11:21.021 [139751143893816] Error — [Req#a44] Unknown metadata type: folder
Nov 07, 2024 10:11:21.021 [139751143893816] Warning — [Req#a44] QueryParser: Invalid field ‘contentDirectoryID’ found, ignoring.
Nov 07, 2024 10:11:21.021 [139751143893816] Warning — [Req#a44] QueryParser: Invalid field ‘pinnedContentDirectoryID’ found, ignoring.
Nov 07, 2024 10:11:21.022 [139750937094968] Warning — [Req#a43] QueryParser: Invalid field ‘sectionID’ found, ignoring.
Nov 07, 2024 10:11:21.022 [139750937094968] Warning — [Req#a43] QueryParser: Invalid field ‘contentDirectoryID’ found, ignoring.
Nov 07, 2024 10:11:21.022 [139750937094968] Warning — [Req#a43] QueryParser: Invalid field ‘pinnedContentDirectoryID’ found, ignoring.
Nov 07, 2024 10:11:21.375 [139751146003256] Warning — [Req#a51] QueryParser: Invalid field ‘sectionID’ found, ignoring.
Nov 07, 2024 10:11:21.375 [139750928927544] Error — [Req#a52] Unknown metadata type: folder
Nov 07, 2024 10:11:21.375 [139751146003256] Warning — [Req#a51] QueryParser: Invalid field ‘contentDirectoryID’ found, ignoring.
Nov 07, 2024 10:11:21.375 [139751146003256] Warning — [Req#a51] QueryParser: Invalid field ‘pinnedContentDirectoryID’ found, ignoring.
Nov 07, 2024 10:11:21.375 [139750928927544] Warning — [Req#a52] QueryParser: Invalid field ‘contentDirectoryID’ found, ignoring.
Nov 07, 2024 10:11:21.375 [139750928927544] Warning — [Req#a52] QueryParser: Invalid field ‘pinnedContentDirectoryID’ found, ignoring.
Nov 07, 2024 10:11:22.669 [139751146003256] Error — [Req#a83] Unknown metadata type: folder
Nov 07, 2024 10:11:34.654 [139751146003256] Warning — [Req#bd7/Transcode/0nizdd4wclta3kks0u68rng2] Transcode runner appears to have died.
Nov 07, 2024 10:11:34.665 [139751139597112] Warning — [Req#bda/Transcode/0nizdd4wclta3kks0u68rng2] Transcode runner appears to have died.

https://www.truenas.com/docs/scale/24.10/gettingstarted/scalereleasenotes/#24100-known-issues

Some users who have upgraded to 24.10.0 from a previous version, and who have applications with have NVIDIA GPU allocations, report the error Expected [uuid] to be set for GPU inslot [<some pci slot>] in [nvidia_gpu_selection]) (see NAS-132086).
Users experiencing this error should follow the steps below for a one time fix that should not need to be repeated.
Connect to a shell session and retrieve the UUID for each GPU with the command midclt call app.gpu_choices | jq.
For each application that experiences the error, run midclt call -job app.update APP_NAME ‘{“values”: {“resources”: {“gpus”: {“use_all_gpus”: false, “nvidia_gpu_selection”: {“PCI_SLOT”: {“use_gpu”: true, “uuid”: “GPU_UUID”}}}}}}’ Where:
APP_NAME is the name you entered in the application, for example “plex”.
PCI_SLOT is the pci slot identified in the error, for example “0000:2d:00.0”.
GPU_UUID is the UUID matching the pci slot that you retrieved with the above command.

Thank you for your reply. Yes i can confirm I did this and I was able to see the and select the video cards after running midclt call -job app.update APP_NAME ‘{“values”: {“resources”: {“gpus”: {“use_all_gpus”: false, “nvidia_gpu_selection”: {“PCI_SLOT”: {“use_gpu”: true, “uuid”: “GPU_UUID”}}}}}}’

of course with the correct APP_NAME PCI_SLOT and GPU_UUID.

Sadly the problem remains. Any other suggestions or info you need from me?

Just to make sure it was not some setting/cache/codec issue I spun up another plex docker just to test with once video. shut off all the other dockers and added the 2070 to the test plex docker. I can confirm the same error comes up.

Any suggestions? is there any more info I can give?

Thank you in advance.

Apologies, I missed that line in the original post. Not sure what could be causing those issues.

This old forum post suggests maybe a permissions issue: Plex Plugin - problems with transcoding media | TrueNAS Community

And this Reddit thread had the same error due to insufficient RAM
https://www.reddit.com/r/unRAID/comments/12yqt05/transcoding_with_plex_stops_playback_after/

but I don’t know if either are relevant to your case.

Thank you, I do not think its a permission issue due to the fact that when I disable (uncheck the 2070) and fire up the docker image again transcode works. However i did check again just to be sure.

As for the ram I have 512GB and am not transcoding to the ram, I have sperate fast drives for this and can confirm its being written to when transcoding without the 2070.

Any other thougths or suggetions. Thank you so much.

So I got some great support from the folks over at Plex. One of the members has asked me to check on a few items. On a regular ubuntu install I would be able to do much of this but with dockers/trunas I am not nearly as good (not saying I am a guru at all). Would someome be able to help me.

The fourm thread is at After update hw transcoding stops after 5 seconds (please help) - #6 by ChuckPa - NAS & Devices - Plex Forum

In short plex can see the card on the PCI bus, however when it comes to the actual transcode point, it cannot talk to it.

So he suggests I check the follow things:

  1. Are all the libnvidia packages installed on the host?
    – libnvidia-encode
    – libnvidia-decode
    – libnvidia-compute (for tone mapping)
    – etc
  2. Have the Nvidia runtime libraries been passed into the container in the spec?
  3. Does the GID used by the container have permission to access the GPU ?
    ( a member of the group which owns it )

Would Anyone be able to help me on how to check above on truenas scale.

Couple of points I can confirm:

  • Plex docker image is bering run on user and group 568.
  • “stat -c %g /dev/dri/renderD128” gives me user 107

Thank you and please if any one need anymore info please let me know. Thank you in advance.

@Andrew_P when you did the UUID fix did you include both GPU UUIDs or just one? It seems like there’s an issue with the GPU selection based on the description that disabling the 2070 makes it work again.

Yes I ran the below command twice for each card. Each time I did it with its own correct PCI_SLOT, GPU_UUID and APP_NAME.

midclt call -job app.update APP_NAME ‘{“values”: {“resources”: {“gpus”: {“use_all_gpus”: false, “nvidia_gpu_selection”: {“PCI_SLOT”: {“use_gpu”: true, “uuid”: “GPU_UUID”}}}}}}’

Is there any way I can check to see if this may be an issue or do you you have anything else you need from me?

THank you

I’m not quite sure what the syntax would look like for using both cards simultaneously with the midclt call, but I have to assume that running both commands one after the other caused it to claim only the card UUID for the second one.

Unfortunately I only have a single NVIDIA card in my test system, so I can’t poke at this further at the moment.

Heed the warning at the bottom.
nvidia_gpu_selection can supposedly take multiple GPUs so perhaps something like this could work:

midclt call -job app.update APP_NAME ‘{“values”: {“resources”: {“gpus”: {“use_all_gpus”: false, “nvidia_gpu_selection”: {“PCI_SLOT_1”: {“use_gpu”: true, “uuid”: “GPU_UUID_1”},“PCI_SLOT_2”: {“use_gpu”: true, “uuid”: “GPU_UUID_2”}}}}}}’

This is 100% speculative and untested, this might break your setup.

Edit: This will probably not work as pointed out by @Andrew_P below.

Well that does make sense. Thank you for trying and helping this far.

Thank you very much. I am a tad gun shy on running this based on your warning lol. I am suprised more people have not run into this issue. I cannot be the only person with 2 video cards following the release notes?

I think this might not work since each of the video cards are used in diffrent apps (APP_NAME).

This is a good point, I didn’t account for that. Oh well.

Regardless thank you for trying.

Would I be wrong to flag this as a bug?

Give this a shot with each of the values adjusted:

midclt call -job app.update APP_NAME '{"values": {"resources": {"gpus": {"use_all_gpus": false, "nvidia_gpu_selection": {"PCI_SLOT1": {"use_gpu": true, "uuid": "GPU_UUID1"}, "PCI_SLOT2": {"use_gpu": true, "uuid": "GPU_UUID2"}}}}}}'

Carefully note the position of quotes and curly braces, and make sure the correct PCI_SLOT and GPU_UUID values are put for each of 1 and 2.

Hey Team,

I just wanted to circle back. This ended up not being a truenas issue. It was a issue with the lower quality players such as chromecast and web players. Its a known issue (that I did not know about) while watching a show you cannot switch the quality mid play back. You have to stop playback then go to settings and adjust the quality then start the stream again.

Sorry all and thank you for your help HoneyBadger.

With Respect,
Andrew

1 Like

I assume the issue is with the Plex player client on these low-end devices (or the web player) then?

If that’s the case, Jellyfin might be interesting as an open-source alternative if you’d like to try that instead. There’s an App in the catalog, and you could just give it read-only access to the same library. :slight_smile: