bluefin: Hardware video decoding is broken in flatpak Firefox (Intel GPU)

I installed Bluefin on my laptop and noticed that YouTube videos make my laptop quite warm. I started to look into it, and I saw that Firefox can’t use hardware acceleration for video decoding.

First I checked the output of vainfo:

$ vainfo
Trying display: wayland
libva info: VA-API version 1.21.0
libva info: Trying to open /usr/lib64/dri-nonfree/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_21
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.21 (libva 2.21.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 24.1.5 ()
vainfo: Supported profile and entrypoints
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileNone                   : VAEntrypointStats
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointFEI
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointFEI
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointFEI
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileVP8Version0_3          : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointFEI
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD

The about:support page says that HARDWARE_VIDEO_DECODING runtime is unavailable because it got force disabled by glxInfo with the failure code FEATURE_FAILURE_VIDEO_DECODING_TEST_FAILED.

After reading forum posts and tutorials, I set environment variables in Flatseal:

  • MOZ_DISABLE_RDD_SANDBOX=1
  • MOZ_ENABLE_WAYLAND=1
  • LIBVA_MESSAGING_LEVEL=1
  • LIBVA_DRIVERS_PATH=/run/host/usr/lib64/dri
  • LIBVA_DRIVER_NAME=iHD <- this is the appropriate driver for my iGPU

I enabled GPU acceleration in the Devices section.

I also set a dozen configurations in about:config in various combinations but nothing worked.

So I looked into what Firefox is actually doing when checking the hardware support. Turns out there is a small program called vaapitest. Running this inside the flatpak container revealed the actual problem:

[📦 org.mozilla.firefox ~]$ MOZ_GFX_DEBUG=1 /app/lib/firefox/vaapitest -d /dev/dri/renderD128
vaapitest start, device /dev/dri/renderD128
libva error: dlopen of /run/host/usr/lib64/dri/iHD_drv_video.so failed: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.15' not found (required by /run/host/usr/lib64/dri/iHD_drv_video.so)
vaInitialize failed -1

Running it outside of the flatpak works:

$ MOZ_GFX_DEBUG=1 /var/lib/flatpak/app/org.mozilla.firefox/current/active/files/lib/firefox/vaapitest -d /dev/dri/renderD128
vaapitest start, device /dev/dri/renderD128
libva info: VA-API version 1.21.0
libva info: Trying to open /usr/lib64/dri-nonfree/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_21
libva info: va_openDriver() returns 0
vaInitialize finished
Profile: H264Main
Profile: H264High
Profile: H264ConstrainedBaseline
Profile: VP8Version0_3
Profile: VP9Profile0
Profile: VP9Profile2
vaapitest finished
VAAPI_SUPPORTED
TRUE
VAAPI_HWCODECS
112
VAAPI_SUPPORTED
TRUE
VAAPI_HWCODECS
112

I checked the libstdc++.so.6 file for the CXXABI support and it has it:

$  strings /usr/lib64/libstdc++.so.6 | grep CXXABI
CXXABI_1.3
CXXABI_1.3.1
CXXABI_1.3.2
CXXABI_1.3.3
CXXABI_1.3.4
CXXABI_1.3.5
CXXABI_1.3.6
CXXABI_1.3.7
CXXABI_1.3.8
CXXABI_1.3.9
CXXABI_1.3.10
CXXABI_1.3.11
CXXABI_1.3.12
CXXABI_1.3.13
CXXABI_1.3.14
CXXABI_1.3.15
CXXABI_TM_1
CXXABI_FLOAT128

The one in the flatpak (coming from org.freedesktop.Platform) does not:

$ strings /var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/23.08/active/files/lib/x86_64-linux-gnu/libstdc++.so.6 | grep CXXABI
CXXABI_1.3
CXXABI_1.3.1
CXXABI_1.3.2
CXXABI_1.3.3
CXXABI_1.3.4
CXXABI_1.3.5
CXXABI_1.3.6
CXXABI_1.3.7
CXXABI_1.3.8
CXXABI_1.3.9
CXXABI_1.3.10
CXXABI_1.3.11
CXXABI_1.3.12
CXXABI_1.3.13
CXXABI_1.3.14
CXXABI_TM_1
CXXABI_FLOAT128

I think the problem is that the intel-media-driver package from RPMFusion is compiled against a newer libstdc++ while the flatpak platform ships an older one.

$ rpm-ostree status
State: idle
AutomaticUpdates: stage; rpm-ostreed-automatic.timer: last run 13h ago
Deployments:
● ostree-image-signed:docker://ghcr.io/ublue-os/bluefin-dx:latest
                   Digest: sha256:45125c748d736eae5c56cded559ae011669c100695a21d7fcc876a73e9fe1e96
                  Version: 40.20240618.0 (2024-06-18T22:58:32Z)
      RemovedBasePackages: opensc 0.25.0-1.fc40
          LayeredPackages: alacritty

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (5 by maintainers)

Most upvoted comments

Reopening since this is still affecting people.

Should we give this a tag “unable to confirm*” and close? What do we need to confirm root cause?