[Plugin] Linuxserver.io - Unraid Nvidia


Recommended Posts

Did some tests with Unraid NVIDIA plus NVDEC patch on a Supermicro X9DRi-F, 2x 2680 v2, 128 GB and a NVIDIA 1050ti card.

 

While hardware encoding worked perfect, hardware decoding produced a lot of mess (artifacts, etc.).

 

Seems that there's a reason why Plex has not included hardware decoding into it's software. After lot's of complaints I had to remove the NVDEC patch. Everythings shiny again.

 

Just my USD 0.02.

 

Link to comment
Not sure if this is the best thread for this, but any ideas why my IDLE (as far as I know) power usage on my freshly installed GTX 1060 is 28watts? It's not doing anything. Idle usage on this card should be easily single digits. 
 
IzIa4ic.png&key=8312b0118fb5b1a81dcaa093dd0b578f309305b2826e998da4f2e8e266335be7
 
 
 
 
The power state should be between P8 and P15. The P0 state is for maximum 3D performance.

https://docs.nvidia.com/gameworks/content/gameworkslibrary/coresdk/nvapi/group__gpupstate.html

Enviado de meu SM-G973F usando o Tapatalk

Link to comment
2 hours ago, hawihoney said:

Did some tests with Unraid NVIDIA plus NVDEC patch on a Supermicro X9DRi-F, 2x 2680 v2, 128 GB and a NVIDIA 1050ti card.

 

While hardware encoding worked perfect, hardware decoding produced a lot of mess (artifacts, etc.).

 

Seems that there's a reason why Plex has not included hardware decoding into it's software. After lot's of complaints I had to remove the NVDEC patch. Everythings shiny again.

 

Just my USD 0.02.

 

Emby uses decode and it doesn’t have any artifacts.  I experienced the same thing as you.  On my p2000.  Were your issues on hevc or h264?

Link to comment

I tried with different kind of content and remote clients. In-House everything is "direct play" over LAN - no WiFi. The forced remote clients had to play 4K (up to 100 Mbit/s bitrate), 2K and 3D (converted to be played thru Plex), H264, VC1, a mass of different audio codecs and subtitle formats on Fire-TV 4K, Smart-TV app and Windows HTPC.

 

Link to comment

 

1 hour ago, sittingmongoose said:

Emby uses decode and it doesn’t have any artifacts.  I experienced the same thing as you.  On my p2000.  Were your issues on hevc or h264?

 

23 minutes ago, hawihoney said:

I tried with different kind of content and remote clients. In-House everything is "direct play" over LAN - no WiFi. The forced remote clients had to play 4K (up to 100 Mbit/s bitrate), 2K and 3D (converted to be played thru Plex), H264, VC1, a mass of different audio codecs and subtitle formats on Fire-TV 4K, Smart-TV app and Windows HTPC.

 

Same here with multiple formats on the P4000. Since it only affects remote users, I've told them to "deal with it" until I can sort it out. My proc supports QuickSync. I haven't had time to determine if I can configure things such that Plex will use that for decode and the GPU for encode.

 

If anyone has done this, I'd be curious as to how. I just haven't had time to mess with it.

Link to comment
38 minutes ago, JasonM said:

 

 

Same here with multiple formats on the P4000. Since it only affects remote users, I've told them to "deal with it" until I can sort it out. My proc supports QuickSync. I haven't had time to determine if I can configure things such that Plex will use that for decode and the GPU for encode.

 

If anyone has done this, I'd be curious as to how. I just haven't had time to mess with it.

I’m pretty sure you can only give Plex 1 gpu.  I think you can select different ones in emby though but I haven’t tried it yet.  You’re saying you had artifacts too?  Was it one every stream?  I only noticed it when I had multiple hevc streams going.

 

Also, I have a 9900k, a P2000 and I am going to get a 1660ti.  I am going to compare performance between cpu, igpu, p2000 and turing.  Probably going to do this next month.  Currently unraid doesn’t support the 9th gen Igpus, so I need to wait for them to add that.  Which might be a while :/

Link to comment
4 minutes ago, sittingmongoose said:

I’m pretty sure you can only give Plex 1 gpu.  I think you can select different ones in emby though but I haven’t tried it yet.  You’re saying you had artifacts too?  Was it one every stream?  I only noticed it when I had multiple hevc streams going.

 

Also, I have a 9900k, a P2000 and I am going to get a 1660ti.  I am going to compare performance between cpu, igpu, p2000 and turing.  Probably going to do this next month.  Currently unraid doesn’t support the 9th gen Igpus, so I need to wait for them to add that.  Which might be a while :/

I'm pretty sure you are correct. That's mostly why I haven't spent the cycles looking into it. Artifacts are visible on any transcoded stream. I tried multiple formats and multiple devices. I discovered the issue immediately after setting up the GPU. I wanted to see how many streams the card would support before things started to choke. I got up to 7 before I ran out of client devices, and the card had hardly broken a sweat. I used multiple source files including 4K h264 and HEVC, as well as 1080p. On the clients, I used various quality profiles from 1080p down to 480p using both wired and wireless connections. I have more network capacity than most office buildings, so that wasn't the issue. All transcoded streams showed artifacts, even if I was only running a single session.

 

FWIW, I've only heard complaints from 1 or 2 remote users, and their client device (Apple TV) is notoriously bad at format support anyway. I can't verifiably say that the artifacts are happening on all remote transcode streams, but it definitely happened on all local transcode streams.

Link to comment
14 minutes ago, JasonM said:

I got up to 7 before I ran out of client devices, and the card had hardly broken a sweat.

Can't you open up multiple clients in browser tabs and give them various quality settings, or would that not accomplish what you're after?

Link to comment

 

2 minutes ago, Cessquill said:

Can't you open up multiple clients in browser tabs and give them various quality settings, or would that not accomplish what you're after?

I certainly could have on the devices that were computers, but even then, you could only do maybe 2 or 3 before the client device became the bottleneck. I think I was close to the limit. The GPU wasn't maxed out, but the 8GB RAM in the card was just about tapped. I might have been able to get one more.

Link to comment
21 minutes ago, JasonM said:

 

I certainly could have on the devices that were computers, but even then, you could only do maybe 2 or 3 before the client device became the bottleneck. I think I was close to the limit. The GPU wasn't maxed out, but the 8GB RAM in the card was just about tapped. I might have been able to get one more.

I’ll have to test 1080p again and look for artifacts.

Link to comment
5 hours ago, gfjardim said:

The power state should be between P8 and P15. The P0 state is for maximum 3D performance.

https://docs.nvidia.com/gameworks/content/gameworkslibrary/coresdk/nvapi/group__gpupstate.html

Enviado de meu SM-G973F usando o Tapatalk
 

Is there any way to determine why the power state is like this? Why would this be at P0? 

 

I bought this card used. Is it possible to permanently set the power state until manually reset? Maybe the previous owner did that? If so, wondering how I can reset it. I did try some reset commands through nvidia-smi but I got errors along the lines of (paraphrasing) "You can't do this because this is your only video card" 

Edited by Chad Kunsman
Link to comment
5 hours ago, Chad Kunsman said:

Is there any way to determine why the power state is like this? Why would this be at P0? 

 

I bought this card used. Is it possible to permanently set the power state until manually reset? Maybe the previous owner did that? If so, wondering how I can reset it. I did try some reset commands through nvidia-smi but I got errors along the lines of (paraphrasing) "You can't do this because this is your only video card" 

Just for comparison, I checked nvidia-smi on my 750ti to see if the high idle was a driver issue but mine is currently idling at 1w:

image.png.8103e92f8b1f54fbd471b61ab822b146.png

Link to comment
13 hours ago, JasonM said:

 

 

Same here with multiple formats on the P4000. Since it only affects remote users, I've told them to "deal with it" until I can sort it out. My proc supports QuickSync. I haven't had time to determine if I can configure things such that Plex will use that for decode and the GPU for encode.

 

If anyone has done this, I'd be curious as to how. I just haven't had time to mess with it.

Use the older wrapper script.

Without the marap filter, just 

`exec Plex Transcoder2 -hwaccel qsv "$@"`

 

Hwaccel should only affect the decoder.

Encoder is set with the encoder parameter later in the string, so this should work to enable quicksync for decode, and nvenc for encode.

 

Ymmv.

Link to comment
16 hours ago, gfjardim said:

The power state should be between P8 and P15. The P0 state is for maximum 3D performance.

https://docs.nvidia.com/gameworks/content/gameworkslibrary/coresdk/nvapi/group__gpupstate.html

Enviado de meu SM-G973F usando o Tapatalk
 

 

6 hours ago, j0nnymoe said:

Just for comparison, I checked nvidia-smi on my 750ti to see if the high idle was a driver issue but mine is currently idling at 1w:

image.png.8103e92f8b1f54fbd471b61ab822b146.png

The Nvidia Linux blobs only support manipulating the power states through the use of powermizer and coolbits flags for X11. Since the driver isn't being used to initialize a display, the card does it's own default power management and software has little control.

You MAY be able to force lower power states by echoing values to sysfs nodes for the card, which can be found in some DRM subfolder of the /sys directory. This probably won't persist, and could lead to instability. 

Link to comment
36 minutes ago, Xaero said:

 

The Nvidia Linux blobs only support manipulating the power states through the use of powermizer and coolbits flags for X11. Since the driver isn't being used to initialize a display, the card does it's own default power management and software has little control.

You MAY be able to force lower power states by echoing values to sysfs nodes for the card, which can be found in some DRM subfolder of the /sys directory. This probably won't persist, and could lead to instability. 

That's pretty disappointing. I'd like to pursue another angle, then. Is it possible the card is not clocking down due to something on the system side keeping it busy/locked? Is there any way to search for things from that angle? Instead of assuming it doesn't know how to idle, let me assume something is keeping it from being idle. But I don't know how to search for that. SMI command maybe?

 

Additionally does this card have some sort of NVRAM on it that would permanently save settings applied to it even across power cycles or being removed from the computer? I'm trying to find out/understand if there is some sort of permanent setting that might have been applied to the card that I could undo if I moved it to a different OS for example. 

Edited by Chad Kunsman
Link to comment

Hey guys

So I got this up and running finally, even though the P2000 is on an X4 PCI-E 3.0 lane. Should I have any bottlenecks with this in terms of using the p2000 to the fullest being that it's on an x4 lane? I have an m1015 HBA on the X16 lane (my motherboard make the second x16 slots X4). 

 

I installed the CA User Scripts, and copied and pasted the most recent script listed here to patch. When I check on nvidia-smi it spikes my p2000 up to about 56% when transcoding just starts or if I fas forward in the movie, for an x265 1080p file. Is that normal? I thought it's supposed to barely use any of the  GPU for 1 stream?

 

Edited by maxse
Link to comment
7 hours ago, maxse said:

Hey guys

So I got this up and running finally, even though the P2000 is on an X4 PCI-E 3.0 lane. Should I have any bottlenecks with this in terms of using the p2000 to the fullest being that it's on an x4 lane? I have an m1015 HBA on the X16 lane (my motherboard make the second x16 slots X4). 

 

I installed the CA User Scripts, and copied and pasted the most recent script listed here to patch. When I check on nvidia-smi it spikes my p2000 up to about 56% when transcoding just starts or if I fas forward in the movie, for an x265 1080p file. Is that normal? I thought it's supposed to barely use any of the  GPU for 1 stream?

 

If it has hw twice then it is.  But there is a command like watch nvidia smi.....I forget it though and I can’t remember where I found it lol sorry :(

Link to comment

right, I know it's working. I just dont get how it spike to 56% when I irst run the stream or fast forward while plex fills it's buffer I guess. If it goes tht high with one stream, how will I be able to use multiple streams? I thought one stream is supposed to barely affect the p2000. Is this normal?

Link to comment
19 hours ago, Chad Kunsman said:

That's pretty disappointing. I'd like to pursue another angle, then. Is it possible the card is not clocking down due to something on the system side keeping it busy/locked? Is there any way to search for things from that angle? Instead of assuming it doesn't know how to idle, let me assume something is keeping it from being idle. But I don't know how to search for that. SMI command maybe?

 

Additionally does this card have some sort of NVRAM on it that would permanently save settings applied to it even across power cycles or being removed from the computer? I'm trying to find out/understand if there is some sort of permanent setting that might have been applied to the card that I could undo if I moved it to a different OS for example. 

If you purchased this second hand, it's possible that someone flashed a second hand BIOS designed for overclocking or cryptocurrency mining. As far as un-doing that, you'd want to find the OEM firmware for that card and flash it. Know that flashing a card ALWAYS poses the risk of bricking the card. It's also possible that the fan motor is using a decent amount of power as it seems to be idling at 40%, where it could turn the fan completely off with a lower temperature. It's also a higher wattage GPU, and I'm not certain what the idle power consumption claims from the manufacturer are, or how accurate those claims are.

Link to comment
9 hours ago, maxse said:

right, I know it's working. I just dont get how it spike to 56% when I irst run the stream or fast forward while plex fills it's buffer I guess. If it goes tht high with one stream, how will I be able to use multiple streams? I thought one stream is supposed to barely affect the p2000. Is this normal?

Where are you looking to see the utilization?
the default nvidia-smi screen shows fan speed, GPU core and GPU error correcting percentages, which aren't applicable to the nvenc/nvdec pipelines.
You'll want to use nvidia-smi dmon to get the columns of percentages, and pay attention in particular to the last two columns. If you watch them for the duration of a short video, you should see how it works. It fills a buffer rapidly with video, and then idles. With multiple streams it will simply use the idle durations from the other streams to buffer a new stream. You'd have to have about a dozen or more streams for them to need to double up the duty cycle, and that's where you MIGHT start seeing decreased performance. Of course, this also means you would need to be able to DECODE fast enough for 12+ streams simultaneously encoding. Which is probably more of a problem.

Link to comment
1 hour ago, Xaero said:

If you purchased this second hand, it's possible that someone flashed a second hand BIOS designed for overclocking or cryptocurrency mining. As far as un-doing that, you'd want to find the OEM firmware for that card and flash it. Know that flashing a card ALWAYS poses the risk of bricking the card. It's also possible that the fan motor is using a decent amount of power as it seems to be idling at 40%, where it could turn the fan completely off with a lower temperature. It's also a higher wattage GPU, and I'm not certain what the idle power consumption claims from the manufacturer are, or how accurate those claims are.

 

By the way, I have half solved this problem after more testing. 

 

The card can and will clock itself down while idle UNTIL it has to perform transcoding work. Once the transcode job is finished, it will never clock itself down again until I restart the Plex docker container. 

 

See the moment I restarted the container here: http://i.imgur.com/zeXKiFZ.png

 

See a thread from another user who seems to have the exact same issue here: https://forums.plex.tv/t/stuck-in-p-state-p0-after-transcode-finished-on-nvidia/387685/2

 

I really hope there's a solution as this is about $40 a year down the drain in extra power usage just due to the card not idling as it should. 

Link to comment
  • trurl locked this topic
Guest
This topic is now closed to further replies.