[Plugin] Linuxserver.io - Unraid Nvidia


Recommended Posts

On 5/4/2019 at 6:13 AM, maxse said:

Hey guys,

I need some pleaseeee! So I jumped on a Dell sale for a p2000 about a month ago and just didn't have a chance to set it up with unraid although I did install it into my server.

 

Well I followed the instructions and I can't get the plugin to recognize it. "NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.   "

 

I then typed lspci -v, and it wasn't even listed, so unraid doesn't see the card? I went into the BIOS on my relatively new motherboard that I just bought, and it was already set to use the PCIE as the main graphics card and multimonitor was set to disabled (I currently have an i8400 and was using the igpu to transcode before. Even doing this, still the same result...

 

The fan on the card itself is spinning so I'm assuming that means the card is getting power? Could it be something wrong with my motherboard when both PCI slots are being used? (I'm using an IBM m1015 flashed to IT). I'm not sure what all this means. I would really appreciate some help guys. I'm running an ASRock H370M Pro4 board if that helps with the most recent BIOS

 

I faced similar issue but I solved it. In my case, its a supermicro motherboard, and the motherboard was considering GPU as primary onboard card. No matter what I did, nothing could've solved the issue.

 

After a while, I removed all the cards (GPU, HBA, NIC, etc.) off the motherboard and updated bios (reflashed it) and unchecked all preserve options. The issue disappeared. GPU is working and drivers are recognized.

 

Maybe you should try this too?

Link to comment

Had issues with upgrading before (breaks Plex with driver 430.14 on my GTX 760 ti). I decided to give it another shot, and finding the same issue. 

 

Doing some digging, inside the plexinc/pms-docker:plexpass PlexMediaServer console doing echo on $NVIDIA_VISIBLE_DEVICES shows correctly and correlates to the right GPU. Nvidia-smi also displays the following:

-----------------------------------------------------------------------------+
| NVIDIA-SMI 430.14       Driver Version: 430.14       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 760     Off  | 00000000:01:00.0 N/A |                  N/A |
|  0%   39C    P0    N/A /  N/A |      0MiB /  4036MiB |     N/A      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0                    Not Supported                                       |
+-----------------------------------------------------------------------------+
# nvidia-smi -L
GPU 0: GeForce GTX 760 (UUID: GPU-0d08588b-ca46-2038-8a4a-e153e77972e6)
# echo $NVIDIA_VISIBLE_DEVICES
GPU-0d08588b-ca46-2038-8a4a-e153e77972e6

When trying to load any 4k video streams in Chrome via Plex (knowing it will require transcoding) it fails to load stating: 

An error occurred trying to play "XXXXXX".

Error code: s1002 (Network)

 

My TV that is left up also appears to flash, or reload, the screen every time I do this on the laptop.

 

Going into the Plex settings and unchecking 'Use hardware acceleration when available' fixes the issue, but then I'm not using the GPU for transcoding and relying on my old 4790k processor.

 

Any suggestions for debugging this? It works until I upgrade Unraid (really would prefer moving forward than staying unpatched). No configuration settings are changed. I verified the extra parameters are set as well. I am running the 'beta' version of Plex with the current installation being Version 1.16.3.1433

Edited by jbreed
Link to comment
9 hours ago, jbreed said:

Had issues with upgrading before (breaks Plex with driver 430.14 on my GTX 760 ti). I decided to give it another shot, and finding the same issue. 

 

Doing some digging, inside the plexinc/pms-docker:plexpass PlexMediaServer console doing echo on $NVIDIA_VISIBLE_DEVICES shows correctly and correlates to the right GPU. Nvidia-smi also displays the following:


-----------------------------------------------------------------------------+
| NVIDIA-SMI 430.14       Driver Version: 430.14       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 760     Off  | 00000000:01:00.0 N/A |                  N/A |
|  0%   39C    P0    N/A /  N/A |      0MiB /  4036MiB |     N/A      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0                    Not Supported                                       |
+-----------------------------------------------------------------------------+

# nvidia-smi -L
GPU 0: GeForce GTX 760 (UUID: GPU-0d08588b-ca46-2038-8a4a-e153e77972e6)

# echo $NVIDIA_VISIBLE_DEVICES
GPU-0d08588b-ca46-2038-8a4a-e153e77972e6

When trying to load any 4k video streams in Chrome via Plex (knowing it will require transcoding) it fails to load stating: 

An error occurred trying to play "XXXXXX".

Error code: s1002 (Network)

 

My TV that is left up also appears to flash, or reload, the screen every time I do this on the laptop.

 

Going into the Plex settings and unchecking 'Use hardware acceleration when available' fixes the issue, but then I'm not using the GPU for transcoding and relying on my old 4790k processor.

 

Any suggestions for debugging this? It works until I upgrade Unraid (really would prefer moving forward than staying unpatched). No configuration settings are changed. I verified the extra parameters are set as well. I am running the 'beta' version of Plex with the current installation being Version 1.16.3.1433

Your GPU doesn't support 4k hvec transcoding.

https://developer.nvidia.com/video-encode-decode-gpu-support-matrix

  • Upvote 2
Link to comment
On 2/11/2019 at 9:11 PM, MowMdown said:

 

Just go to the docker screen, click at the bottom "add container" click your plex template and change the the name of the container to Plex(iGPU) and then just edit the parameters to the iGPU settings. Now you can have two containers with each gpu hardware transcoding capability.

 

For some reason this dosent work anymore having two different dockers running?

1) Plex GPU (Works perfectly with the Nvidia P2000)

2) *Plex iGPU (But for some reason the iGPU have stopped working all is CPU transcoding)

 

*I Use this when I have to use the GPU for my VM, stop one start the other one

 

I saw someone in a different post saying that it was necessary to also define a video device in the docker conf.

Like this

image.thumb.png.5c23a2130e3d0db507c1cbedfd4bbe51.png

with the:

image.png.37766f3f92dcb64a546d4d8f85ef38a4.png

 

I still have the same GO changes like before...

image.png.5421b120611018716d61d792f410276b.png

 

So have anything else changed? (Some time since I startet the iGPU version up 🙂

 

Link to comment

Hi everyone,

 

I know it was mentioned to not discuss the nvidia decode scripts here, but I don't see another topic that covers this.

 

I setup my new GPU (GTX 1660) and have added it to my Plex docker. When I enable hardware transcoding, I can see it is using the GPU to encode properly. I then tried the script here - Unraid Decode Script - and it appears to work correctly. I can see the patch in the container, as well as the new "Plex Transcoder" file (which has both h264 and hevc in the allowed codecs). The output from running the script says it applied successfully.

 

But, when I try to transcode any h264 files, I still only see the hw for encoding and the CPU starts ramping up do to the decode. I also used top during a transcode and I see Plex Transcoder is being used, not Plex Transcoder2 (original). I've tried restarting the container, force updating the container and running the script again, reboot unraid server, etc but no luck.

 

Any idea where I am going wrong?

 

*Correction* Running nvidia-smi dmon -s u shows dec being used, but I do not see the decode hw in the Plex monitoring. Is that normal? Also, is CPU usage still supposed to be high? Thanks!

Edited by MandalorePatriot
Link to comment

I tried to get an Nvidia P2000 installed and working today, but came up short.  

 

I switched to the linuxserver.io Plex app.   I installed the P2000, installed the Nvidia plugin and the card was found and installed.

I watched one of the youtube tutorials, and maybe that introduced a problem.   I initially added the --runtime...  line in the extra parameters, but reading this forum later, it looks like if I am using the Linuxserver.io Plex app, that was not necessary, so  I deleted that line later.

 

It took me a few unfortunate hours trying to figure out how to get the command window to work, turns out I think it is a Safari bug as it works find under Firefox, ... :(    In that process I tried to redo security, etc, thinking it was some other issue.  Complete waste of time.

 

So after moving to FireFox, I thought I was all set.  But no matter what I do, when I watch nvidia-smi, no process is running on the GPU card.    Most everything I tried to play was direct stream, but downgraded the video quality on one of my players and it is transcoding, just not using the P2000.   I am hoping when I finally figure it out that it will use the GPU for transcoding movies syncing to my iPad.    So I am giving up for today.  I have gone through the setup steps a few times, no good.

Link to comment

I checked the Plex checkbox

 

I added the GPU I’d from the nvidia plugin to the field in the plex docker setup.  I initially also added the runtime ref in the extra spot, but reading the latest directions, because I am using the linuxserver.io Plex docker, it sounded like all I had to do was put in the GPU info in the one spot and restart.   Do I need to do the other items even though I am using the linuxserver.io Plex docker?

 

thanks for any suggestions 

 

Ross

Link to comment
4 hours ago, Ross said:

I checked the Plex checkbox

 

I added the GPU I’d from the nvidia plugin to the field in the plex docker setup.  I initially also added the runtime ref in the extra spot, but reading the latest directions, because I am using the linuxserver.io Plex docker, it sounded like all I had to do was put in the GPU info in the one spot and restart.   Do I need to do the other items even though I am using the linuxserver.io Plex docker?

 

thanks for any suggestions 

 

Ross

 

You could start by reading the first posts of this thread.

--runtime=nvidia must be used or else it's not working. It's the variables that you can drop if you are using our container.

 

Link to comment

But that’s not in the 4 steps (with two numbered as step 3)  listed if you are using the linuxserver.io container.  That’s part of the reason I posted this, is that step missing.

———————- from top of forum

With new installs of any of these containers from LinuxServer.io we have simplified the process of getting this working.

 

 1.  Add the desired Application from CA.

2.  Switch the template to advanced mode

3.  Copy the GPU UUID to the existing NVIDIA_VISIBLE_DEVICES parameter

3.  Start the container.”

————

I checked above that and it only discusses installing the Nvidia plugin.  

 

Is there a step missing?

 

thanks

 

Ross

Link to comment
10 minutes ago, Ross said:

But that’s not in the 4 steps (with two numbered as step 3)  listed if you are using the linuxserver.io container.  That’s part of the reason I posted this, is that step missing.

———————- from top of forum

With new installs of any of these containers from LinuxServer.io we have simplified the process of getting this working.

 

 1.  Add the desired Application from CA.

2.  Switch the template to advanced mode

3.  Copy the GPU UUID to the existing NVIDIA_VISIBLE_DEVICES parameter

3.  Start the container.”

————

I checked above that and it only discusses installing the Nvidia plugin.  

 

Is there a step missing?

 

thanks

 

Ross

 

You always need to use the --runtime=nvidia if you want the drivers to be available to the container. So the one that wrote the steps in the first posts forgot that.

And I also forgot that you need to add the GPU string for the GPU you want to pass through.

Link to comment

Installed an Nvidia P2000 tonight into my box and got this seemingly working after adding the --runtime=nvidia and gpu ID.  I played a video through Plex app on my iphone and forced it to transcode by selecting a lower res (720p vs 1080p original movie).  In the plex dashboard, I confirmed "(hw)" appears next to the transcode line, and running watch nvidia-smi on the unraid command line showed the plex transcoder process!

 

One question I did have was that I had a pretty large spike in CPU utilization, presumably because of audio decoding.  My CPU is a Xeon E3-1246 v3 3.5Ghz.

 

In this screenshot, you'll see the first 40% spike when it was playing one 1080p movie (hw transcoding video to 720p) and audio was transcoding. The second spike to approx 80% was when I played a second 1080p movie on another device (again, hw transcoding video to 720p) and audio was also transcoding.  After about 30s of each, the CPU utilization dropped back down to what appears to be ~5-10%.

 

image.thumb.png.f15a11db476a903d5e3f9972a76e7538.pngimageproxy.php?img=&key=00b562fcac28e727imageproxy.php?img=&key=00b562fcac28e727imageproxy.php?img=&key=00b562fcac28e727

 

This was what the dashboard was showing while I was playing both movies:

 

image.thumb.png.71f69e6ea3f215a64a7af16c87b673c6.png

 

  • Is this CPU utilization spike expected? Is this because of the audio transcoding?
  • If so, why does it spike then drop back down? I would've expected it to stay high if it was due to audio transcoding.
  • Given it went as high as 80%, will this impact my ability to transcode more than 2 movies at once?
  • My CPU supports QuickSync. Does enabling the flag --device=/dev/dri help audio decoding in any way or is that strictly for using the CPU's onboard GPU for video encoding (and won't help with my audio transcoding)?

 

Lastly, unrelated, can someone explain why I see a mention of an NVDEC script? What does that actually do that is not already being done with the work I've done? (To be clear, I'm not asking to troubleshoot or get help with that script. Just trying to understand what is it).

Edited by tmchow
Link to comment
16 minutes ago, tmchow said:

Lastly, unrelated, can someone explain why I see a mention of an NVDEC script? What does that actually do that is not already being done with the work I've done? (To be clear, I'm not asking to troubleshoot or get help with that script. Just trying to understand what is it).

The current PLEX server doesn't use NVDEC for the decoding part.  Even when you enable hardware transcoding in Plex settings, it only use the NVENC (encoding) and still decode using CPU.   The NVDEC Script is a wrapper that tricks Plex Transcoder by passingthu the Decoding command in parameters so that ffmpeg underneath will use the NVDEC too.  It's not perfect in the current state as the ffmpeg is very old in Plex.  The newest ffmpeg support nvdec a lot better.  Hopefully, PLEX will update it soon.   When you use the NVDec script, that lower your CPU usage because if it can, it will decode also with the nvidia card.

  • Like 1
Link to comment
The current PLEX server doesn't use NVDEC for the decoding part.  Even when you enable hardware transcoding in Plex settings, it only use the NVENC (encoding) and still decode using CPU.   The NVDEC Script is a wrapper that tricks Plex Transcoder by passingthu the Decoding command in parameters so that ffmpeg underneath will use the NVDEC too.  It's not perfect in the current state as the ffmpeg is very old in Plex.  The newest ffmpeg support nvdec a lot better.  Hopefully, PLEX will update it soon.   When you use the NVDec script, that lower your CPU usage because if it can, it will decode also with the nvidia card.


Thanks! I got this working with this setup using a user script daily


https://github.com/Xaero252/unraid-plex-nvdec
Link to comment
  • 2 weeks later...

I'm hoping someone here can help.

 

I keep getting a error in Plex Version 3.108.2

Quote

[FFMPEG] -No VA display found for device : /dev/dri/renderD128

 

I'm running unraid 6.7.2

Quote

Nvidia Driver Version:  430.14

GPU 0 Model & Bus:  GeForce GTX 1660 Ti      02:00.0

GPU 0 UUID:  GPU-131d7e98-bc16-c9a1-d5f7-2e85a1eefa1e

Quote

plexinc/pms-docker by plexinc

NVIDIA_DRIVER_CAPABILITIES: All

NVIDIA_VISIBLE_DEVICES: GPU-131d7e98-bc16-c9a1-d5f7-2e85a1eefa1e

VERSION: plexpass

Extra Parameters: --runtime=nvidia

 

watch nvidia-smi does show the transcoder working and video plays fine. Just the error is bothering me because i'm trying to watch for the malformed image error and when someone that doesn't know how to use direct play on my server comes on i get spammed with this error.

Link to comment

I'm trying to get this to work with UnRaid running in a VM in ProxMox.  It works fine when I boot UnRaid bare metal, but it doesn't work when within a VM.  I think I have the GPU shared properly as lspci -v between ProxMox VM and baremetal appear almost the same.  The PCI number and IRQ are different.  Maybe someone here can spot a difference.

BareMetal: UnRaid
02:00.0 VGA compatible controller: NVIDIA Corporation GP106 [GeForce GTX 1060 3GB] (rev a1) (prog-if 00 [VGA controller])
        Subsystem: Gigabyte Technology Co., Ltd GP106 [GeForce GTX 1060 3GB]
        Flags: bus master, fast devsel, latency 0, IRQ 26, NUMA node 0
        Memory at ef000000 (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 5000 [size=128]
        [virtual] Expansion ROM at 000c0000 [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: [128] Power Budgeting <?>
        Capabilities: [420] Advanced Error Reporting
        Capabilities: [600] Vendor Specific Information: ID=0001 Rev=1 Len=024 <?>
        Capabilities: [900] Secondary PCI Express <?>
        Kernel driver in use: nvidia
        Kernel modules: nvidia_drm, nvidia

02:00.1 Audio device: NVIDIA Corporation GP106 High Definition Audio Controller (rev a1)
        Subsystem: Gigabyte Technology Co., Ltd GP106 High Definition Audio Controller
        Flags: bus master, fast devsel, latency 0, IRQ 10, NUMA node 0
        Memory at f0080000 (32-bit, non-prefetchable) [size=16K]
        Capabilities: [60] Power Management version 3
        Capabilities: [68] MSI: Enable- Count=1/1 Maskable- 64bit+
        Capabilities: [78] Express Endpoint, MSI 00
        Capabilities: [100] Advanced Error Reporting
ProxMox:UnRaid
01:00.0 VGA compatible controller: NVIDIA Corporation GP106 [GeForce GTX 1060 3GB] (rev a1) (prog-if 00 [VGA controller])
        Subsystem: Gigabyte Technology Co., Ltd GP106 [GeForce GTX 1060 3GB]
        Flags: bus master, fast devsel, latency 0, IRQ 16
        Memory at c0000000 (32-bit, non-prefetchable) [size=16M]
        [virtual] Memory at 800000000 (64-bit, prefetchable) [size=256M]
        Memory at 810000000 (64-bit, prefetchable) [size=32M]
        I/O ports at d000 [size=128]
        [virtual] Expansion ROM at c1020000 [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: [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: nvidia_drm, nvidia

01:00.1 Audio device: NVIDIA Corporation GP106 High Definition Audio Controller (rev a1)
        Subsystem: Gigabyte Technology Co., Ltd GP106 High Definition Audio Controller
        Flags: bus master, fast devsel, latency 0, IRQ 10
        Memory at c1000000 (32-bit, non-prefetchable) [size=16K]
        Capabilities: [60] Power Management version 3
        Capabilities: [68] MSI: Enable- Count=1/1 Maskable- 64bit+
        Capabilities: [78] Express Endpoint, MSI 00
        Capabilities: [100] Advanced Error Reporting

The only thing I can find different is this biggie

dmesg | grep GPU
[  271.949382] NVRM: GPU 0000:01:00.0: RmInitAdapter failed! (0x26:0xffff:1133)
[  271.949691] NVRM: GPU 0000:01:00.0: rm_init_adapter failed, device minor number 0

From googling around it sounds like it is 1 of 2 things.  Either the GPU is broken (which I know otherwise because it works baremetal), or the NVidia drivers are loaded wrong.  Odd here because it is the same drivers, etc.

 

Hoping someone may see something I missed.

 

thanks

david

Link to comment
I'm hoping someone here can help.
 
I keep getting a error in Plex Version 3.108.2
[FFMPEG] -No VA display found for device : /dev/dri/renderD128
 
I'm running unraid 6.7.2
Nvidia Driver Version:  430.14
GPU 0 Model & Bus:  GeForce GTX 1660 Ti      02:00.0
GPU 0 UUID:  GPU-131d7e98-bc16-c9a1-d5f7-2e85a1eefa1e
plexinc/pms-docker by plexinc
NVIDIA_DRIVER_CAPABILITIES: All
NVIDIA_VISIBLE_DEVICES: GPU-131d7e98-bc16-c9a1-d5f7-2e85a1eefa1e
VERSION: plexpass
Extra Parameters: --runtime=nvidia
 
watch nvidia-smi does show the transcoder working and video plays fine. Just the error is bothering me because i'm trying to watch for the malformed image error and when someone that doesn't know how to use direct play on my server comes on i get spammed with this error.


I had this error when I was mistakenly including a modprobe command in my go file which I think was exposing my quick sync cpu. I can’t remember which modprobe it was but as soon as I removed it and rebooted my plex logs no longer had the error.

..: or it could’ve been a coincidence and my reboot is the thing that solved it
Link to comment
  • trurl locked this topic
Guest
This topic is now closed to further replies.