No /dev/dri on a Celeron N5105 (Jasper Lake) based build for Plex hardware acceleration

spengbab

Cadet
Joined
Apr 6, 2023
Messages
1
Hello,

I've searched around a fair amount, and I think I understand what's going on/what I'm waiting for, but I'd like to ask explicitly to make sure I'm not munging things!

Per the title, I've built a Celeron N5105 based box to run TrueNAS Core. There wasn't too much thought put into Core vs Scale, so, assuming I could migrate my datasets, I'd be willing to switch if it meant I could get hardware acceleration for Plex.

I followed https://github.com/danb35/freenas-iocage-plex to get a jail setup with Plex, which is working well. I went on to look into hardware acceleration on my TrueNAS Core 13.1u4 box:
Code:
root@truenas[~]# uname -a
FreeBSD truenas.local 13.1-RELEASE-p7 FreeBSD 13.1-RELEASE-p7 n245418-79e75956dbb TRUENAS amd64
root@truenas[~]#
root@truenas[~]# lspci|grep -i intel|grep -i graphics
00:02.0 VGA compatible controller: Intel Corporation JasperLake [UHD Graphics] (rev 01)
root@truenas[~]#

...but I failed at this hurdle:
Code:
root@truenas[~]# ls -l /dev/dri
ls: /dev/dri: No such file or directory
root@truenas[~]#

As I understand it, with no `/dev/dri`, there's no chance of getting hardware acceleration working? Via https://github.com/kern2011/Freenas-Quicksync I landed on https://wiki.freebsd.org/Graphics/Intel-GPU-Matrix which says:
On FreeBSD 13, using drm-kmod, support is the same as on Linux 5.4
On FreeBSD 13, using drm-devel-kmod, support is the same as on Linux 5.4. This includes support for Intel Core gen 12.
...however, that page was last updated 2020-12-21T14:43:54+0000. Looking at https://github.com/freebsd/drm-kmod/releases, suggests that 5.4 is probably still accurate - the last release says:

Do I have to wait for https://github.com/Intel-Media-SDK/...pport-in-Linux-Kernels#lts-and-latest-kernels to show a tick in the box for EHL, JSL, DG1, ADL-S and then wait for it to come through drm-kmod/drm-devel-kmod and then make it into a TrueNAS Core release?

Sorry if I've gone completely off on the wrong path, I've been on a journey trying to understand what's going on and would appreciate a second pair of eyes!

Many thanks
 
Joined
Jan 7, 2015
Messages
1,155
So this is what the basic instructions are and does work. Ive done it. Also works for any other jails that you might want to use HW accel


@@@ INTEL GPU OFFLOAD NOTES @@@

If you have a supported Intel GPU, you can leverage hardware
accellerated encoding/decoding in Plex Media Server on FreeBSD 12.0+.

The requirements are as follows:

* Install multimedia/drm-kmod: e.g., pkg install drm-fbsd12.0-kmod

* Enable loading of kernel module on boot: sysrc kld_list+="drm"
** If Plex will run in a jail, you must load the module outside the jail!

* Load the kernel module now: kldload drm

* Install the supporting Intel VA support library for your GPU
** multimedia/libva-intel-driver: [LEGACY] Intel GMA 4500 or newer
** multimedia/libva-intel-media-driver: Intel HD 5000 (Gen8) or newer
*** This must be installed beside Plex. e.g., in the jail with Plex

* Add plex user to the video group: pw groupmod -n video -m plex

* For jails, make a devfs ruleset to expose /dev/dri/* devices.

e.g., /dev/devfs.rules on the host:

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

* Enable the devfs ruleset for your jail. e.g., devfs_ruleset=10 in your
/etc/jail.conf or for iocage, iocage set devfs_ruleset="10"

Please refer to documentation for all other FreeBSD jail management
utilities.

@@@ INTEL GPU OFFLOAD NOTES @@@
 
Joined
Jan 7, 2015
Messages
1,155
Have a look at this post. I think this is what i did specifically. The other instructions are what's displayed following the PMS install.
 
Top