No /dev/dri on a Celeron N5105 (Jasper Lake) based build

I’ve been searching a lot.

Links

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

And so on. But nothing seem to be working in 13.3. Modules are loaded. But there is no /dev/dri on host.

root@truenas[/]# kldstat
Id Refs Address                Size Name
28    1 0xffffffff85b3f000   15d588 i915kms.ko
29    1 0xffffffff85c9d000    80020 drm.ko

root@truenas[/]# pkg which /boot/modules/drm.ko
/boot/modules/drm.ko was installed by package drm-fbsd13-kmod-5.4.144.g20220223

root@truenas[/]# pkg which /boot/modules/i915kms.ko
/boot/modules/i915kms.ko was installed by package drm-fbsd13-kmod-5.4.144.g20220223

root@truenas[~]# ls /dev/dri
ls: /dev/dri: No such file or directory

And so inside the jail

root@ffmpeg:~ # vainfo --display drm
Trying display: drm
error: failed to initialize display 'drm'

root@ffmpeg:~ # ls /dev/dri
ls: /dev/dri: No such file or directory

The script, yet there is no directory to unhide

#!/bin/sh

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

[ffmpeg_drm=10]
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' >> /etc/devfs.rules

service devfs restart

kldload /boot/modules/i915kms.ko

What else can be done about it?

No populated /dev/dri on the host usually means the driver doesn’t support or recognize the particular chip with acceleration. If this isn’t some simple setting to enable you may be best served on SCALE which I would expect just works out of box.

drm-fbsd13-kmod is an old package that no longer exists.
Install graphics/drm-510-kmod.
Firmware(graphics/gpu-firmware-intel-kmod) may also be required.

What would be the way of installing those? As pkg is not working.

fetch http://pkg.freebsd.org/FreeBSD:13:amd64/latest/All/drm-510-kmod-5.10.163_9.pkg
pkg delete drm-fbsd13-kmod
pkg add drm-510-kmod-5.10.163_9.pkg

You may find out about firmware by trying one by one or by looking at /var/log/Xorg.0.log.

pkg fetch -g gpu-firmware-intel\*

hmmm, doesn’t seem to work

truenas KLD i915kms.ko: depends on kernel - not available or version mismatch
truenas linker_load_file: /boot/modules/i915kms.ko - unsupported file type

Probably should be this one for release_3?

I was under impression that it was updating to next version automatically via Update System in web UI. But it turned to be not 13.3. So I manually upgraded to 13.3 and /dev/dri is now there.

And so as VAAPI.

I also had to add tunable hw.i915kms.enable_guc = 2 into LOADER. And vp9_vaapi is now working in ffmpeg.

root@ffmpeg:~ # vainfo --display drm
Trying display: drm
libva info: VA-API version 1.22.0
libva info: Trying to open /usr/local/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_22
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.22 (libva 2.22.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 23.4.3 (intel-media-23.4.3)
vainfo: Supported profile and entrypoints
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileNone                   : VAEntrypointStats
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSliceLP
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSliceLP
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointEncSliceLP
      VAProfileVP9Profile1            : VAEntrypointVLD
      VAProfileVP9Profile1            : VAEntrypointEncSliceLP
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointEncSliceLP
      VAProfileVP9Profile3            : VAEntrypointVLD
      VAProfileVP9Profile3            : VAEntrypointEncSliceLP
      VAProfileHEVCMain422_10         : VAEntrypointVLD
      VAProfileHEVCMain444            : VAEntrypointVLD
      VAProfileHEVCMain444            : VAEntrypointEncSliceLP
      VAProfileHEVCMain444_10         : VAEntrypointVLD
      VAProfileHEVCMain444_10         : VAEntrypointEncSliceLP