Chromium, Flatpak, AMD GPU, and VA-API

Hello, Arch Wiki suggests using the following flags to enable Vulkan and Wayland to enable VA-API[1] for AMD GPUs[2] on Chromium[3] from Mesa 24.1 onwards.

Native Wayland Support: --ozone-platform-hint=auto
Vulkan: --enable-features=VaapiVideoDecoder,VaapiIgnoreDriverChecks,Vulkan,DefaultANGLEVulkan,VulkanFromANGLE

  1. As it is, the developer tool and chrome://gpu have the following notes.
chrome://gpu
Graphics Feature Status
=======================
*   Canvas: Software only, hardware acceleration unavailable
*   Canvas out-of-process rasterization: Disabled
*   Direct Rendering Display Compositor: Disabled
*   Compositing: Software only. Hardware acceleration disabled
*   Multiple Raster Threads: Enabled
*   OpenGL: Disabled
*   Rasterization: Software only. Hardware acceleration disabled
*   Raw Draw: Disabled
*   Skia Graphite: Disabled
*   Video Decode: Software only. Hardware acceleration disabled
*   Video Encode: Software only. Hardware acceleration disabled
*   Vulkan: Disabled
*   WebGL: Software only, hardware acceleration unavailable
*   WebGL2: Software only, hardware acceleration unavailable
*   WebGPU: Disabled
*   WebNN: Disabled
Developer Tool/Media/Properties
Decoder name FFmpegVideoDecoder
Hardware decoder false
Developer Tool/Media/Mesages
ChunkDemuxer
Selected FFmpegAudioDecoder for audio decoding, config: codec: opus, profile: unknown, bytes_per_channel: 4, channel_layout: STEREO, channels: 2, samples_per_second: 48000, sample_format: Float 32-bit, bytes_per_frame: 8, seek_preroll: 80000us, codec_delay: 312, has extra data: true, encryption scheme: Unencrypted, discard decoder delay: true, target_output_channel_layout: STEREO, target_output_sample_format: Unknown sample format, has aac extra data: false
Cannot select DecryptingVideoDecoder for video decoding
Cannot select VpxVideoDecoder for video decoding
Cannot select Dav1dVideoDecoder for video decoding
Selected FFmpegVideoDecoder for video decoding, config: codec: h264, profile: h264 main, level: not available, alpha_mode: is_opaque, coded size: [854,480], visible rect: [0,0,854,480], natural size: [854,480], has extra data: false, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}
video decoder config changed midstream, new config: codec: h264, profile: h264 high, level: not available, alpha_mode: is_opaque, coded size: [1920,1080], visible rect: [0,0,1920,1080], natural size: [1920,1080], has extra data: false, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}
Selected FFmpegVideoDecoder for video decoding, config: codec: h264, profile: h264 high, level: not available, alpha_mode: is_opaque, coded size: [1920,1080], visible rect: [0,0,1920,1080], natural size: [1920,1080], has extra data: false, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}
Effective playback rate changed from 0 to 1
  1. With Wayland disabled, the following notes are also shown.
chrome://gpu
Graphics Feature Status
=======================
*   Canvas: Hardware accelerated
*   Canvas out-of-process rasterization: Enabled
*   Direct Rendering Display Compositor: Disabled
*   Compositing: Hardware accelerated
*   Multiple Raster Threads: Enabled
*   OpenGL: Enabled
*   Rasterization: Hardware accelerated
*   Raw Draw: Disabled
*   Skia Graphite: Disabled
*   Video Decode: Hardware accelerated
*   Video Encode: Software only. Hardware acceleration disabled
*   Vulkan: Enabled
*   WebGL: Hardware accelerated
*   WebGL2: Hardware accelerated
*   WebGPU: Disabled
*   WebNN: Disabled
Developer Tool/Media/Properties
Decoder name FFmpegVideoDecoder
Hardware decoder false
Developer Tool/Media/Mesages
ChunkDemuxer
Selected FFmpegAudioDecoder for audio decoding, config: codec: opus, profile: unknown, bytes_per_channel: 4, channel_layout: STEREO, channels: 2, samples_per_second: 48000, sample_format: Float 32-bit, bytes_per_frame: 8, seek_preroll: 80000us, codec_delay: 312, has extra data: true, encryption scheme: Unencrypted, discard decoder delay: true, target_output_channel_layout: STEREO, target_output_sample_format: Unknown sample format, has aac extra data: false
Cannot select DecryptingVideoDecoder for video decoding
VideoDecoderPipeline |decoder_| Initialize() successful
Selected VaapiVideoDecoder for video decoding, config: codec: h264, profile: h264 main, level: not available, alpha_mode: is_opaque, coded size: [854,480], visible rect: [0,0,854,480], natural size: [854,480], has extra data: false, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}
video decoder config changed midstream, new config: codec: h264, profile: h264 main, level: not available, alpha_mode: is_opaque, coded size: [1280,720], visible rect: [0,0,1280,720], natural size: [1280,720], has extra data: false, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}
VideoDecoderPipeline |decoder_| Initialize() successful
Selected VaapiVideoDecoder for video decoding, config: codec: h264, profile: h264 main, level: not available, alpha_mode: is_opaque, coded size: [1280,720], visible rect: [0,0,1280,720], natural size: [1280,720], has extra data: false, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}
VideoDecoderPipeline Frame converter returns null frame.
VideoDecoderPipeline Frame converter returns null frame.
video decoder fallback after initial decode error.
VideoDecoderPipeline Frame converter returns null frame.
Cannot select DecryptingVideoDecoder for video decoding
Cannot select Unknown Video Decoder for video decoding
Cannot select VpxVideoDecoder for video decoding
Cannot select Dav1dVideoDecoder for video decoding
VideoDecoderPipeline Frame converter returns null frame.
Selected FFmpegVideoDecoder for video decoding, config: codec: h264, profile: h264 main, level: not available, alpha_mode: is_opaque, coded size: [1280,720], visible rect: [0,0,1280,720], natural size: [1280,720], has extra data: false, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}
VideoDecoderPipeline Frame converter returns null frame.
video decoder config changed midstream, new config: codec: h264, profile: h264 high, level: not available, alpha_mode: is_opaque, coded size: [1920,1080], visible rect: [0,0,1920,1080], natural size: [1920,1080], has extra data: false, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}
Selected FFmpegVideoDecoder for video decoding, config: codec: h264, profile: h264 high, level: not available, alpha_mode: is_opaque, coded size: [1920,1080], visible rect: [0,0,1920,1080], natural size: [1920,1080], has extra data: false, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}
Effective playback rate changed from 0 to 1

Is VA-API enabled in either of these two scenarios?

I can see that I can enable VA-API on Firefox (Flatpak) by following the method on the wiki (MOZ_LOG=“FFmpegVideo:5”).
[RDD 313: MediaPDecoder #1]: D/FFmpegVideo FFMPEG: VA-API Got one frame output with pts=20016666 dts=20016666 duration=16666

I’am a Kinoite user.


  1. AVC, HEVC ↩︎

  2. Polaris/UVD 6.3 ↩︎

  3. 126.0.6478.114, Flatpak ↩︎

1 Like

I dealt with that a bit

--ozone-platform-hint=auto

This should be set by default. Setting it to wayland will enforce it.

there also is an environment variable, in the wayland arch wiki page too

I only use Electron apps. Do you use Chromium Flatpak?

1 Like

Actually, if I’m sure I can enable VA-API, I’ll apply the same configuration to the Electron apps I’m using. Since Electron versions of those apps vary, it made more sense to try to enable VA-API on the latest Chromium Browser (Flatpak).

If you mean LIBVA_DRI3_DISABLE=1 environment variable, that doesn’t seem to work either.

Wasn’t Chapeau a Fedora fork distro back in the day :thinking: Sorry for the side tangent.

Back on topic, Do you have all the HW enabled tools install? just a question.

:man_shrugging:t3:

If you can tell me which tools and packages I need to check in particular, I can share the required information.

I know that the Flatpak apps should have the required things installed for VA-API. I have a default Kinoite installation, I haven’t layered any additional packages. GPU drivers and modules shouldn’t be a problem either.

1 Like

No.

ELECTRON_OZONE_PLATFORM_HINT=auto #or wayland APPNAME

But that only works for Electron I guess? Chromium should default to Wayland, even ChromeOS runs on Wayland

Oh I see now, sorry :sweat_smile: I can run Chromium Browser with --ozone-platform-hint=auto flag, but unfortunately using nvtop I was able confirm that VA-API is not enabled in both scenarios.

1 Like

Look at secureblue they did that months ago

1 Like

I found a bug report that I think is similar to the one I posted here, where I read a comment that, if I understood it correctly, it could be a problem with Chromium.

There is a bug report on Chromium. If I understand correctly, it says that a patch has been released starting with version 127.0.6508.0 of Chromium that enables video decoding by activating Wayland and Vulkan.

1 Like