nouveau prevents hardware acceleration with Chromium (Wayland)
Description
Hardware acceleration in Chromium (Wayland) with crocus stopped working in a hybrid-GPU setup (crocus + nouveau) after a Chromium change. Other Chromium-based apps (such as Element) no longer load.
nouveau is not actually expected to be used to drive rendering in this case, but Chromium enumerates all DRM devices for its GBM implementation, and its GPU process appears to exit if any fatal issue is encountered in any device. This results in either fallback to software rendering or non-functional applications.
The following errors are seen when running Chromium or Chromium-based apps:
Chromium errors (click to expand)
$ flatpak run org.chromium.Chromium
[2:2:0812/131952.292149:ERROR:chrome_browser_cloud_management_controller.cc(162)] Cloud management controller initialization aborted as CBCM is not enabled.
[49:49:0812/131952.784136:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2)
[49:49:0812/131952.784548:ERROR:gbm_pixmap_wayland.cc(75)] Cannot create bo with format= RGBA_8888 and usage=SCANOUT
[49:49:0812/131952.787526:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2)
[49:49:0812/131952.787840:ERROR:gbm_pixmap_wayland.cc(75)] Cannot create bo with format= RGBA_8888 and usage=GPU_READ
[49:49:0812/131952.788019:ERROR:shared_image_factory.cc(725)] CreateSharedImage: could not create backing.
[49:49:0812/131952.788189:ERROR:shared_image_factory.cc(579)] DestroySharedImage: Could not find shared image mailbox
[49:49:0812/131952.788919:ERROR:gpu_service_impl.cc(1008)] Exiting GPU process because some drivers can't recover from errors. GPU process will restart shortly.
[2:2:0812/131952.834800:ERROR:gpu_process_host.cc(952)] GPU process exited unexpectedly: exit_code=8704
[144:144:0812/131952.996124:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2)
[144:144:0812/131952.996338:ERROR:gbm_pixmap_wayland.cc(75)] Cannot create bo with format= RGBA_8888 and usage=SCANOUT
[144:144:0812/131952.998881:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2)
[144:144:0812/131952.999046:ERROR:gbm_pixmap_wayland.cc(75)] Cannot create bo with format= RGBA_8888 and usage=GPU_READ
[144:144:0812/131952.999185:ERROR:shared_image_factory.cc(725)] CreateSharedImage: could not create backing.
[144:144:0812/131952.999248:ERROR:shared_image_factory.cc(579)] DestroySharedImage: Could not find shared image mailbox
[144:144:0812/131952.999495:ERROR:gpu_service_impl.cc(1008)] Exiting GPU process because some drivers can't recover from errors. GPU process will restart shortly.
[2:2:0812/131953.060164:ERROR:gpu_process_host.cc(952)] GPU process exited unexpectedly: exit_code=8704
[103:24:0812/131953.100952:ERROR:command_buffer_proxy_impl.cc(128)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
[156:156:0812/131953.264301:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2)
[156:156:0812/131953.264474:ERROR:gbm_pixmap_wayland.cc(75)] Cannot create bo with format= RGBA_8888 and usage=SCANOUT
[156:156:0812/131953.266360:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2)
[156:156:0812/131953.266462:ERROR:gbm_pixmap_wayland.cc(75)] Cannot create bo with format= RGBA_8888 and usage=GPU_READ
[156:156:0812/131953.266527:ERROR:shared_image_factory.cc(725)] CreateSharedImage: could not create backing.
[156:156:0812/131953.266650:ERROR:shared_image_factory.cc(579)] DestroySharedImage: Could not find shared image mailbox
[156:156:0812/131953.266770:ERROR:gpu_service_impl.cc(1008)] Exiting GPU process because some drivers can't recover from errors. GPU process will restart shortly.
[103:24:0812/131953.271698:ERROR:command_buffer_proxy_impl.cc(325)] GPU state invalid after WaitForGetOffsetInRange.
[2:2:0812/131953.319717:ERROR:gpu_process_host.cc(952)] GPU process exited unexpectedly: exit_code=8704
[87:22:0812/131953.403288:ERROR:command_buffer_proxy_impl.cc(128)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
[133:49:0812/131954.938367:ERROR:command_buffer_proxy_impl.cc(128)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
A minimal reproducer of the issue is available here: https://gitlab.gnome.org/-/snippets/5989
Minimal reproducer output (click to expand)
$ flatpak run --device=dri --devel --filesystem=home org.freedesktop.Sdk
[📦 org.freedesktop.Sdk ~]$ gcc -g -isystem /usr/include/libdrm -ldrm -lgbm nouveau_gbm_bug.c -o nouveau_gbm_bug
[📦 org.freedesktop.Sdk ~]$ ./nouveau_gbm_bug
Started iteration 0
Finished iteration 0
Started iteration 1
nouveau_gbm_bug: drmPrimeHandleToFD: No such file or directory
Regression?
Technically not a Mesa regression.
The issue was exposed with this upstream Chromium change: https://chromium-review.googlesource.com/c/chromium/src/+/4380766
System information
inxi -GSC -xx
output (click to expand)System:
Kernel: 6.4.9-arch1-1 arch: x86_64 bits: 64 compiler: gcc
v: 13.2.1 Desktop: GNOME v: 44.3 tk: GTK v: 3.24.38 wm: gnome-shell dm: GDM
Distro: Arch Linux
CPU:
Info: quad core model: Intel Core i7-4700HQ bits: 64 type: MT MCP
arch: Haswell rev: 3 cache: L1: 256 KiB L2: 1024 KiB L3: 6 MiB
Speed (MHz): avg: 924 high: 1302 min/max: 800/3400 cores: 1: 800 2: 800
3: 1302 4: 800 5: 800 6: 800 7: 1293 8: 800 bogomips: 38334
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
Device-1: Intel 4th Gen Core Processor Integrated Graphics vendor: ASUSTeK
driver: i915 v: kernel arch: Gen-7.5 ports: active: eDP-1
empty: DP-1,HDMI-A-1,HDMI-A-2 bus-ID: 00:02.0 chip-ID: 8086:0416
Device-2: NVIDIA GK107M [GeForce GT 750M] vendor: ASUSTeK driver: nouveau
v: kernel arch: Kepler pcie: speed: 2.5 GT/s lanes: 16 bus-ID: 01:00.0
chip-ID: 10de:0fe4 temp: 41.0 C
Device-3: Chicony HD WebCam (Asus N-series) driver: uvcvideo type: USB
rev: 2.0 speed: 480 Mb/s lanes: 1 bus-ID: 3-7:13 chip-ID: 04f2:b3fd
Display: wayland server: X.org v: 1.21.1.8 with: Xwayland v: 23.1.2
compositor: gnome-shell driver: X: loaded: N/A alternate: nouveau gpu: i915
display-ID: 0
Monitor-1: eDP-1 model: Samsung 0x324c res: 1920x1080 dpi: 142
diag: 395mm (15.5")
API: OpenGL v: 4.6 Mesa 23.1.5 renderer: Mesa Intel HD Graphics 4600 (HSW
GT2) direct-render: Yes