Chrome - wayland

Hey guys, It seems like another day of wayland shenanigans!

  1. Install chrome
  2. open chrome, everything is so small bcz of hidpi screen
  3. turn on wayland flag in chrome://flags
  4. suddenly chrome doesnt recognize gpu and falls back to software acceleration which is slow

chrome://gpu below

=======================
*   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
==============================

$google-chrome
terminal logs

(google-chrome:62426): Gtk-WARNING **: 19:25:25.554: Unknown key Settings in /home/nomad/.config/gtk-3.0/settings.ini
[62471:62471:1113/192525.860402:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2)
[62471:62471:1113/192525.860497:ERROR:gbm_pixmap_wayland.cc(82)] Cannot create bo with format= RGBA_8888 and usage=SCANOUT
[62471:62471:1113/192525.860625:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2)
[62471:62471:1113/192525.860674:ERROR:gbm_pixmap_wayland.cc(82)] Cannot create bo with format= RGBA_8888 and usage=GPU_READ
[62471:62471:1113/192525.860739:ERROR:shared_image_factory.cc(926)] CreateSharedImage: could not create backing.
[62471:62471:1113/192525.860783:ERROR:shared_image_factory.cc(758)] DestroySharedImage: Could not find shared image mailbox
[62471:62471:1113/192525.860866:ERROR:gpu_service_impl.cc(1089)] Exiting GPU process because some drivers can't recover from errors. GPU process will restart shortly.
[62426:62426:1113/192525.869808:ERROR:gpu_process_host.cc(990)] GPU process exited unexpectedly: exit_code=8704
[62527:10:1113/192525.874160:ERROR:command_buffer_proxy_impl.cc(127)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
[62640:62640:1113/192525.985450:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2)
[62640:62640:1113/192525.985527:ERROR:gbm_pixmap_wayland.cc(82)] Cannot create bo with format= RGBA_8888 and usage=SCANOUT
[62640:62640:1113/192525.985652:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2)
[62640:62640:1113/192525.985678:ERROR:gbm_pixmap_wayland.cc(82)] Cannot create bo with format= RGBA_8888 and usage=GPU_READ
[62640:62640:1113/192525.985708:ERROR:shared_image_factory.cc(926)] CreateSharedImage: could not create backing.
[62640:62640:1113/192525.985733:ERROR:shared_image_factory.cc(758)] DestroySharedImage: Could not find shared image mailbox
[62640:62640:1113/192525.985787:ERROR:gpu_service_impl.cc(1089)] Exiting GPU process because some drivers can't recover from errors. GPU process will restart shortly.
[62527:10:1113/192525.989526:ERROR:command_buffer_proxy_impl.cc(319)] GPU state invalid after WaitForGetOffsetInRange.
[62426:62426:1113/192525.990953:ERROR:gpu_process_host.cc(990)] GPU process exited unexpectedly: exit_code=8704
[62700:62700:1113/192526.107618:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2)
[62700:62700:1113/192526.107707:ERROR:gbm_pixmap_wayland.cc(82)] Cannot create bo with format= RGBA_8888 and usage=SCANOUT
[62700:62700:1113/192526.107832:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2)
[62700:62700:1113/192526.107870:ERROR:gbm_pixmap_wayland.cc(82)] Cannot create bo with format= RGBA_8888 and usage=GPU_READ
[62700:62700:1113/192526.107904:ERROR:shared_image_factory.cc(926)] CreateSharedImage: could not create backing.
[62700:62700:1113/192526.107935:ERROR:shared_image_factory.cc(758)] DestroySharedImage: Could not find shared image mailbox
[62700:62700:1113/192526.108021:ERROR:gpu_service_impl.cc(1089)] Exiting GPU process because some drivers can't recover from errors. GPU process will restart shortly.
[62527:10:1113/192526.112480:ERROR:command_buffer_proxy_impl.cc(319)] GPU state invalid after WaitForGetOffsetInRange.
[62426:62426:1113/192526.113928:ERROR:gpu_process_host.cc(990)] GPU process exited unexpectedly: exit_code=8704
[62527:10:1113/192526.196029:ERROR:command_buffer_proxy_impl.cc(127)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
[62730:62730:1113/192526.219959:ERROR:gl_utils.cc(402)] [.WebGL-0x2c3400296900]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels
[62730:62730:1113/192526.256630:ERROR:gl_utils.cc(402)] [.WebGL-0x2c3400296900]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels
[62730:62730:1113/192526.276365:ERROR:gl_utils.cc(402)] [.WebGL-0x2c3400296900]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels

if the flag is set to default there is no problem but i want it in wayland for better visibility.

any ideas?

Edit: there is no problems what so ever with firefox-wayland package but i prefer using chrome.

Interesting topic. I have no answer to it, but I am in the same situation. I just never cared to check I guess. I think it might be good to find out what is going on here though.

From my experience with electron-based apps, which depend on Chromium, in particular with Wayland in recent months was that I either had to force them to run in XWayland or pass the --disable-gpu flag to get them to run at all. Maybe there is an underlying issue with Chromium?

thinking about it when running on x11 this is my logs

note im running thorium browser here which is chrome browser the same would be in google chrome.

[93990:93990:1113/231857.731454:ERROR:policy_logger.cc(154)] :components/enterprise/browser/controller/chrome_browser_cloud_management_controller.cc(163) Cloud management controller initialization aborted as CBCM is not enabled.
MESA-LOADER: failed to open nvidia-drm: /nix/store/7wxw1dkd6pn6wd5zidd8096m6fknacrg-mesa-23.1.9/lib/gbm/nvidia-drm_gbm.so: cannot open shared object file: Permission denied (search paths /run/opengl-driver/lib/gbm:/nix/store/7wxw1dkd6pn6wd5zidd8096m6fknacrg-mesa-23.1.9/lib/gbm, suffix _gbm)
MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to open i915: /run/opengl-driver/lib/dri/i915_dri.so: cannot open shared object file: Permission denied (search paths /run/opengl-driver/lib/dri, suffix _dri)
MESA-LOADER: failed to open zink: /run/opengl-driver/lib/dri/zink_dri.so: cannot open shared object file: Permission denied (search paths /run/opengl-driver/lib/dri, suffix _dri)
MESA-LOADER: failed to open kms_swrast: /run/opengl-driver/lib/dri/kms_swrast_dri.so: cannot open shared object file: Permission denied (search paths /run/opengl-driver/lib/dri, suffix _dri)
MESA-LOADER: failed to open swrast: /run/opengl-driver/lib/dri/swrast_dri.so: cannot open shared object file: Permission denied (search paths /run/opengl-driver/lib/dri, suffix _dri)

When I am running Chromium on XWayland, I get this on the chrome:///gpu:

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
*   Skia Graphite: Disabled
*   Video Decode: Hardware accelerated
*   Video Encode: Software only. Hardware acceleration disabled
*   Vulkan: Disabled
*   WebGL: Hardware accelerated
*   WebGL2: Hardware accelerated
*   WebGPU: Disabled

however on Wayland I get this:

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

Also this doesnā€™t appear to be related to Chromium as such, Brave behaves the same way.

I found this fairly recent thread on the Arch Linux forum:

https://bbs.archlinux.org/viewtopic.php?id=289412

If the information there is correct, then getting Chromium to beta version 120 might be a possible way to a solution.

ehhh sad. nixpkgs beta is behind release :frowning: . guess firefox till then

I did not spot the beta directly? Can you link it?

its not available on unstable, NixOS Search

Yes, they dropped it due to lack of maintainer support:

I am using ChromeDev from flatpak, hardware acceleration seems to working in wayland

Using the ungoogled-chromium package on Wayland here, HW acceleration is working for me also.

Did you set Wayland flag in chrome://flags ? it doesnt work for me still. without the flag all works

Google just landed more/ better support for the Intel VA-API in Chrome

From what I understand this will only be helpful for folks in this thread using Intel GPUs (#me :wink: ), maybe others

Given chromium/google-chrome dev/beta is not available in nixpkgs Iā€™m not sure though what the way forward to an updated/ testing package is (other than waiting)?

Iā€™m seeing an error in the log of chrome based (ungoogled-chromium/ vivaldi) browsers:

DRI driver not from this Mesa build ('23.1.9' vs '23.3.3')
failed to bind extensions

Anyone has an idea ?

I had a bit of success today, although it takes this thread slightly off-topic :wink:
My ā€œChromeā€ is brave and so far I havenā€™t been able to reproduce my results with vivaldi, chrome Iā€™m not gonna test.

The good news: I got HW accel video working in brave, succesfully tested with

Setup:

  • nixpkgs-unstable a3ed740
  • Intel TigerLake-LP GT2 [Iris Xe Graphics] (11th gen) graphics card
  • Hyprland v0.37.1

My home-manager config section for brave

    programs.brave = {
      enable = true;
      commandLineArgs = [
        "--enable-features=VaapiVideoDecodeLinuxGL"
        "--use-gl=angle"
        "--use-angle=gl"
        "--ozone-platform=wayland"
      ];
    };

From chromium: hardware video acceleration with VA-API (Page 39) / Applications & Desktop Environments / Arch Linux Forums


Results can be verified either via

  • Developer tools, Media tab
  • chrome://media-internals

The latter one was helpful during the process since, it shows log entries for unavailable decoders, e.g:

00:00:00.936	info	"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"
00:00:00.936	info	"Cannot select DecryptingVideoDecoder for video decoding"
00:00:00.936	info	"Cannot select VaapiVideoDecoder for video decoding"
00:00:00.936	info	"Cannot select VpxVideoDecoder for video decoding"
00:00:00.936	info	"Cannot select Dav1dVideoDecoder for video decoding"
00:00:00.943	kIsVideoDecryptingDemuxerStream	false
00:00:00.943	kVideoDecoderName	"FFmpegVideoDecoder"

[UPDATE]
Vivaldi is a bit perplexing, the brave configuration above does not work, until I start this way

vivaldi --enable-features=VaapiVideoDecodeLinuxGL

:confounded:

At this point my best guess is that chrome CLI params are sensitive to orderingā€¦

Most of the troubleshooting testing for vivaldi was direct comparison of CLI flags from ps f output.


I hope these notes might prove helpful to others, good luck :crossed_fingers:

1 Like