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.
- Load the drm kernel module: create tunable: Type:
loader
, Variable: drm_load
, Value: YES
.
- Load the i915kms kernel module: create tunable: Type:
loader
, Variable: i915kms_load
, Value: YES
.
- Install the support libs in the plex jail:
pkg install multimedia/libva-intel-driver multimedia/libva-intel-media-driver
- Add plex to the video group:
pw groupmod -n video -m plex
- 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.