brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.82k stars 2.33k forks source link

Brave crashes in wayland manjaro while using ozone flags #22419

Open hackingguy opened 2 years ago

hackingguy commented 2 years ago

Description

Brave crashes when using in wayland session, it works fine without ozone flags but not able to see brave ads in that case(even custom notifications aren't working). When Ozone flag is used, brave shows following logs and doesn't launch.

[4922:4922:0420/181127.476631:ERROR:gpu_init.cc(446)] Passthrough is not supported, GL is egl, ANGLE is 
[4922:4922:0420/181127.480550:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
[4881:4881:0420/181127.733926:ERROR:cursor_loader.cc(116)] Failed to load a platform cursor of type kNull
[4922:4922:0420/181128.555319:ERROR:gl_surface_egl.cc(808)] EGL Driver message (Critical) eglCreateImageKHR: dri2_create_image_khr_texture
[4922:4922:0420/181128.555486:ERROR:gl_image_egl.cc(38)] Error creating EGLImage: EGL_BAD_ALLOC
[4922:4922:0420/181128.555736:ERROR:gpu_memory_buffer_factory_native_pixmap.cc(205)] Failed to create GLImage 4x4, RGBA_8888, usage SCANOUT
[4922:4922:0420/181128.556055:ERROR:gl_surface_egl.cc(808)] EGL Driver message (Critical) eglCreateImageKHR: dri2_create_image_khr_texture
[4922:4922:0420/181128.556167:ERROR:gl_image_egl.cc(38)] Error creating EGLImage: EGL_BAD_ALLOC
[4922:4922:0420/181128.556305:ERROR:gpu_memory_buffer_factory_native_pixmap.cc(205)] Failed to create GLImage 4x4, RGBA_8888, usage GPU_READ
[4922:4922:0420/181128.556403:ERROR:shared_image_backing_factory_gl_image.cc(359)] CreateSharedImage: Failed to create bindable image
[4922:4922:0420/181128.556484:ERROR:shared_image_factory.cc(607)] CreateSharedImage: could not create backing.
[4881:4881:0420/181128.564378:ERROR:wayland_event_watcher.cc(25)] libwayland: [destroyed object]: error 7: failed to import supplied dmabufs: EGL failed to allocate resources for the requested operation.

[0420/181128.592208:ERROR:file_io_posix.cc(152)] open /home/akash/.config/BraveSoftware/Brave-Browser/Crash Reports/pending/14f5e21e-32b1-4699-92bb-8808736a752d.lock: File exists (17)
[0420/181128.604142:ERROR:elf_dynamic_array_reader.h(64)] tag not found
[0420/181128.617278:ERROR:file_io_posix.cc(152)] open /home/akash/.config/BraveSoftware/Brave-Browser/Crash Reports/pending/14f5e21e-32b1-4699-92bb-8808736a752d.lock: File exists (17)

Steps to Reproduce

Start brave with --enable-features=UseOzonePlatform and --ozone-platform=wayland flag.

Command: brave --enable-features=UseOzonePlatform --ozone-platform=wayland

Actual result:

Brave crashes showing above logs

Expected result:

Brave should launch with wayland session

Reproduces how often:

Brave never launches when I use these flags, if I use default session, Unable to see brave ads.

Desktop Brave version:

brave version: 1.37.116 (latest) Window Manager: Wayland DE: GNOME 41.1 OS: Manjaro 21.1.2pre

Version/Channel Information:

Miscellaneous Information:

I am able to use it using --disable-gpu flag, but its a useless flag as I cannot use hardware accerlation without GPU, so please provide any better workaround.

MatthewScholefield commented 2 years ago

I also have the same problem when trying to launch vscode (which uses chromium) natively in a wayland session. The --disable-gpu also fixes the issue for me. I am also running on Manjaro GNOME and I have a dual-AMD laptop (ROG Zephyrus G14). @hackingguy What GPU do you have?