[UserScript] Plex nvdec wrapper


Recommended Posts

This post is under construction

 

Plex nvdec wrapper script

Please use this thread, to report issues, or discuss the use of the nvdec wrapper script. DO NOT report issues resulting from the use of this script to Unraid, LS.IO, Revr3nd, Plex, or nvidia

 

What is this?
This is a wrapper script to enable nvidia based hardware decoding in Plex dockers running on unraid-nvidia. You must be running an unraid-nvidia build and have a working transcode environment using your nvidia card for this script to do anything. To find out more about the unraid-nvidia project and install it yourself, see this post.

 

How do I get it?

Click here to visit the github repository where you will find detailed instructions on how to set up this script.

 

Reporting issues
At a minimum, please provide a brief description of the issue you are facing, and a copy of the System Log from the current boot WHILE the issue is present. Do not reboot until after you have copied the log. To post the log, please use a paste service, like paste.ubuntu.com, rather than pasting into the forum directly. Full diagnostic zips may be required, but are generally overkill for troubleshooting what's happening with pci-e devices.

 

Specifically, this advice applies to anyone reporting an issue of the use of this script causing their card to "drop" from unraid nvidia, as this may be something more major that needs to be submitted to the proper channels.


Please feel free to also mention any improvements for this OP.

Edited by Xaero
  • Like 1
Link to comment
  • 3 weeks later...
On 5/25/2019 at 10:09 PM, Xaero said:

To post the log, please use a paste service, like paste.ubuntu.com, rather than pasting into the forum directly

 

It's your support thread, but I usually discourage users from linking to an external site for this purpose.

 

I agree that we don't want syslogs pasted into the text of a post, but syslog as an attachment to a post is more convenient to create and more convenient to use.

 

And there are a lot of sites someone could use, who knows how safe any particular one might be.

Link to comment
  • 1 month later...

Hi everyone,

 

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!

Link to comment

Indeed, the above information is correct. To verify that decoding is being used nvidia-smi dmon -s u will show the "dec" column as a value other than 0.
There is also some natural overhead for the GPU driver itself on the CPU. That is to say, the rendering thread on the GPU does still require the CPU to do some work (it facilitates the read operation from the disk, and the processing of the container format as well as some other stuff, as well as audio decoding and encoding if needed). If your files have ATMOS or 7.1 audio, and you are playing back on a stereo device, you will still see at least one CPU thread with high utilization.

 

Do also note, that both decode and encode operations will place your nvidia GPU into a "P0" (full power) state permanently due to a bug on Plex's side. I'm working on a reliable way to kludge around this, but it's not easy. The problem needs to be solved by Plex.

Edited by Xaero
Link to comment
  • 4 months later...
On 8/3/2019 at 8:04 PM, Xaero said:

 

Do also note, that both decode and encode operations will place your nvidia GPU into a "P0" (full power) state permanently due to a bug on Plex's side. I'm working on a reliable way to kludge around this, but it's not easy. The problem needs to be solved by Plex.

What exactly does that mean? How would we know if we get that glitch? What are the consequences?

Link to comment
9 hours ago, Megaman69 said:

What exactly does that mean? How would we know if we get that glitch? What are the consequences?

Well, for one - this script is now useless. Plex ships with nvdec and nvenc on Linux now. (At least for Plex Pass users, not sure if its hit mainline Plex but probably)

That said, its just a power management thing. So, by working around the bug I can get the card to stay in an "idle" P8 state. Which means the card is only consuming 3-5W of power. With the bug present (it still is) the card latches to a P0 state - which is the highest power state, and will consume 25-40W.
The above power figures are observed from my P2000 - other cards will consume more, or less depending on their power requirements.

Link to comment
  • 2 weeks later...

Thank you for your support to get this working even though plex now supports it.  So, to confirm, in order to get both nvdec and nvenc to work.   We just need to install the nividia build of unraid and configure the plex docker correctly.  No, need to replace the transcoder file.

 

Link to comment
56 minutes ago, dubbly said:

Thank you for your support to get this working even though plex now supports it.  So, to confirm, in order to get both nvdec and nvenc to work.   We just need to install the nividia build of unraid and configure the plex docker correctly.  No, need to replace the transcoder file.

 

Correct. nvdec and nvenc are now natively supported by Plex, rendering this script effectively useless. 

Link to comment

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.