brave / brave-browser

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

Ozone platform Wayland causes 1 minute startup delay #39816

Open CarloCattano opened 4 months ago

CarloCattano commented 4 months ago

Description

when using brave-browser-nightly --enable-features=UseOzonePlatform -ozone-platform=wayland Brave takes at last +50 seconds to start. Here is an example log of what happens during startup, and some additional bug on restore.

brave-browser-nightly --enable-features=UseOzonePlatform -ozone-platform=wayland
[40758:40758:0717/105521.352387: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 or interface org.freedesktop.ScreenSaver.
[40758:40778:0717/105522.240051:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.DBus.StartServiceByName: object_path= /org/freedesktop/DBus: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

[40758:40758:0717/105551.437317:ERROR:gpu_process_host.cc(1007)] GPU process exited unexpectedly: exit_code=512

[40758:40758:0717/105621.690315:ERROR:gpu_process_host.cc(1007)] GPU process exited unexpectedly: exit_code=512

# 1 minute later ..
# it opens

Even on mouse move in the restored page DOM produces numerous logs like this one ad infinitum:

[41608:41636:0717/105729.028663:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mail
[41608:41636:0717/105729.028728:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox.
[41608:41636:0717/105729.028792:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox.
[41608:416

When the restored tabs appear, chances are they are going to get obscured by mysterious dark rectangles and behave strangely with the console spamming the mentioned shared image manager errors. the only way out is to copy the restored tab url into a fresh new tab.

Steps to reproduce

  1. launch brave with the use ozone flags and wayland
  2. wait 50+ seconds

Actual result

  1. brave shows up with broken restored tabs mostly (graphical glitches)

Expected result

A reasonably fast startup

Reproduces how often

Easily reproduced

Brave version (brave://version info)

1.69.111 Chromium: 127.0.6533.43 (Official Build) nightly (64-bit)

Channel information

Reproducibility

Miscellaneous information

Linux arch 6.9.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 12 Jul 2024 00:06:53 +0000 x86_64 GNU/Linux

CarloCattano commented 4 months ago

Video of the graphical glitch when brave finally kicks in after 1min

https://github.com/user-attachments/assets/720bcc21-3779-49dc-9b28-71e93559a059

Angxddeep commented 4 months ago

I am having the same issue on Brave rpm version on the stable build. On my Pc it doesn't even open up and keeps lagging, and the laptop fans starts to spin fast, I got the same cursor behaviour that is in your video. For the time being I am using flatpak version. I also think it doesn't matter on which distro you are previously I was using AUR version in arch and there the browser open up instantly, but sometimes I could notice this cursor thing for a second, even in the flatpak version I had that cursor thing on first launch after enabling -ozone-platform=Wayland, but it was only for 2–3 seconds. At this point, I don't know what's causing it

Angxddeep commented 4 months ago

So I tried opening brave through terminal and I got these errors

nvc0_screen_create:1078 - Error allocating PGRAPH context for M2MF: -16
[3336:3343:0723/185955.421820:ERROR:ssl_client_socket_impl.cc(878)] handshake failed; returned -1, SSL error code 1, net_error -100
[3336:3343:0723/185955.483815:ERROR:ssl_client_socket_impl.cc(878)] handshake failed; returned -1, SSL error code 1, net_error -100
[3224:3224:0723/190002.127393:ERROR:sharing_service.cc(221)] Device registration failed with fatal error
[3336:3343:0723/190007.280401:ERROR:ssl_client_socket_impl.cc(878)] handshake failed; returned -1, SSL error code 1, net_error -107
[3336:3343:0723/190017.713344:ERROR:ssl_client_socket_impl.cc(878)] handshake failed; returned -1, SSL error code 1, net_error -100
[3224:3224:0723/190042.601636:ERROR:gpu_process_host.cc(1002)] GPU process exited unexpectedly: exit_code=512
[3224:3224:0723/190133.747002:ERROR:gpu_process_host.cc(1002)] GPU process exited unexpectedly: exit_code=512
[3224:3224:0723/190220.876949:ERROR:gpu_process_host.cc(1002)] GPU process exited unexpectedly: exit_code=512

after this I tried opening brave flatpak version through terminal it shows these errors and then opens up

[2:2:0723/191240.418064:ERROR:sharing_service.cc(221)] Device registration failed with fatal error
[62:80:0723/191242.583181:ERROR:ssl_client_socket_impl.cc(878)] handshake failed; returned -1, SSL error code 1, net_error -100
[62:80:0723/191242.590536:ERROR:ssl_client_socket_impl.cc(878)] handshake failed; returned -1, SSL error code 1, net_error -100
Angxddeep commented 4 months ago

So I got the fix just install nvidia proprietary drivers that all it needs :)

CarloCattano commented 4 months ago

I use proprietary drivers already, but in a laptop with intel integrated card

Angxddeep commented 4 months ago

Oh, I think we are having very similar issue, but mine got fixed after installing the proprietary driver I also have an intel i5 and a mx350 nvidia card. As I said in arch I never had this issue because I always used the proprietary NVIDIA driver there and on fedora it installs the nouveau driver by default, so I thought of installing the proprietary drivers and rebooted and that fixed it. I also asked GPT about it, and it said to disable vulkan in brave, and it worked in the flatpak version with nouveau drivers installed

CarloCattano commented 4 months ago

No vulkan installed on my side, Always used closed drivers , currently at nvidia 555.58.02-8

danielkrysiak commented 1 week ago

Workaround: disable Wayland in brave://flags.