Jump to content
Xaero

[UserScript] Plex nvdec wrapper

6 posts in this topic Last Reply

Recommended Posts

Posted (edited)

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

Share this post


Link to post
On 5/26/2019 at 7:39 AM, Xaero said:

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.

Wow this is huge, was looking for such thing. Thanks to you now i have found it.

Keep up the good work and i would also be updating if i need to.


Regards,

Lowe

Share this post


Link to post
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.

Share this post


Link to post

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!

Share this post


Link to post

@MandalorePatriot yes it’s normal because Plex doesn’t support it officially, the wrapper tricks the transcoder.  When Plex will enable the real decoding by upgrading the old ffmpeg they are using, they will also update the webUI to report hw on decoding.  The cpu usage you see might be the audio which isn’t hardware encode or decode at all.

Share this post


Link to post
Posted (edited)

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

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.