Activating Plex hardware acceleration

Dravinian

Dabbler
Joined
Jun 30, 2020
Messages
32
I think I will have to go through the steps again tonight, make sure my Jail is tuned to the right DRM, and make sure the DRM 5 bug isn't messing me about...or that I didn't accidentally mess up one of the steps after tinkering for 3 hours late at night. At the moment, it isn't (hw) my transcodes....but...everything is now in place for it to work, just need to make sure everything has been done properly.

And yes, it did take me 3 hours to go through this thread, while tinkering, until I got a grasp on what was going on and how it might not be working. Right now, I am worried my Jail is looking at 5, 10, 100, 109 or 110 for DRM when I have set up the script to have it look at 5, 10, 100, 109 or 110....I think I need to sync those up but off to work now.

Thanks to everyone in this thread btw, this is not an easy task but lots of helpful information in here.

Well set it all back up as it should be, stil no (hw) looks like I will have to spend another 3 hours going through the thread looking for the answer....well at least I have my evening planned out...
 
Last edited:

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
When you are ready to tinker some more, this walkthrough may help. https://www.youtube.com/watch?v=GvM32lWc_r4

That devfs bug is manageable in 11.3, at least on my system, by restarting devfs before starting the jail. In 12.0, the bug is resolved.
 

Dravinian

Dabbler
Joined
Jun 30, 2020
Messages
32
Oddly, the link to the guide is different from the guilde that he is using (I think whoever made it must have updated it) but the new guide does not include the intel driver install anymore, not sure why. that is a guide that I used before when I could not get it working.

However, I am sure that I installed the drivers from reading this thread, but have just noticed that perhaps I installed the drivers for a CPU I do not have, so I have just installed the correct drivers (I think). I worked through the video again, but reached a part where plex is in use, so will have to leave it be for a bit.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
but the new guide does not include the intel driver install anymore

Correct, because we figured out in this thread that it's not needed.

The video description tells you not to bother with intel driver install, although the video still shows that.
 

Dravinian

Dabbler
Joined
Jun 30, 2020
Messages
32
Correct, because we figured out in this thread that it's not needed.

The video description tells you not to bother with intel driver install, although the video still shows that.

Yeah I saw that in the thread, but as I was working through, I had already installed them before I got to that part. Oddly, after finding that guide omitting them, but given how I was stuck I thought maybe that was a step I needed.

And given where I am now, I figured hell, something is not right, might as well try that. It can't hurt to install the drivers can it?
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
It doesn’t hurt, in testing it worked fine with or without.
 

Dravinian

Dabbler
Joined
Jun 30, 2020
Messages
32
It doesn’t hurt, in testing it worked fine with or without.

Hi Yorick,.

I am kind of at my wits end here. I have followed the video and the guide, I went through the script, followed ever step. It was very useful and I feel that it has worked...in the sense of everything that was supposed to happen, happened....except the final part!

I have the 'iocage exec plex /dev/dri' showing the card0 and renderD128 - and it appears in FreeNAS as well.

I understand that this means that I have passed through the drm/dri to Plex. I have plex pass - can tell this by the dashboard on the web UI. I have run the update on my plex jail. I have restarted the machine, and my initialisation script appears to work, I check the /dev/dri and they are both still there.

On my settings page, in Plex Web interface, under transcoder, I have it:

set to Automatic transcoder quality;
no temp directory;
60 as default throttle;
background transcode at Fast - the middle setting (I tried Ultra Fast and Very Slow as well);
disable transcoding is NOT ticked;
use HW when available is ticked;
so is use HW video encoding ticked (I never noticed this box before, I think it is new? from having Plex have DRI/DRM - is that a thing - I can't be 100% sure, but I don't remember that box);
maximum simultaneous streams = unlimited.

Yet, I play a 4k video, and my CPU usage is at 85-90% and there is no (hw) being used.

4K (HEVC Main 10)
1080P (H264)—Transcode

I am on a i7 4790k - a cpu mentioned in the guide as working, on a consumer board (ASUS Maximus Rampage VII).

I can't quite work out why this is not working? Why would it not use HW when the drm/dri are available in FreeNAS and the Plex Jail?

The question, the only thing I don't fully understand is:

pw groupmod -n video -m plex

I understand it is giving Plex permissions, but I am worried that something might be named differently in my plex server during set-up that I have not accounted for in that little piece of code. But I tried different users in place of plex, in case it was the user, and it just said user doesn't exist. The only users in my user list that worked, was root.

Honestly, I have run out of ideas.
 

Dravinian

Dabbler
Joined
Jun 30, 2020
Messages
32
I even went so far as to go right back to the beginning and create a new plex media server, using the script detailed in the video, just in case there was any issue there.

Still no HW when transcoding, I even watched the same movie! heh I just can't seem to get it running, even though it is recognised in lpsci and the dri/drm is showing up. Another 4am job when I have work in the morning just trying to get this going :) It will work, one day, but just not today.

I have noticed this little nugget...if I start a movie in plex, see that it is not transcoding and close it...my CPU continue to work at roughly 15-25%...says in the System Processes that it is Plex Media and Plex Trans that is working...despite nothing playing...have to start and stop a new movie to get it to stop (short of restarting the jail). Just a nugget, not sure it is relevant.
 
Last edited:

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
I am on a i7 4790k

This is why. For 4k it’s Kaby Lake or better. The instructions have a QuickSync link at the bottom, follow that. Your iGPU can’t handle HEVC.

Given that HDR to SDR isn’t a thing anyway, I’d keep a 1080p SDR version alongside. If you don’t have that, instruct Plex to Optimize for the target resolution, and it’ll transcode that 4k for you and keep an optimized version.

Your iGPU is fine for 1080p, 4th gen CPU is the first gen where the iGPU can handle 1080p just fine.

For 4k, Coffee Lake on 12 or Kaby Lake on 11.3, but still, SDR 1080p version is better.
 

Dravinian

Dabbler
Joined
Jun 30, 2020
Messages
32
This is why. For 4k it’s Kaby Lake or better. The instructions have a QuickSync link at the bottom, follow that. Your iGPU can’t handle HEVC.

Thank you for taking the time...I didn't realise resolution made a difference to whether it would work or not!
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
I didn't realise resolution made a difference to whether it would work or not!

It’s really the codec. 4k video uses HEVC aka H.265; 1080p uses H.264 or VC1. 480p/i is usually MPEG2. To decode and encode, the hardware (or software) needs to understand the format the file is in - said briefly, the codec used for the video.

If H.266 gets adopted, we’ll have that generational gap all over again in a few years time.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
pw groupmod -n video -m plex

Just to circle back on this: This makes the plex user part of the video user group, a step that Plex requires to be able to use the iGPU for hardware transcode.
 

elorimer

Contributor
Joined
Aug 26, 2019
Messages
194
Upgrading plex in the jail in 12beta from p6 to p7 broke my jail for some reason, so I set it up all over again. I already had the config and script for the automated install, so it was trivial to do that. Still, that video was quite helpful. I installed the upgraded intel drivers for my Gemini Lake/Goldmont Plus. Hardware acceleration purports to be working, but it is still broken/pixelated. Just reporting.
 

Dravinian

Dabbler
Joined
Jun 30, 2020
Messages
32
Well hopefully we get GPU enabled acceleration at some point, and hopefully it will be less fraught with problems.

Heh who am I kidding, still this is kinda fun. If it wasn't, I probably wouldn't be doing it.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
It turned mine off again. I have a couple movies with PGS or vobsub subtitles, and hardware transcode doesn’t work with “burning in” the sub. Opensubtitles only gets me so far. I could manually convert to srt, but for now, back to software transcode it is.
 

Dravinian

Dabbler
Joined
Jun 30, 2020
Messages
32
It turned mine off again. I have a couple movies with PGS or vobsub subtitles, and hardware transcode doesn’t work with “burning in” the sub. Opensubtitles only gets me so far. I could manually convert to srt, but for now, back to software transcode it is.

Thanks for posting that, it may seem odd, but this at least gives me some comfort that some of the difficulty in this process wasn't all just my own errors and that it is a niche little area that requires real work to make happen.
 

m0t0rh3ad

Dabbler
Joined
Jul 13, 2020
Messages
32
can someone provide working instruction with step by step guide how enable hw acceleration for plex?
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Update on that issue I am having with using hardware transcode with subtitles: Works fine in FreeNAS, breaks in TrueNAS Core. Go figure. There’s a Plex employee who’s taking a look, but I wouldn’t hold my breath on seeing rapid progress towards determining root cause.
 

dexll

Dabbler
Joined
Jul 16, 2020
Messages
10
I followed https://github.com/kern2011/Freenas-Quicksync but can't get /dev/dri to show in FreeNAS (or Plex jail), but drm is there.

Intel Core i5-9400 on AsRock Z390M-ITX motherboard.

Pretty sure QuickSync is supported, its why I bought it, but I don't see anything in BIOS related to QS or iGPU.

Am I missing something or SOL?
 
Top