Activating Plex hardware acceleration on TrueNAS 12 Core

LouisB

Dabbler
Joined
Oct 15, 2020
Messages
28
Hello,

I decided to create a new thread for specific subject, the other thread is confusing and mostly related to FreeNAS 11.2 and 11.3.

Anyone can provide instructions to activate Plex hardware acceleration on TrueNAS 12 Core for Intel and Nvidia video cards in a jail or bhyve?

Thanks
 

Dohmar

Dabbler
Joined
Sep 16, 2020
Messages
24
Very keen to see the results. Would love a step by step. So far I have been unable to see /dev/dri in TrueNAS beta on bare metal, with a Xeon E3 1275v6 and a SuperMicro X11SSL-F... have installed all the packages. Even tried disabling the VGA on the motherboard to see if it would appear. Nada.....
 

dak180

Patron
Joined
Nov 22, 2017
Messages
310
Note: Plex requires FreeBSD 12 in the base system and jail for hardware acceleration, also this only covers intel gpus as that is all that is supported on FreeBSD.

Keep in mind this requires hardware support; you will need to have at a minimum: an intel cpu with an igpu, a motherboard that supports an igpu and additionally this may require specific settings in the bios and/or TrueNAS configured for UEFI booting.

If either ls /dev/dri or ls /dev/drm run on the base system and result in nothing, you have not met the hardware requirements and will need to make changes there or in the bios in order to be able to proceed.


  1. Load the drm kernel module: create tunable: Type: loader, Variable: drm_load, Value: YES.
  2. Load the i915kms kernel module: create tunable: Type: loader, Variable: i915kms_load, Value: YES.
  3. Install the support libs in the plex jail: pkg install multimedia/libva-intel-driver multimedia/libva-intel-media-driver
  4. Add plex to the video group: pw groupmod -n video -m plex
  5. Setup a custom devfs rule set for the plex jail:

Save the following script somewhere on the base system:
Code:
#!/bin/sh

cat >>/etc/devfs.rules << 'EOF'

[devfsrules_bpfjail=101]
add path 'bpf*' unhide

[plex_drm=109]
add include $devfsrules_hide_all
add include $devfsrules_unhide_basic
add include $devfsrules_unhide_login
add include $devfsrules_jail
add include $devfsrules_bpfjail
add path 'dri*' unhide
add path 'dri/*' unhide
add path 'drm*' unhide
add path 'drm/*' unhide

EOF


service devfs restart


Set this to run as a postinit task. We do this rather than editing /etc/devfs.rules directly because it is regenerated on boot.

Finally you will need to edit the plex jail properties to set the devfs_ruleset to 109.

With this hardware acceleration should start working once TrueNAS is rebooted.
 

dan3408

Dabbler
Joined
Jan 30, 2014
Messages
15
Thanks for the summary dak180!

Do you have pointers to the specific settings in the bios or to more information on UEFI booting?

Thanks,
Dan
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Last edited:

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
for Intel and Nvidia video cards

Intel iGPUs only, on hardware that makes it visible to the OS. NVidia would require Plex to first add support for that in their FreeBSD version. I doubt that’ll happen.
 

ornias

Wizard
Joined
Mar 6, 2020
Messages
1,458
@Yorick
I think it's time we PR'ed the required changes to enable hardware transcoding on the stock plugin and be done with these threads.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Step 3) does not appear to do anything for hw transcode. In my testing, it doesn't hurt, but also doesn't improve capabilities. That would suggest Plex doesn't use those libraries, but rather those it brings in itself.
 

ornias

Wizard
Joined
Mar 6, 2020
Messages
1,458
Basically: If you can output video using the iGPU boards would almost always work.
The downside with server boards is that the video out not always actually uses the iGPU, which confuses people.
 

Dohmar

Dabbler
Joined
Sep 16, 2020
Messages
24
Yeah...and the X11SSM-F uses an ASRock VGA for IPMI and local VGA. though I'm a little confused. Architecturally speaking the igpu is inside the cpu, so if the middleware (bios/firmware) has some option to enable that iGPU then it should appear visible to the northbridge and OS
So I'm wondering if Supermicro could potentially put in a BIOS option to turn on the iGPU or perhaps some way to manipulate the CPU into turning it on and making it addressable. It shouldn't need a physical interface to do HW encodes/decodes...
 

dak180

Patron
Joined
Nov 22, 2017
Messages
310
Step 3) does not appear to do anything for hw transcode. In my testing, it doesn't hurt, but also doesn't improve capabilities. That would suggest Plex doesn't use those libraries, but rather those it brings in itself.
That may or may not currently be true, (I have not checked) it is however taken directly from plex's directions on the subject and even if it does not use the libraries themselves it may be necessary to set up the correct permissions.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Sucks. I don't know why that board won't work unless its got something to do with the IPMI...

The board simply didn’t add the circuitry necessary to use the iGPU, that’s all. That’s been a theme with SuperMicro, that only some entry level boards have that capability. Same story on the c246.
 

ornias

Wizard
Joined
Mar 6, 2020
Messages
1,458
If you want full iGPU compatibility, Fujitsu boards are nice ;-)
No IPMI though, because they are power-efficiency focussed.
 

Dohmar

Dabbler
Joined
Sep 16, 2020
Messages
24
its a nice feature to have, but I have to say the X11SSM-F is pretty much perfect as a NAS board... has ECC (64gb max, more than enough for me), the xeon proc, 4 pci slots which are 8x (dual 10gbe, possibly upgrade this to 40gbe), 8x (9307 IT mode for the spinning rust), 4x (NVME SSD) 4x (NVME SSD) and the 8 on board sata ports are running my SSD pools... also have the 2x 1gbe NiCs on board which are passed through to a pfSense VM which is stupendously fast compared to the bare metal I was running it on before.

I'll just have to live without hw transcodes
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
No IPMI though

Scoff. Upturned snob nerd nose.

My “server” lives on a bookshelf in the basement, and putting a keyboard and monitor anywhere near it would be a major PITA. Plus I like the idea of being able to get to it from outside the house if I ever want to / need to. IPMI is a must-have feature. Just so nice.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
If you want full iGPU compatibility, Fujitsu boards are nice ;-)
No IPMI though, because they are power-efficiency focussed.
Only a particular line of Fujitsu boards, I assume? Our Fujitsu servers have one of the nicest IPMI implementations I have seen in the industry. SOL via SSH including BIOS setup, perfect support of the function keys, rich web interface including power consumption graphs ...
Unfortunately remote media and VGA console is an additional license as with all the other big players.

Only Supermicro seems to be an exception. But their telnet/ssh interface sucks. There's always something.

Our reasons to switch from Fujitsu to Supermicro were different, though. Mainly vendor lock-in for hard drive and SSD cages you could only buy with the drives included at incredible prices. And Fujitsu branded LSI controllers that you cannot flash to IT mode.

Kind regards,
Patrick
 

Dohmar

Dabbler
Joined
Sep 16, 2020
Messages
24
Scoff. Upturned snob nerd nose.

My “server” lives on a bookshelf in the basement, and putting a keyboard and monitor anywhere near it would be a major PITA. Plus I like the idea of being able to get to it from outside the house if I ever want to / need to. IPMI is a must-have feature. Just so nice.
Oh yeah. Comes in very handy too, if you want to see the CAMcontrol errors going to the console and you're not nerdy enough to have a vt100 and a serial cable...
 

dak180

Patron
Joined
Nov 22, 2017
Messages
310
Do you have pointers to the specific settings in the bios or to more information on UEFI booting?
Unfortunately since there is no standard way for this to be setup in a bios, so not really. On UEFI booting, it is a choice you make at install time and requires a reinstall to change.
 
Top