Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[UserScript] Plex nvdec wrapper

Featured Replies

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

  • 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.

  • 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!

@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.

  • Author

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

  • 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?

  • Author
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.

  • 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.

 

  • Author
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. 

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.