Xaero Posted May 26, 2019 Share Posted May 26, 2019 (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 May 26, 2019 by Xaero 1 Quote Link to comment
trurl Posted June 16, 2019 Share Posted June 16, 2019 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. Quote Link to comment
MandalorePatriot Posted August 3, 2019 Share Posted August 3, 2019 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! Quote Link to comment
Pducharme Posted August 4, 2019 Share Posted August 4, 2019 @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. Quote Link to comment
Xaero Posted August 4, 2019 Author Share Posted August 4, 2019 (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 August 4, 2019 by Xaero Quote Link to comment
Megaman69 Posted December 25, 2019 Share Posted December 25, 2019 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? Quote Link to comment
Xaero Posted December 25, 2019 Author Share Posted December 25, 2019 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. Quote Link to comment
dubbly Posted January 5, 2020 Share Posted January 5, 2020 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. Quote Link to comment
Xaero Posted January 5, 2020 Author Share Posted January 5, 2020 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. Quote Link to comment
Recommended Posts
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.