Jump to content
linuxserver.io

[Plugin] Linuxserver.io - Unraid Nvidia

1388 posts in this topic Last Reply

Recommended Posts

20 minutes ago, Max said:

Could anyone guide what's the difference between stock unraid builds and nvidia unraid builds

did you read the first post of this thread?

Share this post


Link to post
6 minutes ago, uldise said:

did you read the first post of this thread?

I did and just to be sure i read it again just now but still can't figure it out.

Sorry for being idiot.

Actually i have gtx 750 laying around so i planning to use it with plex and handbrake.

Share this post


Link to post
50 minutes ago, uldise said:

did you read the first post of this thread?

 

41 minutes ago, Max said:

I did and just to be sure i read it again just now but still can't figure it out.

Sorry for being idiot.

Actually i have gtx 750 laying around so i planning to use it with plex and handbrake.

Is stock build option is for situation in which you dont wanna use it for some reason and revert back to stock unraid drivers in way to uninstall nvidia drivers and install back the original unraid drivers which won't have the ability to use your gpu with dockers.

Share this post


Link to post
5 hours ago, Max said:

Could anyone guide what's the difference between stock unraid builds and nvidia unraid builds.

Sorry for asking stupid questions😅

The stock builds are released by limetech and are official, but have only the open source graphics drivers, which are missing features from the proprietary driversm

The unraid Nvidia builds have the Nvidia proprietary driver packages added in,.which enable.things like CUDA, nvenc and nvdec.

 

By using the card inside of Dockers you can take advantage of this for things like hardware accelerated transcoding and GPGPU computing.

Share this post


Link to post
On 7/4/2019 at 1:23 PM, Xaero said:

Edit:
This is not a problem with an easy solution at all. 

I can monitor the transcode processes and make sure that everything is killed - but the only solution is to kill Plex:
https://forums.plex.tv/t/stuck-in-p-state-p0-after-transcode-finished-on-nvidia/387685/24
I can user fuser -vk /dev/nvidia* and it will immediately switch to a P8 state. The only process using the card when this is run is "Plex Media Server" 

It's not hard to write a script that will only do this if:
There are no processes using the card and the card is in a P0 state. I just don't know if there are any undesirable side-effects of doing it this way.

Here is such a script:


#!/bin/bash

while true; do
cur_pstate=$(nvidia-smi --query-gpu=pstate --format=csv,noheader)
running_processes=$(ps --no-headers "$(nvidia-smi |tail -n +16 | head -n -1 | sed 's/\s\s*/ /g' | cut -d' ' -f3)" | wc -l) 2>/dev/null

if [[ $cur_pstate = "P0" && $running_processes -eq 0 ]]; then
# if we got here, the card is only running the Xorg process and is in the P0 state, let's fix that.
    fuser -kv /dev/nvidia*
    echo "Reset Power State"
fi

#sleep so we aren't blocking a thread constantly.
sleep 1

done

Starting the X server on Unraid does allow one to open nvidia settings; to do this you can use a script like this to start the X server (note, that since chvt and fgconsole aren't available, you will have to switch back to VT7 by pressing Ctrl+Alt+F7):


#!/bin/bash

##This will only work on single GPU systems:
GPUID=$(nvidia-xconfig --query-gpu-info | grep BusID | sed 's/^[^:]*: //')

#Now that we know the PCI BusID of the card we can create the X server with a fake display:
nvidia-xconfig -s -a --allow-empty-initial-configuration --use-display-device=None --virtual=640x480 --busid "$GPUID" -o /dev/stdout | X :99 -config /dev/stdin&

Once you have that server running, you can return to the default unraid GUI and run:
nvidia-settings -c :99
To open nvidia-settings on the card. You could also store an xorg configuration file and use that for the virtual X display, and to set persistent nvidia settings.

 

The only way I can think of to fix this properly is to figure out why the Plex process is claiming the card and prevent that from happening. I'll look into it some more, but this needs to be fixed properly by Plex/nVidia. The linked thread at the Plex forums has more information.

I may be able to detach the Plex Transcoder process with the wrapper script, making it it's own entity, and then trapping the SIGINT/SIGKILL in the wrapper and using it to kill the transcoder, effectively using the wrapper script to separate the Plex Media Server process from the Plex Transcoder process. It's pretty kludgy, but might work.



Oh Boy:
image.png.ab3233c6afeac47311c043bd84d1a226.png

 

We're in idle P-State while transcoding territory!

Any idea about us emby users?

 

Share this post


Link to post
26 minutes ago, Dazog said:

Any idea about us emby users?

 

I was under the impression that Emby doesn't have this behavior?

To see if it does, and part of "why" run

watch nvidia-smi

Check the power state is not latched to P0.

Start a stream, verify the power state latches to P0

Stop the stream, verify the process has ended, and that the power state is stuck in P0

Run fuser -v /dev/nvidia* 

To see what processes are still using the driver.

Share this post


Link to post
3 hours ago, Xaero said:

The stock builds are released by limetech and are official, but have only the open source graphics drivers, which are missing features from the proprietary driversm

The unraid Nvidia builds have the Nvidia proprietary driver packages added in,.which enable.things like CUDA, nvenc and nvdec.

 

By using the card inside of Dockers you can take advantage of this for things like hardware accelerated transcoding and GPGPU computing.

ohh but if unraid build don't have anything like cuda, nvenc and nvdec then, why would someone will ever use and what for ? doesn't it makes them pretty much useless.😅

Share this post


Link to post

Not useless at all when you don't own any nvidia hardware.

Share this post


Link to post

Or if you only use the card for passthrough to a VM.

Share this post


Link to post
4 hours ago, Xaero said:

I was under the impression that Emby doesn't have this behavior?

To see if it does, and part of "why" run

watch nvidia-smi

Check the power state is not latched to P0.

Start a stream, verify the power state latches to P0

Stop the stream, verify the process has ended, and that the power state is stuck in P0

Run fuser -v /dev/nvidia* 

To see what processes are still using the driver.

Card is always at P0


Stream or no stream.

 

I will wait to see if someone creates a docker or script to fake the desktop to trick nvidia's cards into letting us not having to run P0 24/7

 

 

Share this post


Link to post
1 hour ago, Dazog said:

Card is always at P0


Stream or no stream.

 

I will wait to see if someone creates a docker or script to fake the desktop to trick nvidia's cards into letting us not having to run P0 24/7

 

 

Run fuser -vk /dev/nvidia* and see if the p state changes.

It should boot to a p8 state even with no X server, from playing with this. Chances are some process is not ending properly 

fuser -v lists open handles on the specified file(s) since devices are treated as files in Linux land, it can be used to see what process has a device open.

You can then either kill listed PIDs individually, or just specify the -k option to have fuser kill the processes on its own.

Share this post


Link to post
9 hours ago, Dazog said:

Card is always at P0


Stream or no stream.

 

I will wait to see if someone creates a docker or script to fake the desktop to trick nvidia's cards into letting us not having to run P0 24/7

 

 

I think you didn't enable the persistance-mode. Do that before testing with: nvidia-smi --persistence-mode=1

Share this post


Link to post
14 hours ago, Xaero said:

I was under the impression that Emby doesn't have this behavior?

To see if it does, and part of "why" run

watch nvidia-smi

Check the power state is not latched to P0.

Start a stream, verify the power state latches to P0

Stop the stream, verify the process has ended, and that the power state is stuck in P0

Run fuser -v /dev/nvidia* 

To see what processes are still using the driver.

I thought so too...I will try this out after work today. Gonna install emby and will have a closer look at the behavior.

Share this post


Link to post
19 hours ago, BRiT said:

Not useless at all when you don't own any nvidia hardware.

 

19 hours ago, Squid said:

Or if you only use the card for passthrough to a VM.

ohh well thanks for all the info.👍

Share this post


Link to post
Posted (edited)

Ok, I tested it with emby and it works like a charm there. The card goes back to P8 state in no time...so it's a plex problem only. That lets me think about switching. to emby..but the convenience of plex is so high...the struggle is real!

Edited by pappaq

Share this post


Link to post
7 minutes ago, pappaq said:

Ok, I tested it with emby and it works like a charm there. The card goes back to P8 state in no time...so it's a plex problem only. That let's me think about switching...but the convenience of plex is so high...the struggle is real!

From what ChuckPA said on the Plex Forums, it sounds like a major update to the transcoder is being finished up and hopefully deployed in the near future. I’m thinking they’ll address this, as well as finally provide official NVDEC support and fix the issues they’ve been having with 9th Gen Intel QuickSync. He made it seem like a significant change for the transcoder.

Share this post


Link to post
57 minutes ago, ramblinreck47 said:

From what ChuckPA said on the Plex Forums, it sounds like a major update to the transcoder is being finished up and hopefully deployed in the near future. I’m thinking they’ll address this, as well as finally provide official NVDEC support and fix the issues they’ve been having with 9th Gen Intel QuickSync. He made it seem like a significant change for the transcoder.

Don't get your hopes up too much. He's been saying that for years

Share this post


Link to post
30 minutes ago, aptalca said:

Don't get your hopes up too much. He's been saying that for years

Yeah, I'm on aptalca's side. I switched from emby to plex because it had a much better transcoding performance two years back. But it seems that this lead is no longer there. I'll be testing the next week and compare the two...

Share this post


Link to post
1 hour ago, pappaq said:

Yeah, I'm on aptalca's side. I switched from emby to plex because it had a much better transcoding performance two years back. But it seems that this lead is no longer there. I'll be testing the next week and compare the two...

I’m not currently on Plex Pass and was waiting to purchase whenever they get full Nvidia support on Linux. Is there anything I would be missing by simply switching to Emby? I never really gave it a whole lot of thought but I don’t see why I couldn’t try it out.

Share this post


Link to post
1 hour ago, ramblinreck47 said:

I’m not currently on Plex Pass and was waiting to purchase whenever they get full Nvidia support on Linux. Is there anything I would be missing by simply switching to Emby? I never really gave it a whole lot of thought but I don’t see why I couldn’t try it out.

I use both (paid versions too). Soon after I started trying emby out, I completely switched over to it for myself. The main reason was that Plex apps kept transcoding all the time (every time I turn on srt subtitles, if there is multi channel audio, Plex transcodes). Emby apps direct play or direct stream on the same hardware with subtitles.

 

I still have family and friends streaming off of plex. I figured it would be too hard to switch some of them over as they are not very technical. So I still run both, but emby for me, Plex for the legacy folk

Share this post


Link to post
Posted (edited)
18 hours ago, pappaq said:

I think you didn't enable the persistance-mode. Do that before testing with: nvidia-smi --persistence-mode=1

sorry, your right.

 

Once i run the command it works :)

 

I just have to set persistence mode on at each boot :0

 

* i justed tested emby, it latches to p0 for transcodes and goes back to p8 once trasncode stops!*

Edited by Dazog

Share this post


Link to post
2 hours ago, aptalca said:

I use both (paid versions too). Soon after I started trying emby out, I completely switched over to it for myself. The main reason was that Plex apps kept transcoding all the time (every time I turn on srt subtitles, if there is multi channel audio, Plex transcodes). Emby apps direct play or direct stream on the same hardware with subtitles.

 

I still have family and friends streaming off of plex. I figured it would be too hard to switch some of them over as they are not very technical. So I still run both, but emby for me, Plex for the legacy folk

I kind of regret paying for a plex pass, honestly. Emby seems like the development team is not only more active, but more responsive. 

Share this post


Link to post
4 hours ago, Xaero said:

I kind of regret paying for a plex pass, honestly. Emby seems like the development team is not only more active, but more responsive. 

Yeah, I visited the emby community yesterday to check out how far the development of a good emby image for the raspi has come and remembered how active that community and especially "luke" is. It's really good. Comparable to the unraid community.

Share this post


Link to post
Posted (edited)

Is there any way to roll back the driver version 'm getting the error my device is not compatible with this driver version. Do I have to rollback the whole Nvidia-unraid build?

 

** I should note the GPU appears to be working with-in my VM but am unable to Passthrough to any Dockers "No Cuda enabled devices available"

 

 

Using built-in stream user interface
-> Detected 24 CPUs online; setting concurrency level to 24.
WARNING: You do not appear to have an NVIDIA GPU supported by the 430.14 NVIDIA Linux graphics driver installed in this system.  For further details, please see the appendix SUPPORTED NVIDIA GRAPHICS CHIPS in the README available on the Linux driver download page at www.nvidia.com.
-> Not installing a kernel module; skipping the "is an NVIDIA kernel module loaded?" test.
-> Installing NVIDIA driver version 430.14.
-> Skipping check for conflicting rpms.
WARNING: The nvidia-uvm module will not be installed. As a result, CUDA will not function with this installation of the NVIDIA driver.
WARNING: The nvidia-drm module will not be installed. As a result, DRM-KMS will not function with this installation of the NVIDIA driver.
WARNING: You specified the '--no-kernel-module' command line option, nvidia-installer will not install a kernel module as part of this driver installation, and it will not remove existing NVIDIA kernel modules not part of an earlier NVIDIA driver installation.  Please ensure that an NVIDIA kernel module matching this driver version is installed separately.

 

Edited by Fiservedpi

Share this post


Link to post
1 hour ago, Fiservedpi said:

Is there any way to roll back the driver version 'm getting the error my device is not compatible with this driver version. Do I have to rollback the whole Nvidia-unraid build?

 

** I should note the GPU appears to be working with-in my VM but am unable to Passthrough to any Dockers "No Cuda enabled devices available"

 

 

Using built-in stream user interface
-> Detected 24 CPUs online; setting concurrency level to 24.
WARNING: You do not appear to have an NVIDIA GPU supported by the 430.14 NVIDIA Linux graphics driver installed in this system.  For further details, please see the appendix SUPPORTED NVIDIA GRAPHICS CHIPS in the README available on the Linux driver download page at www.nvidia.com.
-> Not installing a kernel module; skipping the "is an NVIDIA kernel module loaded?" test.
-> Installing NVIDIA driver version 430.14.
-> Skipping check for conflicting rpms.
WARNING: The nvidia-uvm module will not be installed. As a result, CUDA will not function with this installation of the NVIDIA driver.
WARNING: The nvidia-drm module will not be installed. As a result, DRM-KMS will not function with this installation of the NVIDIA driver.
WARNING: You specified the '--no-kernel-module' command line option, nvidia-installer will not install a kernel module as part of this driver installation, and it will not remove existing NVIDIA kernel modules not part of an earlier NVIDIA driver installation.  Please ensure that an NVIDIA kernel module matching this driver version is installed separately.

 

You have to use a previous build that uses an older driver.

Which card do you have?

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.