Solved Unable to get hardware acceleration to work on old Lenovo laptop

Hello,

I freshly installed FreeBSD on an old Lenovo laptop with an Intel graphic card. But I cannot figure out why the hardware acceleration does not work and would therefore appreciate any help. Please see the relevant information below:

Code:
# uname -a
FreeBSD lenovo 14.3-RELEASE-p3 FreeBSD 14.3-RELEASE-p3 GENERIC amd64

Code:
# pciconf -lv | grep -B3 display
vgapci0@pci0:0:2:0:    class=0x030000 rev=0x0e hdr=0x00 vendor=0x8086 device=0x0f31 subvendor=0x17aa subdevice=0x3986
    vendor     = 'Intel Corporation'
    device     = 'Atom Processor Z36xxx/Z37xxx Series Graphics & Display'
    class      = display

I have the xf86-video-intel package installed, but I am not sure if that was a good decision…

Code:
# vainfo
Trying display: wayland
Trying display: x11
libva info: VA-API version 1.22.0
libva error: vaGetDriverNames() failed with unknown libva error
vaInitialize failed with error code -1 (unknown libva error),exit

Code:
# mpv --hwdec=auto video.webm
● Video  --vid=1               (av1 1920x1080 60 fps) [default]
● Audio  --aid=1  --alang=eng  (opus 2ch 48000 Hz) [default]
[vo/gpu/libplacebo] Found no suitable device, giving up.
[vo/gpu/libplacebo] Failed initializing vulkan device
libEGL warning: DRI2: failed to authenticate
MESA: error: ZINK: failed to choose pdev
libEGL warning: egl: failed to create dri2 screen
'-avx512er' is not a recognized feature for this target (ignoring feature)
'-avx512pf' is not a recognized feature for this target (ignoring feature)
'-avx512er' is not a recognized feature for this target (ignoring feature)
'-avx512pf' is not a recognized feature for this target (ignoring feature)
'-avx512er' is not a recognized feature for this target (ignoring feature)
'-avx512pf' is not a recognized feature for this target (ignoring feature)
[vo/gpu/opengl] Suspected software renderer or indirect context.
[vo/gpu/drm] VT_GETMODE failed: Inappropriate ioctl for device
[vo/gpu/drm] Failed to set up VT switcher. Terminal switching will be unavailable.
The mpv player does not open that video file…
 
I have made some progress, because I noticed that I had forgotten to set the LIBVA_DRIVER_NAME environment variable. So I have set it to i965 and now vainfo gives me the following result:

Code:
# vainfo
Trying display: wayland
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
Trying display: x11
error: can't connect to X server!
Trying display: drm
libva info: VA-API version 1.22.0
libva info: User environment variable requested driver 'i965'
libva info: Trying to open /usr/local/lib/dri/i965_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 i965 driver for Intel(R) Bay Trail - 2.4.4
vainfo: Supported profile and entrypoints
      VAProfileNone                   :    VAEntrypointVideoProc
 
device = 'Atom Processor Z36xxx/Z37xxx Series Graphics & Display'
This is the problem. Intel DRM driver does not support "Baytrail" beyond 'drm-510-kmod' driver. That driver version is only available on the 13.x branch.
So 13.5-RELEASE is last version to support i915kms on Baytrail/Z37XXX.

So no modesetting driver. The xf86-video-intel driver does work but it uses llvm pipe which is software based and slow. Same as scfb uses.

I have alot of Baytrail Graphics CPU platforms and I have been updating them to 13.5-RELEASE to prepare for the demise.

graphics/drm-510-kmod
Note the fixes on 12 May 2023 at the bottom of the freshports page.

graphics/drm-510-kmod: Update to drm_v5.10.163_6

- Fix i915kms on Baytrail/Valleyview hardware
 
This is the problem. Intel DRM driver does not support "Baytrail" beyond 'drm-510-kmod' driver. That driver version is only available on the 13.x branch.
So 13.5-RELEASE is last version to support i915kms on Baytrail/Z37XXX.

So no modesetting driver. The xf86-video-intel driver does work but it uses llvm pipe which is software based and slow. Same as scfb uses.

I have alot of Baytrail Graphics CPU platforms and I have been updating them to 13.5-RELEASE to prepare for the demise.

graphics/drm-510-kmod
Note the fixes on 12 May 2023 at the bottom of the freshports page.
Thank you very much! That explains my problem.
 
It is possible that somebody submits PR and this gets fixed. I don't think the Intel DRM on Linux is broke for Baytrail. So maybe it is not imported well from Linux. I dunno the particulars.
It seems newer than SandyBridge graphics which are still working.

Fix i915kms on Baytrail/Valleyview hardware
 
Back
Top