Problems with Intel Iris Xe GPU hardware video acceleration in 22.04

CPU: 13th Gen Intel® Core™ i7-13700H
GPU: Intel Iris Xe # without dGPU
System: Ubuntu 22.04.2 LTS
Kernel: Linux 6.1.0-1008-oem # I install the linux-oem-22.04 kernel manually

Problems: init failed

$ vainfo
libva info: VA-API version 1.14.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/
libva info: Found init function __vaDriverInit_1_14
libva error: /usr/lib/x86_64-linux-gnu/dri/ init failed
libva info: va_openDriver() returns 1
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/
libva info: Found init function __vaDriverInit_1_10
libva error: /usr/lib/x86_64-linux-gnu/dri/ init failed
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

Recently, I installed Ubuntu 22.04.2 in my newly bought laptop with intel Xe iGPU. Everything work fine except the video acceleration. The problems seems same with this bug report, but it shows the fix already released. Can anyone help, how could I fix this?

Support for Intel 13th generation is being tracked in bug 2004237 and private bug 2000223. It looks like it’s not in Ubuntu 22.04 yet, though should be working in 22.10.


Thanks a lot for the clarification and and really appreciate all your hard work! :smiling_face_with_three_hearts:

I’ll wait for the bug fix released for Ubuntu 22.04. Hope it won’t take too long.

I upgrade to the new version of intel-media-va-driver, the problem was fixed. And I can see the gpu activity with intel_gpu_top when playing video with mpv.

$ vainfo
libva info: VA-API version 1.14.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.14 (libva 2.12.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 22.3.1 ()
vainfo: Supported profile and entrypoints
      VAProfileNone                   :	VAEntrypointVideoProc
      VAProfileNone                   :	VAEntrypointStats
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSliceLP
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSliceLP
      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
      VAProfileHEVCMain12             :	VAEntrypointVLD
      VAProfileHEVCMain422_10         :	VAEntrypointVLD
      VAProfileHEVCMain422_12         :	VAEntrypointVLD
      VAProfileHEVCMain444            :	VAEntrypointVLD
      VAProfileHEVCMain444            :	VAEntrypointEncSliceLP
      VAProfileHEVCMain444_10         :	VAEntrypointVLD
      VAProfileHEVCMain444_10         :	VAEntrypointEncSliceLP
      VAProfileHEVCMain444_12         :	VAEntrypointVLD
      VAProfileHEVCSccMain            :	VAEntrypointVLD
      VAProfileHEVCSccMain            :	VAEntrypointEncSliceLP
      VAProfileHEVCSccMain10          :	VAEntrypointVLD
      VAProfileHEVCSccMain10          :	VAEntrypointEncSliceLP
      VAProfileHEVCSccMain444         :	VAEntrypointVLD
      VAProfileHEVCSccMain444         :	VAEntrypointEncSliceLP
      VAProfileAV1Profile0            :	VAEntrypointVLD
      VAProfileHEVCSccMain444_10      :	VAEntrypointVLD
      VAProfileHEVCSccMain444_10      :	VAEntrypointEncSliceLP

But I still can’t get hardware acceleration on my firefox. I’m using the default firefox snap (113.0-2).
The Webrender is shown blocklisted by gfxinfo.
Screenshot firefox

I don’t know if this is relevant, but I got the following warning when launch firefox in terminal:

MESA: warning: Driver does not support the 0xa7a0 PCI ID.
libEGL warning: DRI2: failed to create dri screen

Any suggestion of how can I fix this?

Now you have the driver required for your hardware, but it looks like the remaining issue is Firefox itself. A few comments:

  • Please subscribe to bug 1424201 which is where this should be discussed primarily.
  • MESA: warning: Driver does not support the 0xa7a0 PCI ID sounds like the Firefox snap or its dependencies are lacking the fix from bug 2004237.
  • libEGL warning: DRI2: failed to create dri screen sounds like Firefox also contains/depends on an older version of libva which only supported DRI2 (while Xwayland only supports DRI3). That was fixed in libva 2.17.0 and is tracked in bug 1698287.

TL;DR - we should be tracking all these things missing from the Firefox snap in bug 1424201.

While I do use Firefox for work applications, I use Brave (repo version) for personal applications that require hardware acceleration. For the time being, a second browser should be a workaround until the Firefox bug is fixed.

OK. Thanks a lot.
I forgot to mention that I enable the wayland support with the following code in my .profile.

if [ "$XDG_SESSION_TYPE" == "wayland" ]; then

Also the hardware accelerate did work on my old laptop ( i5-6200U) with recent version of firefox. I hope these may help with the narrowing down of the cause.

Thanks for you help! :smiling_face_with_three_hearts:

Alright both issues are now logged properly at:

Because Firefox gets its video decode drivers from the gnome-42-2204 snap (I think).

The firefox snap seems still using core20 according to the snapcraft.yaml, and the core22 migration still pending.

OK maybe I was misled by snap connections firefox but gnome-3-38-2004 seems to have the same bugs. So we’ll aim to only fix them in gnome-42-2204.

AFAICT the Firefox snap channel latest/stable/ubuntu-23.04 uses gnome-42-2204 and core22, but not the latest/stable, latest/beta and so on. I didn’t see this announced or documented anywhere, but I figured it out when I was removing unused snaps on a test system, and some comment I can’t find now, either here or on Github, seemed to confirm it.

Yes the pieces all landed separately now. I only found out myself a couple of days ago but didn’t want to announce anything when I don’t have 13th gen hardware to test. Also hardware-accelerated video in Firefox is not formally tested and optimized by Canonical/Intel like Chromium is.