Page MenuHomeSolus

VAAPI stopped working
Closed, ResolvedPublic

Description

Hi! I use vaapi to accelerate video decoding in Firefox. This stopped working a few weeks ago.

I now get these outputs from vainfo, indicating the error lies within the iHD driver:

$ vainfo
libva info: VA-API version 1.15.0
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
vaInitialize failed with error code -1 (unknown libva error),exit
$ env LIBVA_DRIVERS_PATH=/usr/lib64/dri LIBVA_DRIVER_NAME=iHD LIBVA_TRACE=1 vainfo
libva info: Open new log file 1.212727.thd-0x000010ce for the thread 0x000010ce
libva info: LIBVA_TRACE is on, save log into 1.212727.thd-0x000010ce
libva info: VA-API version 1.15.0
libva info: User environment variable requested driver 'iHD'
libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_15
libva error: /usr/lib64/dri/iHD_drv_video.so init failed
libva info: va_openDriver() returns 1
vaInitialize failed with error code 1 (operation failed),exit

Looking for solutions in forums and such did not yield results as of yet.

Any ideas? Thank you very much!

Other Info:

$ uname -a
Linux torres 5.15.50-216.current #1 SMP PREEMPT Sun Jun 26 05:12:10 UTC 2022 x86_64 GNU/Linux
$ cat /etc/lsb-release
LSB_VERSION=1.4
DISTRIB_ID=Solus
DISTRIB_DESCRIPTION="Solus"
DISTRIB_RELEASE=4.3
DISTRIB_CODENAME=fortitude
$ eopkg hs | grep va
    * gstreamer-vaapi 1.18.5-15-1-x86_64 is reinstalled.
    * libva-vdpau-driver 0.7.4-9-1-x86_64 is installed.
    * libvdpau-va-gl 0.4.2-6-1-x86_64 is reinstalled.
    * libva-utils 2.15.0-11-1-x86_64 is reinstalled.
    * libva-intel-driver 2.4.1-13-1-x86_64 is reinstalled.
    * libva 2.15.0-23-1-x86_64 is reinstalled.
    * libva is upgraded from 2.14.0-22-1-x86_64 to 2.15.0-23-1-x86_64.
    * libva-32bit is upgraded from 2.14.0-22-1-x86_64 to 2.15.0-23-1-x86_64.
    * libva-devel is upgraded from 2.14.0-22-1-x86_64 to 2.15.0-23-1-x86_64 with delta.
    * libva-utils is upgraded from 2.14.0-10-1-x86_64 to 2.15.0-11-1-x86_64.

Event Timeline

Could you post here your system specs? It is working fine on both my old Intel (Broadwell) and AMD system.

DELL Latitude E7440

Core i7 4600U

$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 0b)

Unfortunately you GPU is super old and no longer supported by intel-media-driver https://github.com/intel/media-driver#supported-platforms
[[ https://github.com/intel/media-driver/issues/1288#issuecomment-968441652 | Here they suggested using intel-vaapi-driver instead ]].
Could you install libva-intel-driver and try again?

I already have libva-intel-driver installed. Uninstalling intel-media-driver and/or reinstalling libva-intel-driver also does not help.

And, again, it worked perfectly until 2-4 weeks ago

Could you try again with a freshly rebuilt libva-intel-driver (and using the i915 driver instead of iHD)?:

sudo eopkg it https://packages.getsol.us/unstable/libv/libva-intel-driver/libva-intel-driver-2.4.1-14-1-x86_64.eopkg

(I think this should work on Stable, otherwise I'll have to build a package against the Stable repo to test)

Done, still the same error:

$ sudo eopkg it https://packages.getsol.us/unstable/libv/libva-intel-driver/libva-intel-driver-2.4.1-14-1-x86_64.eopkg
$ env LIBVA_DRIVERS_PATH=/usr/lib64/dri LIBVA_DRIVER_NAME=i915 LIBVA_TRACE=1 vainfo
libva info: Open new log file 1.225639.thd-0x00000574 for the thread 0x00000574
libva info: LIBVA_TRACE is on, save log into 1.225639.thd-0x00000574
libva info: VA-API version 1.15.0
libva info: User environment variable requested driver 'i915'
libva info: Trying to open /usr/lib64/dri/i915_drv_video.so
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit
$ env LIBVA_DRIVERS_PATH=/usr/lib64/dri LIBVA_DRIVER_NAME=iHD LIBVA_TRACE=1 vainfo
libva info: Open new log file 1.225637.thd-0x00000554 for the thread 0x00000554
libva info: LIBVA_TRACE is on, save log into 1.225637.thd-0x00000554
libva info: VA-API version 1.15.0
libva info: User environment variable requested driver 'iHD'
libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

(also rebooted, still the same)

I think what could be the problem for you is this: https://github.com/intel/intel-vaapi-driver/issues/533
With a Mesa update your GPU is no longer using the old Intel driver, but Crocus - new Intel driver adapted for old GPUs. And the libva-intel-driver version we have in the repos doesn't include support for it.
So either you could maybe try the workaround they posted, or someone could patch the driver with that one commit.

Just adding the crocus_drv_video.so symlink unfortunately doesn't do anything :/

Also rolling back the last libva-intel-driver update using eopkg didn't fix it, interestingly

Does rolling back mesalib help at all?

mesalib was last updated on 2022-07-05 from 22.0.4 to 22.0.5. Rolling back now, gonna take a while

No, I mean rolling back to the rel 176 right before this commit was introduced: https://dev.getsol.us/R2066:a55d0e8229446a9a09f175cced40b02db7da70f7. I mention it because that commit fixed a vaapi issue affecting old GPUs using the crocus driver and I wonder if it might be related. The bug report linked in that commit was commented on by users of sandy bridge-era GPUs, which I imagine your GPU is closely related to.

Ahh. Too late ^^

But interesting progress:

Interestingly:

Following packages could not be found in repositories and are not cached:
mesalib-22.0.4-174-1-x86_64.eopkg

So after the rollback my versions were:

mesalib 22.0.5
libva 2.14.0
libva-intel-driver 2.4.1

and then it worked:

$ vainfo
libva info: VA-API version 1.14.0
libva info: Trying to open /usr/lib64/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_13
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.14 (libva 2.13.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile - 2.4.1
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264MultiviewHigh      : VAEntrypointVLD
      VAProfileH264MultiviewHigh      : VAEntrypointEncSlice
      VAProfileH264StereoHigh         : VAEntrypointVLD
      VAProfileH264StereoHigh         : VAEntrypointEncSlice
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileJPEGBaseline           : VAEntrypointVLD

But when i updated everything back to current, it now still works??? So maybe a reinstall of mesalib and/or libva might have done it ^^

Ah, it was probably mesalib. There's something funky about eopkg's handling of the mesalib package and we've had strange issues get solved by a reinstall of the package.

Alright then, i'll try to keep that in mind. Thanks y'all, you're awesome!

GladOSkar claimed this task.