Plex NVIDIA Gpu Passthrough SCALE 21.02

skittlebrau

Explorer
Joined
Sep 1, 2017
Messages
54
Ok how do I tell if the transcoding is being done by the GPU. I installed the Plex app

If you open up Plex dashboard and look at the active transcoding sessions, any stream that's using hardware transcoding will have '(hw)' in the stream details.
 

oumpa31

Patron
Joined
Apr 7, 2015
Messages
253
That's what I was afraid of. I am still only getting CPU transcoding. I attached the Plex settings do I have something set wrong here.

I also tried to reinstall apt install nvidia-cuda-dev nvidia-cuda-toolkit and got this error code this time.
Errors were encountered while processing:
/tmp/apt-dpkg-install-eSudBT/158-libnvidia-compute-460-server_460.32.03-0ubuntu0.20.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@plex-855cd7c944-tvn48:/#
 

Attachments

  • plex transcoder.PNG
    plex transcoder.PNG
    923.5 KB · Views: 614
Last edited:

oumpa31

Patron
Joined
Apr 7, 2015
Messages
253
I connected it to my plex pass account so it does have the plex pass version. I got the lifetime version like 2 years ago now.

This is a test rig so do you guys think i should blank out these drives and try starting fresh. I did get a weird error when plex loaded after install
 
Last edited:

oumpa31

Patron
Joined
Apr 7, 2015
Messages
253
I did a fresh install without the listed version of Plex and I am still getting no HW transcoding only my cpu is doing transcoding

1616103006242.png

this is what im doing

install plex no changes
nvidia-smi
ls -la /dev/nvidia*

apt update
apt install nvidia-cuda-dev nvidia-cuda-toolkit

Storage
Plex Storage

Data Volume
Enable Host Path for Plex Data Volume check
Plex Folder

Plex Configuration
Plex Claim Token go to https://www.plex.tv/claim

Configure Environment Variables for Plex
Environment Variable
Name
NVIDIA_DRIVER_CAPABILITIES
Value
all

Resource Reservation
GPU Configuration
GPU Resource (nvidia.com/gpu)
Allocate 1 nvidia.com/gpu GPU

I'm starting to think I need to try the nightly and not continue with 21.01
 
Last edited:

skittlebrau

Explorer
Joined
Sep 1, 2017
Messages
54
This might sound really obvious, but did you also enable hardware transcoding in Plex Media Server settings? I don't think it's enabled by default.
 

oumpa31

Patron
Joined
Apr 7, 2015
Messages
253
This might sound really obvious, but did you also enable hardware transcoding in Plex Media Server settings? I don't think it's enabled by default.
Ya 5 posts up I showed what I had for settings in Plex. I switched over to the Nightlies cause I heard that they had been working on getting the NVidia GPU integration for plex up and running fully but every time I test it, it only says transcode and and I see the CPU spike. I have tried deleting the Plex app a few times but no change. I'm doing all this testing on an old AMD FX chip and the motherboard is only a PCIE 2.0 board I'm not sure if that's my issue but I want to make sure I have everything working before I switch it over to my Threadripper TrueNAS Core machine.
 

waqarahmed

iXsystems
iXsystems
Joined
Aug 28, 2019
Messages
136
Also can you please ensure you are on latest nightlies just to be sure that you have the latest patch available in your system
 

waqarahmed

iXsystems
iXsystems
Joined
Aug 28, 2019
Messages
136
Okay so we have had some recent changes go in our builder and i can confirm on my end that nvidia gpu is not being correctly setup by host so that we can consume it. Once we have that in order, this should be good again.
 

oumpa31

Patron
Joined
Apr 7, 2015
Messages
253
Okay so we have had some recent changes go in our builder and i can confirm on my end that nvidia gpu is not being correctly setup by host so that we can consume it. Once we have that in order, this should be good again.
Sounds good. I know its still alpha so I know how this goes. One of the many reasons I am testing this all out on a old machine. lol. It will be awesome when i can move my Core machine to this but making sure everything is ready before then is worth the wait.
 

waqarahmed

iXsystems
iXsystems
Joined
Aug 28, 2019
Messages
136
Well good news is that the fix has just been merged. So coming nightlies should have this change. To be safe i would recommend trying early next week. Let me know please if that doesn't work out. Thank you
 

oumpa31

Patron
Joined
Apr 7, 2015
Messages
253
Well good news is that the fix has just been merged. So coming nightlies should have this change. To be safe i would recommend trying early next week. Let me know please if that doesn't work out. Thank you
Thats awesome. I'll keep updating and report late next week to confirm its working or not. Thanks for your help.
 

oumpa31

Patron
Joined
Apr 7, 2015
Messages
253
Well good news is that the fix has just been merged. So coming nightlies should have this change. To be safe i would recommend trying early next week. Let me know please if that doesn't work out. Thank you
Did a fresh install of Scale A1 then did the upgrade to nightly and did the directions below and it works. Tried to get scale on my main machine but Scale wont read my LSI 9201-16e so it doesn't see any of my disks. I have them all in a Disk shelf that works on Core. So I can only hope that is added soon. At least the Hardware transcoding is good to go.

 

Attachments

  • Adding P4000 to Plex.txt
    610 bytes · Views: 362

flatline69

Dabbler
Joined
Jan 30, 2021
Messages
29
Ahh, since its a container that changes things. Try this:

# apt update
# apt install nvidia-cuda-dev nvidia-cuda-toolkit

Those packages are 6GB, so they will take a while... After done, reboot.

Once done, click "edit" on your plex container. At the bottom do you see some options for enabling nvidia GPU now?

This worked for me until I did the isolated gpu via midclt and then broke CUDA in my containers after undoing that change -- trying to reinstall these packages broke a bunch of things (my fault, of course.) Ah well, at least I'll be able to breeze through the install again :)
 

waqarahmed

iXsystems
iXsystems
Joined
Aug 28, 2019
Messages
136
@flatline69 the process should have been smooth. Can you please confirm your TrueNAS Scale version ? If you do GPU passthrough via UI and then remove the GPU from isolation so it can be consumed by the host, the process should be smooth/simple. If you are running an older version of TrueNAS Scale, can you please try latest nightlies to see if that helps improve the situation ?
 

flatline69

Dabbler
Joined
Jan 30, 2021
Messages
29
@flatline69 the process should have been smooth. Can you please confirm your TrueNAS Scale version ? If you do GPU passthrough via UI and then remove the GPU from isolation so it can be consumed by the host, the process should be smooth/simple. If you are running an older version of TrueNAS Scale, can you please try latest nightlies to see if that helps improve the situation ?

I am using TrueNAS-SCALE-21.04-ALPHA.1

I circumvented the docker-middleware system (not using UI) so that I could get iptables working (inet access) using a link that I found in the forums that creates a boot.sh etc, here: https://gist.github.com/Jip-Hop/af3b7a770dd483b07ac093c3b205323f

Not going to lie -- the whole kubernetes/helm stuff is foreign to me while docker-compose is not and I have a large app-stack deployed and the UI is very limiting to me last time I tried (pre-21.04) and I just need it to work with minimal hassle (WAF-related reasons.)

Everything was fine until I did the following (from dev notes):
midclt call system.advanced.update '{"isolated_gpu_pci_ids": ["0000:af:00.0"]}'

Which broke Emby transcoding for me (up until this point; I was able to get it to see the GPU.) Then I use the "cli" command to undo the above and now I get errors trying to init CUDA.

Also when I installed the above packages via apt; there were errors trying to update initramfs but it did boot afterwards.

Looks like a reinstall in my future but it's really my own fault :(

NOTE: I don't think I was very clear. After installing the above packages, Emby could see the GPU and transcoding was available but kept using software decoding instead of hardware which led me to the dev-notes option of excluding the GPU I mentioned above thinking that somehow it was related (nvidia-smi worked both in host and in the container up until then.)
 

waqarahmed

iXsystems
iXsystems
Joined
Aug 28, 2019
Messages
136
@flatline69 when a GPU is added for passthrough, that will result in host not seeing it which is desired as otherwise GPU passthrough wouldn't be possible. About cuda errors, i am not sure how you are accessing it, but nothing should change and it should work just fine. If you are able to reproduce this with a clean slate on latest nightlies, please let me know and i can debug/fix as required. ( Please don't alter system state via CLI as that can potentially change system state and how middleware/system expects it to be which can result in other various issues, so during these tests, kindly avoid that so we know for sure that something is wrong with this workflow )
 
Top