Hi,
I have an amdgpu based laptop (zephyrus G14 2022) and I noticed that the hardware acceleration is not used when I watch video on youtube. I started to dig on the subject but I am facing a wall. Basically the browser reports that the hardware acceleration is active but if I take a look to the media tab in developer tools I see that the software renderer is used.
My setup is:
- NixOS (unstable channel)
- Vivaldi 5.6, Google Chrome stable 109, Chromium 109
- AMD iGPU Rembrandt [Radeon 680M]
- Wayland (Sway) with NIXOS_OZONE_WL env variable set
In my flake I have the following configuration:
hardware = {
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
extraPackages = with pkgs; [
amdvlk
];
};
};
When I start chromium with the command chromium --enable-features=VaapiVideoDecoder
and check the acceleration status in chrome://gpu
I can see this:
Graphics Feature Status
Canvas: Hardware accelerated
Canvas out-of-process rasterization: Disabled
Direct Rendering Display Compositor: Disabled
Compositing: Hardware accelerated
Multiple Raster Threads: Enabled
OpenGL: Enabled
Rasterization: Hardware accelerated
Raw Draw: Disabled
Video Decode: Hardware accelerated
Video Encode: Software only. Hardware acceleration disabled
Vulkan: Disabled
WebGL: Hardware accelerated
WebGL2: Hardware accelerated
WebGPU: Disabled
Driver Bug Workarounds
clear_uniforms_before_first_program_use
count_all_in_varyings_packing
enable_webgl_timer_query_extensions
exit_on_context_lost
disabled_extension_GL_KHR_blend_equation_advanced
disabled_extension_GL_KHR_blend_equation_advanced_coherent
Problems Detected
WebGPU has been disabled via blocklist or the command line.
Disabled Features: webgpu
Accelerated video encode has been disabled, either via blocklist, about:flags or the command line.
Disabled Features: video_encode
Clear uniforms before first program use on all platforms: 124764, 349137
Applied Workarounds: clear_uniforms_before_first_program_use
Mesa drivers in Linux handle varyings without static use incorrectly: 333885
Applied Workarounds: count_all_in_varyings_packing
Disable KHR_blend_equation_advanced until cc shaders are updated: 661715
Applied Workarounds: disable(GL_KHR_blend_equation_advanced), disable(GL_KHR_blend_equation_advanced_coherent)
Expose WebGL's disjoint_timer_query extensions on platforms with site isolation: 808744, 870491
Applied Workarounds: enable_webgl_timer_query_extensions
Some drivers can't recover after OUT_OF_MEM and context lost: 893177
Applied Workarounds: exit_on_context_lost
DAWN Info
<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
timestamp-query-inside-passes
depth-clip-control
depth32float-stencil8
indirect-first-instance
rg11b10ufloat-renderable
dawn-internal-usages
dawn-native
Version Information
Data exported
2023-02-04T15:21:18.888Z
Chrome version
Chrome/109.0.5414.74
Operating system
Linux 6.1.9
Software rendering list URL
https://chromium.googlesource.com/chromium/src/+/e7c5703604daa9cc128ccf5a5d3e993513758913/gpu/config/software_rendering_list.json
Driver bug list URL
https://chromium.googlesource.com/chromium/src/+/e7c5703604daa9cc128ccf5a5d3e993513758913/gpu/config/gpu_driver_bug_list.json
ANGLE commit id
unknown hash
2D graphics backend
Skia/109 9f5ce0f89e2ba479fdb57eebd13204bbed86922b
Command Line
/nix/store/gnh3z0k1z45pxaxdzn7agi44apsaymfy-chromium-unwrapped-109.0.5414.74/libexec/chromium/chromium --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-features=VaapiVideoDecoder --flag-switches-begin --flag-switches-end --ozone-platform=wayland
Driver Information
Initialization time
113
In-process GPU
false
Passthrough Command Decoder
false
Sandboxed
false
GPU0
VENDOR= 0x0000 [AMD], DEVICE=0x0000 [AMD Radeon Graphics (rembrandt, LLVM 15.0.7, DRM 3.49, 6.1.9)], DRIVER_VENDOR=Mesa, DRIVER_VERSION=22.3.4 *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
8
Machine model name
Machine model version
GL_VENDOR
AMD
GL_RENDERER
AMD Radeon Graphics (rembrandt, LLVM 15.0.7, DRM 3.49, 6.1.9)
GL_VERSION
OpenGL ES 3.2 Mesa 22.3.4
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_debug_label GL_EXT_sRGB_write_control GL_EXT_separate_shader_objects 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_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_context_flush_control GL_KHR_robust_buffer_access_behavior GL_NV_image_formats GL_NV_shader_noperspective_interpolation 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_EXT_texture_sRGB_RG8 GL_KHR_no_error GL_KHR_texture_compression_astc_sliced_3d 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_EXT_window_rectangles 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_NV_alpha_to_coverage_dither_control GL_AMD_framebuffer_multisample_advanced GL_EXT_EGL_image_storage 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
GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent
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_EXT_buffer_age EGL_EXT_create_context_robustness EGL_EXT_image_dma_buf_import EGL_EXT_image_dma_buf_import_modifiers EGL_EXT_present_opaque EGL_EXT_swap_buffers_with_damage EGL_IMG_context_priority EGL_KHR_cl_event2 EGL_KHR_config_attribs EGL_KHR_context_flush_control 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_base 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_WL_bind_wayland_display EGL_WL_create_wayland_buffer_from_image
XDG_CURRENT_DESKTOP
sway
XDG_SESSION_TYPE
wayland
Interfaces exposed by the Wayland compositor
wl_shm:1 wl_compositor:5 wl_subcompositor:1 wl_data_device_manager:3 zwlr_gamma_control_manager_v1:1 zxdg_output_manager_v1:3 org_kde_kwin_idle:1 ext_idle_notifier_v1:1 zwp_idle_inhibit_manager_v1:1 zwlr_layer_shell_v1:4 xdg_wm_base:2 zwp_tablet_manager_v2:1 org_kde_kwin_server_decoration_manager:1 zxdg_decoration_manager_v1:1 zwp_relative_pointer_manager_v1:1 zwp_pointer_constraints_v1:1 wp_presentation:1 zwlr_output_manager_v1:4 zwlr_output_power_manager_v1:1 zwp_input_method_manager_v2:1 zwp_text_input_manager_v3:1 zwlr_foreign_toplevel_manager_v1:3 ext_session_lock_manager_v1:1 wp_drm_lease_device_v1:1 zwlr_export_dmabuf_manager_v1:1 zwlr_screencopy_manager_v1:3 zwlr_data_control_manager_v1:2 zwp_primary_selection_device_manager_v1:1 wp_viewporter:1 wp_single_pixel_buffer_manager_v1:1 zxdg_exporter_v1:1 zxdg_importer_v1:1 zxdg_exporter_v2:1 zxdg_importer_v2:1 xdg_activation_v1:1 zwp_virtual_keyboard_manager_v1:1 zwlr_virtual_pointer_manager_v1:2 zwlr_input_inhibit_manager_v1:1 zwp_keyboard_shortcuts_inhibit_manager_v1:1 wl_seat:8 zwp_pointer_gestures_v1:3 wl_output:4 zwp_linux_dmabuf_v1:4 wl_drm:2
Ozone platform
wayland
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, YUVA_420_TRIPLANAR: not supported, P010: not supported
Compositor Information
Tile Update Mode
One-copy
Partial Raster
Enabled
GpuMemoryBuffers Status
R_8
CAMERA_AND_CPU_READ_WRITE, SCANOUT_CPU_READ_WRITE, SCANOUT_FRONT_RENDERING
R_16
Software only
RG_88
Software only
RG_1616
Software only
BGR_565
GPU_READ
RGBA_4444
Software only
RGBX_8888
GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, SCANOUT_FRONT_RENDERING
RGBA_8888
GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, SCANOUT_FRONT_RENDERING
BGRX_8888
GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, SCANOUT_FRONT_RENDERING
BGRA_1010102
SCANOUT, SCANOUT_CPU_READ_WRITE, SCANOUT_FRONT_RENDERING
RGBA_1010102
SCANOUT, SCANOUT_CPU_READ_WRITE, SCANOUT_FRONT_RENDERING
BGRA_8888
GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, SCANOUT_FRONT_RENDERING
RGBA_F16
Software only
YVU_420
GPU_READ, SCANOUT_VEA_CPU_READ, VEA_READ_CAMERA_AND_CPU_READ_WRITE
YUV_420_BIPLANAR
SCANOUT_CAMERA_READ_WRITE, SCANOUT_CPU_READ_WRITE, SCANOUT_VEA_CPU_READ, SCANOUT_FRONT_RENDERING, VEA_READ_CAMERA_AND_CPU_READ_WRITE
YUVA_420_TRIPLANAR
Software only
P010
Software only
Display(s) Information
Info
Display[44] bounds=[0,0 2048x1280], workarea=[0,0 2048x1280], scale=2, rotation=0, panel_rotation=0 external.
Color space (all)
{primaries:BT709, transfer:SRGB, matrix:RGB, range:FULL}
Buffer format (all)
RGBA_8888
Color volume
{name:'srgb', r:[0.6400, 0.3300], g:[0.3000, 0.6000], b:[0.1500, 0.3300], w:[0.3127, 0.3290]}
SDR white level in nits
203
HDR relative maximum luminance
1
Bits per color component
8
Bits per pixel
24
Video Acceleration Information
Decoding
Encoding
Vulkan Information
Device Performance Information
Log Messages
[27505:27505:0204/162115.050406:ERROR:gpu_init.cc(523)] : Passthrough is not supported, GL is egl, ANGLE is
[27505:27505:0204/162115.054568:WARNING:sandbox_linux.cc(385)] : InitializeSandbox() called with multiple threads in process gpu-process.
I get the following input in the terminal:
[27505:27505:0204/162115.050406:ERROR:gpu_init.cc(523)] Passthrough is not supported, GL is egl, ANGLE is
Warning: vkCreateInstance: Found no drivers!
Error: vkCreateInstance failed with VK_ERROR_INCOMPATIBLE_DRIVER
at CheckVkSuccessImpl (../../third_party/dawn/src/dawn/native/vulkan/VulkanError.cpp:88)
at CreateVkInstance (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:399)
at Initialize (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:285)
at Create (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:215)
at operator() (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:474)
vainfo is reporting:
Trying display: wayland
libva info: VA-API version 1.17.0
libva info: Trying to open /run/opengl-driver/lib/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_17
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.17 (libva 2.17.1)
vainfo: Driver version: Mesa Gallium driver 22.3.4 for AMD Radeon Graphics (rembrandt, LLVM 15.0.7, DRM 3.49, 6.1.9)
vainfo: Supported profile and entrypoints
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileHEVCMain : VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointEncSlice
VAProfileHEVCMain10 : VAEntrypointVLD
VAProfileHEVCMain10 : VAEntrypointEncSlice
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointVLD
VAProfileVP9Profile2 : VAEntrypointVLD
VAProfileAV1Profile0 : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
The video decoding is declared as enabled, however if I start a youtube video (https://www.youtube.com/watch?v=fOlGHwjHV-s) the media player (chrome://media-internals
) reports software decoding:
]
If I run google-chrome-stable I have the same result with software decoding but I get this in the terminal:
google-chrome-stable --enable-features=VaapiVideoDecoder
[25938:25938:0204/161841.838718:ERROR:gpu_init.cc(523)] Passthrough is not supported, GL is egl, ANGLE is
Warning: terminator_CreateInstance: Failed to CreateInstance in ICD 2. Skipping ICD.
Warning: terminator_CreateInstance: Failed to CreateInstance in ICD 4. Skipping ICD.
Warning: terminator_CreateInstance: Failed to CreateInstance in ICD 5. Skipping ICD.
X Error of failed request: BadAccess (attempt to access private resource denied)
Major opcode of failed request: 149 (GLX)
Minor opcode of failed request: 5 (X_GLXMakeCurrent)
Serial number of failed request: 32
Current serial number in output stream: 32
[25885:25885:0204/161849.026668:ERROR:gpu_process_host.cc(991)] GPU process exited unexpectedly: exit_code=256
[26202:26202:0204/161849.133973:ERROR:gpu_init.cc(523)] Passthrough is not supported, GL is egl, ANGLE is
Anybody knows what I shall do to get the hardware accelerated video decoding really active?