You are not logged in.

#1 2022-08-26 19:32:49

ExoDoom
Member
Registered: 2013-11-01
Posts: 35

[SOLVED] Hardware accelerated video decoding in Chrome/Chromium

Hi folks,

I'm trying to set up video decoding acceleration on chromium, with no success. Laptop is a LG GRAM with an Intel TigerLake-LP GT2 iRIS XE card. I'm using modesetting driver (no xf86-video-intel installed) and intel-media-driver for VA-API. Hardware accelerated video decoding is working on mpv (I see the video bar going up in intel_gpu_top), so I guess it should work on chromium too. LIBVA_DRIVER_NAME is set to iHD, and vainfo seems legit:

$ vainfo                                                                         
vainfo: VA-API version: 1.15 (libva 2.15.0)                                                    
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 22.4.4 ()
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
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointFEI
      VAProfileHEVCMain               : VAEntrypointEncSliceLP
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointEncSliceLP
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointEncSliceLP
      VAProfileVP9Profile1            : VAEntrypointVLD
      VAProfileVP9Profile1            : VAEntrypointEncSliceLP
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointEncSliceLP
      VAProfileVP9Profile3            : VAEntrypointVLD
      VAProfileVP9Profile3            : VAEntrypointEncSliceLP

This is my ~/.config/chromium-flags.conf:

--disable-features=UseChromeOSDirectVideoDecoder
--disable-gpu-driver-bug-workarounds
--disk-cache-dir=/tmp/chrome-cache/exodoom
--enable-accelerated-2d-canvas
--enable-accelerated-video-decode
--enable-features=CanvasOopRasterization,VaapiVideoDecoder,VaapiVideoEncoder
--enable-gpu-rasterization
--enable-native-gpu-memory-buffers
--enable-oop-rasterization
--enable-raw-draw
--enable-system-notifications
--enable-zero-copy
--ignore-gpu-blocklist
--use-gl=egl

And chrome://gpu looks like this:

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 on all pages
Raw Draw: Disabled
Video Decode: Hardware accelerated
Video Encode: Hardware accelerated
Vulkan: Disabled
WebGL: Hardware accelerated
WebGL2: Hardware accelerated
WebGPU: Disabled
Problems Detected
WebGPU has been disabled via blocklist or the command line.
Disabled Features: webgpu
DAWN Info

<Integrated GPU> Vulkan backend - Intel(R) Xe Graphics (TGL GT2)
[Default Toggle Names]
lazy_clear_resource_on_first_use: https://crbug.com/dawn/145: Clears resource to zero on first usage. This initializes the resource so that no dirty bits from recycled memory is present in the new resource.
use_temporary_buffer_in_texture_to_texture_copy: https://crbug.com/dawn/42: Split texture-to-texture copy into two copies: copy from source texture into a temporary buffer, and copy from the temporary buffer into the destination texture when copying between compressed textures that don't have block-aligned sizes. This workaround is enabled by default on all Vulkan drivers to solve an issue in the Vulkan SPEC about the texture-to-texture copies with compressed formats. See #1005 (https://github.com/KhronosGroup/Vulkan-Docs/issues/1005) for more details.
vulkan_use_d32s8: https://crbug.com/dawn/286: Vulkan mandates support of either D32_FLOAT_S8 or D24_UNORM_S8. When available the backend will use D32S8 (toggle to on) but setting the toggle to off will make it use the D24S8 format when possible.
vulkan_use_s8: https://crbug.com/dawn/666: Vulkan has a pure stencil8 format but it is not universally available. When this toggle is on, the backend will use S8 for the stencil8 format, otherwise it will fallback to D32S8 or D24S8.
disallow_unsafe_apis: http://crbug.com/1138528: Produces validation errors on API entry points or parameter combinations that aren't considered secure yet.
use_vulkan_zero_initialize_workgroup_memory_extension: https://crbug.com/dawn/1302: Initialize workgroup memory with OpConstantNull on Vulkan when the Vulkan extension VK_KHR_zero_initialize_workgroup_memory is supported.
[WebGPU Forced Toggles - enabled]
disallow_spirv: https://crbug.com/1214923: Disallow usage of SPIR-V completely so that only WGSL is used for shader modules. This is useful to prevent a Chromium renderer process from successfully sending SPIR-V code to be compiled in the GPU process.
[Supported Features]
texture-compression-bc
texture-compression-etc2
texture-compression-astc
pipeline-statistics-query
timestamp-query
depth-clamping
depth24unorm-stencil8
depth32float-stencil8
chromium-experimental-dp4a
indirect-first-instance
dawn-internal-usages
dawn-native

<CPU> Vulkan backend - SwiftShader Device (Subzero)
[Default Toggle Names]
lazy_clear_resource_on_first_use: https://crbug.com/dawn/145: Clears resource to zero on first usage. This initializes the resource so that no dirty bits from recycled memory is present in the new resource.
use_temporary_buffer_in_texture_to_texture_copy: https://crbug.com/dawn/42: Split texture-to-texture copy into two copies: copy from source texture into a temporary buffer, and copy from the temporary buffer into the destination texture when copying between compressed textures that don't have block-aligned sizes. This workaround is enabled by default on all Vulkan drivers to solve an issue in the Vulkan SPEC about the texture-to-texture copies with compressed formats. See #1005 (https://github.com/KhronosGroup/Vulkan-Docs/issues/1005) for more details.
vulkan_use_d32s8: https://crbug.com/dawn/286: Vulkan mandates support of either D32_FLOAT_S8 or D24_UNORM_S8. When available the backend will use D32S8 (toggle to on) but setting the toggle to off will make it use the D24S8 format when possible.
vulkan_use_s8: https://crbug.com/dawn/666: Vulkan has a pure stencil8 format but it is not universally available. When this toggle is on, the backend will use S8 for the stencil8 format, otherwise it will fallback to D32S8 or D24S8.
disallow_unsafe_apis: http://crbug.com/1138528: Produces validation errors on API entry points or parameter combinations that aren't considered secure yet.
use_vulkan_zero_initialize_workgroup_memory_extension: https://crbug.com/dawn/1302: Initialize workgroup memory with OpConstantNull on Vulkan when the Vulkan extension VK_KHR_zero_initialize_workgroup_memory is supported.
[WebGPU Forced Toggles - enabled]
disallow_spirv: https://crbug.com/1214923: Disallow usage of SPIR-V completely so that only WGSL is used for shader modules. This is useful to prevent a Chromium renderer process from successfully sending SPIR-V code to be compiled in the GPU process.
[Supported Features]
texture-compression-bc
texture-compression-etc2
texture-compression-astc
timestamp-query
depth-clamping
depth32float-stencil8
indirect-first-instance
dawn-internal-usages
dawn-native
Version Information
Data exported
2022-08-26T19:29:06.124Z
Chrome version
Chrome/104.0.5112.101
Operating system
Linux 5.19.3-arch1-1
Software rendering list URL
https://chromium.googlesource.com/chromium/src/+/0a2e5078088fc9f9a29247aaa40af9e7ada8b79f/gpu/config/software_rendering_list.json
Driver bug list URL
https://chromium.googlesource.com/chromium/src/+/0a2e5078088fc9f9a29247aaa40af9e7ada8b79f/gpu/config/gpu_driver_bug_list.json
ANGLE commit id
4a65a669e11b
2D graphics backend
Skia/104 5a4dbb2e97302f7e574f0ba962ac4d8b3a62a36e
Command Line
/opt/google/chrome/google-chrome --disable-features=UseChromeOSDirectVideoDecoder --disable-gpu-driver-bug-workarounds --disk-cache-dir=/tmp/chrome-cache/joseluis --enable-accelerated-2d-canvas --enable-accelerated-video-decode --enable-features=CanvasOopRasterization,VaapiVideoDecoder,VaapiVideoEncoder --enable-gpu-rasterization --enable-native-gpu-memory-buffers --enable-oop-rasterization --enable-raw-draw --enable-system-notifications --enable-zero-copy --ignore-gpu-blocklist --use-gl=egl --enable-crashpad --enable-features=CanvasOopRasterization,VaapiVideoDecoder,VaapiVideoEncoder --disable-features=UseChromeOSDirectVideoDecoder --flag-switches-begin --flag-switches-end --desktop-startup-id=tint2/|usr|bin|google-chrome-stable /673-3-gram_TIME1046524
Driver Information
Initialization time
32
In-process GPU
false
Passthrough Command Decoder
false
Sandboxed
false
GPU0
VENDOR= 0x8086 [Intel], DEVICE=0x9a49 [Mesa Intel(R) Xe Graphics (TGL GT2)], DRIVER_VENDOR=Mesa, DRIVER_VERSION=22.1.6 *ACTIVE*
Optimus
false
AMD switchable
false
GPU CUDA compute capability major version
0
Pixel shader version
3.20
Vertex shader version
3.20
Max. MSAA samples
16
Machine model name
Machine model version
GL_VENDOR
Intel
GL_RENDERER
Mesa Intel(R) Xe Graphics (TGL GT2)
GL_VERSION
OpenGL ES 3.2 Mesa 22.1.6
GL_EXTENSIONS
GL_EXT_blend_minmax GL_EXT_multi_draw_arrays GL_EXT_texture_filter_anisotropic GL_EXT_texture_compression_s3tc GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_rgtc GL_EXT_texture_format_BGRA8888 GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth24 GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_mapbuffer GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_stencil8 GL_OES_texture_3D GL_OES_texture_float GL_OES_texture_float_linear GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_vertex_half_float GL_EXT_draw_instanced GL_EXT_texture_sRGB_decode GL_OES_EGL_image GL_OES_depth_texture GL_AMD_performance_monitor GL_OES_packed_depth_stencil GL_EXT_texture_type_2_10_10_10_REV GL_NV_conditional_render GL_OES_get_program_binary GL_APPLE_texture_max_level GL_EXT_discard_framebuffer GL_EXT_read_format_bgra GL_NV_pack_subimage GL_EXT_frag_depth GL_NV_fbo_color_attachments GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_vertex_array_object GL_OES_viewport_array GL_ANGLE_pack_reverse_row_order GL_ANGLE_texture_compression_dxt3 GL_ANGLE_texture_compression_dxt5 GL_EXT_occlusion_query_boolean GL_EXT_robustness GL_EXT_texture_rg GL_EXT_unpack_subimage GL_NV_draw_buffers GL_NV_read_buffer GL_NV_read_depth GL_NV_read_depth_stencil GL_NV_read_stencil GL_EXT_draw_buffers GL_EXT_map_buffer_range GL_KHR_debug GL_KHR_robustness GL_KHR_texture_compression_astc_ldr GL_NV_pixel_buffer_object GL_OES_depth_texture_cube_map GL_OES_required_internalformat GL_OES_surfaceless_context GL_EXT_color_buffer_float GL_EXT_sRGB_write_control GL_EXT_separate_shader_objects GL_EXT_shader_framebuffer_fetch GL_EXT_shader_group_vote GL_EXT_shader_implicit_conversions GL_EXT_shader_integer_mix GL_EXT_tessellation_point_size GL_EXT_tessellation_shader GL_INTEL_conservative_rasterization GL_INTEL_performance_query GL_ANDROID_extension_pack_es31a GL_EXT_base_instance GL_EXT_compressed_ETC1_RGB8_sub_texture GL_EXT_copy_image GL_EXT_draw_buffers_indexed GL_EXT_draw_elements_base_vertex GL_EXT_gpu_shader5 GL_EXT_polygon_offset_clamp GL_EXT_primitive_bounding_box GL_EXT_render_snorm GL_EXT_shader_io_blocks GL_EXT_texture_border_clamp GL_EXT_texture_buffer GL_EXT_texture_cube_map_array GL_EXT_texture_norm16 GL_EXT_texture_view GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_KHR_context_flush_control GL_KHR_robust_buffer_access_behavior GL_NV_image_formats GL_OES_copy_image GL_OES_draw_buffers_indexed GL_OES_draw_elements_base_vertex GL_OES_gpu_shader5 GL_OES_primitive_bounding_box GL_OES_sample_shading GL_OES_sample_variables GL_OES_shader_io_blocks GL_OES_shader_multisample_interpolation GL_OES_tessellation_point_size GL_OES_tessellation_shader GL_OES_texture_border_clamp GL_OES_texture_buffer GL_OES_texture_cube_map_array GL_OES_texture_stencil8 GL_OES_texture_storage_multisample_2d_array GL_OES_texture_view GL_EXT_blend_func_extended GL_EXT_buffer_storage GL_EXT_float_blend GL_EXT_geometry_point_size GL_EXT_geometry_shader GL_EXT_shader_samples_identical GL_EXT_texture_sRGB_R8 GL_KHR_no_error GL_KHR_texture_compression_astc_sliced_3d GL_NV_fragment_shader_interlock GL_OES_EGL_image_external_essl3 GL_OES_geometry_point_size GL_OES_geometry_shader GL_OES_shader_image_atomic GL_EXT_clear_texture GL_EXT_clip_cull_distance GL_EXT_disjoint_timer_query GL_EXT_texture_compression_s3tc_srgb GL_MESA_shader_integer_functions GL_EXT_clip_control GL_EXT_color_buffer_half_float GL_EXT_memory_object GL_EXT_memory_object_fd GL_EXT_semaphore GL_EXT_semaphore_fd GL_EXT_texture_compression_bptc GL_EXT_texture_mirror_clamp_to_edge GL_KHR_parallel_shader_compile GL_EXT_EGL_image_storage GL_EXT_shader_framebuffer_fetch_non_coherent GL_EXT_texture_shadow_lod GL_INTEL_blackhole_render GL_MESA_framebuffer_flip_y GL_NV_compute_shader_derivatives GL_EXT_demote_to_helper_invocation GL_EXT_depth_clamp GL_EXT_texture_query_lod GL_MESA_bgra
Disabled Extensions
Disabled WebGL Extensions
Window system binding vendor
Mesa Project
Window system binding version
1.5
Window system binding extensions
EGL_ANDROID_blob_cache EGL_ANDROID_native_fence_sync EGL_CHROMIUM_sync_control EGL_EXT_buffer_age EGL_EXT_create_context_robustness EGL_EXT_image_dma_buf_import EGL_EXT_image_dma_buf_import_modifiers EGL_EXT_swap_buffers_with_damage EGL_IMG_context_priority EGL_KHR_cl_event2 EGL_KHR_config_attribs EGL_KHR_create_context EGL_KHR_create_context_no_error EGL_KHR_fence_sync EGL_KHR_get_all_proc_addresses EGL_KHR_gl_colorspace EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_3D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_no_config_context EGL_KHR_reusable_sync EGL_KHR_surfaceless_context EGL_KHR_swap_buffers_with_damage EGL_EXT_pixel_format_float EGL_KHR_wait_sync EGL_MESA_configless_context EGL_MESA_drm_image EGL_MESA_image_dma_buf_export EGL_MESA_query_driver EGL_NOK_texture_from_pixmap EGL_WL_bind_wayland_display
XDG_SESSION_TYPE
x11
GDMSESSION
openbox
Ozone platform
x11
Direct rendering version
unknown
Reset notification strategy
0x8252
GPU process crash count
0
gfx::BufferFormats supported for allocation and texturing
R_8: not supported, R_16: not supported, RG_88: not supported, RG_1616: not supported, BGR_565: not supported, RGBA_4444: not supported, RGBX_8888: not supported, RGBA_8888: not supported, BGRX_8888: not supported, BGRA_1010102: not supported, RGBA_1010102: not supported, BGRA_8888: not supported, RGBA_F16: not supported, YVU_420: not supported, YUV_420_BIPLANAR: not supported, P010: not supported
Compositor Information
Tile Update Mode
Zero-copy
Partial Raster
Enabled
GpuMemoryBuffers Status
R_8
GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, SCANOUT_VDA_WRITE, GPU_READ_CPU_READ_WRITE
R_16
Software only
RG_88
GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, SCANOUT_VDA_WRITE, GPU_READ_CPU_READ_WRITE
RG_1616
Software only
BGR_565
GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, SCANOUT_VDA_WRITE, GPU_READ_CPU_READ_WRITE
RGBA_4444
Software only
RGBX_8888
GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, SCANOUT_VDA_WRITE, GPU_READ_CPU_READ_WRITE
RGBA_8888
GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, SCANOUT_VDA_WRITE, GPU_READ_CPU_READ_WRITE
BGRX_8888
GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, SCANOUT_VDA_WRITE, GPU_READ_CPU_READ_WRITE
BGRA_1010102
GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, SCANOUT_VDA_WRITE, GPU_READ_CPU_READ_WRITE
RGBA_1010102
Software only
BGRA_8888
GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, SCANOUT_VDA_WRITE, GPU_READ_CPU_READ_WRITE
RGBA_F16
Software only
YVU_420
Software only
YUV_420_BIPLANAR
Software only
P010
Software only
Display(s) Information
Info
Display[66] bounds=[0,0 1920x1080], workarea=[0,0 1920x1044], scale=1, rotation=0, panel_rotation=0 internal.
Color space (all)
{primaries:BT709, transfer:SRGB, matrix:RGB, range:FULL}
Buffer format (all)
BGRA_8888
SDR white level in nits
203
HDR relative maximum luminance
1
Bits per color component
8
Bits per pixel
24
Refresh Rate in Hz
59
Video Acceleration Information
Decoding
Decode h264 baseline
16x16 to 4096x4096 pixels
Decode h264 main
16x16 to 4096x4096 pixels
Decode h264 high
16x16 to 4096x4096 pixels
Decode vp8
16x16 to 4096x4096 pixels
Decode vp9 profile0
16x16 to 16384x16384 pixels
Encoding
Encode h264 baseline
321x241 to 4096x4096 pixels, and/or 30.000 fps
Encode h264 main
321x241 to 4096x4096 pixels, and/or 30.000 fps
Encode h264 high
321x241 to 4096x4096 pixels, and/or 30.000 fps
Encode vp9 profile0
321x241 to 8192x8192 pixels, and/or 30.000 fps
Encode vp9 profile2
321x241 to 8192x8192 pixels, and/or 30.000 fps
Vulkan Information
Device Performance Information
Log Messages
[5190:5190:0826/195825.664077:ERROR:gpu_init.cc(486)] : Passthrough is not supported, GL is egl, ANGLE is
[5190:5190:0826/195825.668600:WARNING:sandbox_linux.cc(376)] : InitializeSandbox() called with multiple threads in process gpu-process.

I'm making tests with the video in this page: https://www.pexels.com/video/waves-rush … re-1409899
If I download the video and play it on mpv, it gets hardware accelerated. If I play the video either on chromium or google chrome, it doesn't get accelerated.

Any ideas?

Thanks in advance.

Last edited by ExoDoom (2022-08-27 12:17:02)

Offline

#2 2022-08-26 20:05:03

seth
Member
Registered: 2012-09-03
Posts: 51,731

Re: [SOLVED] Hardware accelerated video decoding in Chrome/Chromium

Offline

#3 2022-08-27 12:16:32

ExoDoom
Member
Registered: 2013-11-01
Posts: 35

Re: [SOLVED] Hardware accelerated video decoding in Chrome/Chromium

Hi folks,

I saw that thread but didn't manage to completely read it :-D

Anyways, I did manage to enable hardware accelerated video decoding, just had to uninstall package vulkan-intel (don't know why I installed it in the first place).

Thank you all guys, you rock!

Offline

#4 2024-03-13 14:45:27

0BADC0DE
Member
From: Regnum Utriusque Siciliae
Registered: 2018-02-21
Posts: 270

Re: [SOLVED] Hardware accelerated video decoding in Chrome/Chromium

Are you really really sure you have got HW-accelerated decoding in chromium-based browsers?

Is "sudo intel_gpu_top" showing any non-zero  usage in the column labelled "Video" (4th from left) at the lines labelled like "chromium" or "chrome"  while watching any video in the browser?
Which video?

I am asking (and reviving this thread) because I see no way to.


Maybe Computers Will Never Become As Intelligent
As Humans. Surely They Won't Ever Become So Stupid.

Offline

Board footer

Powered by FluxBB