NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18k stars 14.02k forks source link

Chromium applications have EGL errors and graphical glitches when using Ozone Wayland #334175

Open mora-unie-youer opened 2 months ago

mora-unie-youer commented 2 months ago

Describe the bug

If you start any chromium-based application (I checked on Google Chrome, Vesktop, Obsidian) in Ozone Wayland (either by using NIXOS_OZONE_WL=1 or --ozone-platform=wayland, there are graphical glitches (or window doesn't even open) and EGL errors:

Logs example (google-chrome-stable) ``` [116956:116956:0812/183726.717458:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.ScreenSaver.GetActive: object_path= /org/freedesktop/ScreenSaver: org.freedesktop.DBus.Error.UnknownMethod: Unknown method 'GetActive' [117005:117005:0812/183726.794612:ERROR:angle_platform_impl.cc(44)] ImageEGL.cpp:112 (operator()): eglCreateImage failed with 0x00003009 ERR: ImageEGL.cpp:112 (operator()): eglCreateImage failed with 0x00003009 [117005:117005:0812/183726.794687:ERROR:scoped_egl_image.cc(23)] Failed to create EGLImage: EGL_SUCCESS [117005:117005:0812/183726.794745:ERROR:native_pixmap_egl_binding.cc(113)] Unable to initialize binding from pixmap [117005:117005:0812/183726.794803:ERROR:ozone_image_backing.cc(330)] OzoneImageBacking::ProduceSkiaGanesh failed to create GL representation [117005:117005:0812/183726.794845:ERROR:shared_image_manager.cc(230)] SharedImageManager::ProduceSkia: Trying to produce a Skia representation from an incompatible backing: OzoneImageBacking [117005:117005:0812/183726.794942:ERROR:gpu_service_impl.cc(1147)] Exiting GPU process because some drivers can't recover from errors. GPU process will restart shortly. [116956:116956:0812/183726.803042:ERROR:gpu_process_host.cc(1007)] GPU process exited unexpectedly: exit_code=8704 [117185:117185:0812/183726.948714:ERROR:angle_platform_impl.cc(44)] ImageEGL.cpp:112 (operator()): eglCreateImage failed with 0x00003009 ERR: ImageEGL.cpp:112 (operator()): eglCreateImage failed with 0x00003009 [117185:117185:0812/183726.948798:ERROR:scoped_egl_image.cc(23)] Failed to create EGLImage: EGL_SUCCESS [117185:117185:0812/183726.948845:ERROR:native_pixmap_egl_binding.cc(113)] Unable to initialize binding from pixmap [117185:117185:0812/183726.948896:ERROR:ozone_image_backing.cc(330)] OzoneImageBacking::ProduceSkiaGanesh failed to create GL representation [117185:117185:0812/183726.948936:ERROR:shared_image_manager.cc(230)] SharedImageManager::ProduceSkia: Trying to produce a Skia representation from an incompatible backing: OzoneImageBacking [117185:117185:0812/183726.949010:ERROR:gpu_service_impl.cc(1147)] Exiting GPU process because some drivers can't recover from errors. GPU process will restart shortly. [116956:116956:0812/183726.956573:ERROR:gpu_process_host.cc(1007)] GPU process exited unexpectedly: exit_code=8704 [117446:117446:0812/183727.086903:ERROR:angle_platform_impl.cc(44)] ImageEGL.cpp:112 (operator()): eglCreateImage failed with 0x00003009 ERR: ImageEGL.cpp:112 (operator()): eglCreateImage failed with 0x00003009 [117446:117446:0812/183727.086987:ERROR:scoped_egl_image.cc(23)] Failed to create EGLImage: EGL_SUCCESS [117446:117446:0812/183727.087028:ERROR:native_pixmap_egl_binding.cc(113)] Unable to initialize binding from pixmap [117446:117446:0812/183727.087086:ERROR:ozone_image_backing.cc(330)] OzoneImageBacking::ProduceSkiaGanesh failed to create GL representation [117446:117446:0812/183727.087135:ERROR:shared_image_manager.cc(230)] SharedImageManager::ProduceSkia: Trying to produce a Skia representation from an incompatible backing: OzoneImageBacking [117446:117446:0812/183727.087219:ERROR:gpu_service_impl.cc(1147)] Exiting GPU process because some drivers can't recover from errors. GPU process will restart shortly. [116956:116956:0812/183727.093362:ERROR:gpu_process_host.cc(1007)] GPU process exited unexpectedly: exit_code=8704 [117036:7:0812/183727.189787:ERROR:command_buffer_proxy_impl.cc(132)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer. [117508:117551:0812/183727.302535:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117508:117551:0812/183727.320393:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117508:117551:0812/183727.371925:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117508:117551:0812/183727.706827:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117006:117025:0812/183728.355969:ERROR:ssl_client_socket_impl.cc(883)] handshake failed; returned -1, SSL error code 1, net_error -101 [117006:117025:0812/183728.392390:ERROR:ssl_client_socket_impl.cc(883)] handshake failed; returned -1, SSL error code 1, net_error -101 [117508:117551:0812/183730.063478:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117508:117551:0812/183730.073298:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117508:117551:0812/183730.086576:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117508:117551:0812/183730.103175:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117508:117551:0812/183730.119778:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117508:117551:0812/183730.137938:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117508:117551:0812/183730.172416:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117508:117551:0812/183730.220508:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. Created TensorFlow Lite XNNPACK delegate for CPU. [117508:117551:0812/183730.272125:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117508:117551:0812/183730.324535:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117508:117551:0812/183730.348823:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117508:117551:0812/183730.425629:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117508:117551:0812/183730.437956:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117508:117551:0812/183730.500315:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117006:117025:0812/183730.565057:ERROR:ssl_client_socket_impl.cc(883)] handshake failed; returned -1, SSL error code 1, net_error -101 [117006:117025:0812/183730.603047:ERROR:ssl_client_socket_impl.cc(883)] handshake failed; returned -1, SSL error code 1, net_error -101 [117508:117551:0812/183730.614058:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117508:117551:0812/183730.702636:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117508:117551:0812/183730.718682:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117508:117551:0812/183730.784706:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117508:117551:0812/183730.882475:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117508:117551:0812/183730.886351:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117508:117551:0812/183731.002927:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117508:117551:0812/183731.019737:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117508:117551:0812/183731.133659:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117508:117551:0812/183731.136774:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117508:117551:0812/183731.220774:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117508:117551:0812/183731.235861:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117508:117551:0812/183731.292309:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117508:117551:0812/183731.302281:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117508:117551:0812/183731.473342:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox. [117006:117025:0812/183731.511034:ERROR:ssl_client_socket_impl.cc(883)] handshake failed; returned -1, SSL error code 1, net_error -101 [117006:117025:0812/183731.552618:ERROR:ssl_client_socket_impl.cc(883)] handshake failed; returned -1, SSL error code 1, net_error -101 Warning: eglChooseConfig returned zero configs at Create (../../third_party/dawn/src/dawn/native/opengl/ContextEGL.cpp:62) [117006:117025:0812/183733.724013:ERROR:ssl_client_socket_impl.cc(883)] handshake failed; returned -1, SSL error code 1, net_error -101 [117006:117025:0812/183733.764582:ERROR:ssl_client_socket_impl.cc(883)] handshake failed; returned -1, SSL error code 1, net_error -101 ```

Steps To Reproduce

Steps to reproduce the behavior:

  1. Open any Chromium-based application in Wayland mode 1.1. Use NIXOS_OZONE_WL=1 environment variable 1.2. Use --ozone-platform=wayland argument to application

Expected behavior

There are no EGL errors and no graphical glitches in application.

Screenshots

chrome://gpu in Wayland mode

chrome://gpu in Wayland mode

chrome://gpu in X11 mode

chrome://gpu in X11 mode

Photo of graphical glitch (nothing is seen on screenshot)

Photo of graphical glitch

Additional context

I can surely say this is regression, as I didn't have this issues earlier (they appeared about month ago). Also I need to mention that chrome://gpu shows many disabled/unavailable features in Wayland mode. If you start in X11 mode - everything is fine.

Yesterday I installed ArchLinux and there are no such issues... Today I even tried to rewrite my NixOS config to fix this, but it didn't helped.

In my setup I have 3 GPUs: RX 5700XT (primary), Ryzen 5700G and Intel Arc A380.

This is also my graphics extraPackages, if this is useful:

  hardware.graphics.extraPackages = with pkgs; [
    intel-media-driver
    intel-ocl
    intel-vaapi-driver
    rocmPackages.clr.icd
  ];

Notify maintainers

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.10.3-cachyos, NixOS, 24.11 (Vicuna), 24.11.20240809.5e0ca22`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.5`
 - nixpkgs: `/nix/store/0jr2kk95c34c0b6yxi75q4fqgb43kqkm-source`

Add a :+1: reaction to issues you find important.

kira-bruneau commented 2 months ago

It looks like a slightly different issue, but I wonder if it's related to https://github.com/NixOS/nixpkgs/issues/332512.

I'm not seeing any EGL errors with #332512 though.

mora-unie-youer commented 2 months ago

Today I installed NixOS from scratch again, and now on nixos-unstable everything works fine... So I close the issue as that's not an issue now.

mora-unie-youer commented 2 months ago

Unfortunately, issue is still here... So issue seems to disappear, when I reboot from another system (for example NixOS installation media). Maybe there's some bug with video drivers I guess...

mora-unie-youer commented 2 months ago

The only difference I can see from other systems (ArchLinux, NixOS installation media) from my setup, is that GPUs are ordered differently in /dev/dri.

In Arch I had:

In my NixOS setup I have:

mora-unie-youer commented 2 months ago

Just rebooted my NixOS (added some driver packages like vdpau), and GPU order became like in Arch, and now I don't have any errors again... Pretty strange issue

mora-unie-youer commented 2 months ago

I guess now Chromium uses my Intel Arc for rendering, just because it is first in /dev/dri, and that solves the issue... image

mora-unie-youer commented 2 months ago

It seems that even when my AMD GPU is first in /dev/dri, Intel GPU is active in Chromium (and for some reason I can't force this, flags do not work with --ozone-platform=wayland). But when Chromium in X11 mode, RX 5700 XT is active and everything is fine.

So, how I can reproduce my error:

  1. RX 5700 XT must be first GPU in /dev/dri
  2. Start Chromium (in my case I use google-chrome for testing) with --ozone-platform=wayland
  3. Intel GPU is active instead of AMD GPU, and there's a lot of EGL errors with graphical glitches