Bug 439987

Summary: Chromium bad performance on Wayland
Product: [Plasma] kwin Reporter: Ondřej Niesner <ondra.niesner>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED UPSTREAM    
Severity: normal CC: ctj9512, joshuataylorx, kde.podagric, nate, xaver.hugl, xpdmk
Priority: NOR    
Version First Reported In: 5.24.5   
Target Milestone: ---   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Chromium SIGBUS error

Description Ondřej Niesner 2021-07-17 22:49:03 UTC
SUMMARY
Launching chromium or any chromium based application with "--enable-features=UseOzonePlatform --ozone-platform=wayland" I got very poor performance on KDE Wayland. Chromium does not match monitors refresh rate and FPS is very low around 48-58 fps. On GNOME Chromium is beautifully smooth. I tried run Chromium both on KDE, GNOME on OpenSUSE, Manjaro. Chromium was always laggy on KDE, smooth on GNOME.

STEPS TO REPRODUCE
1. Launch chromium with native Wayland support "--enable-features=UseOzonePlatform --ozone-platform=wayland"


EXPECTED RESULT
Gain performance by running Chromium on native Wayland support.


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Manjaro
(available in About System)
KDE Plasma Version: 5.22.3
KDE Frameworks Version: 5.84.0
Qt Version: 5.15.2
Comment 1 Vlad Zahorodnii 2021-07-19 08:14:57 UTC
Can you please check if changing the latency policy (in system settings) to "prefer smoothest animations" fixes the issue?
Comment 2 Ondřej Niesner 2021-07-19 13:22:32 UTC
Created attachment 140187 [details]
Chromium SIGBUS error
Comment 3 Ondřej Niesner 2021-07-19 13:22:49 UTC
(In reply to Vlad Zahorodnii from comment #1)
> Can you please check if changing the latency policy (in system settings) to
> "prefer smoothest animations" fixes the issue?

Nothing changed. Also I got some SIGBUS errors in Chromium.
Comment 4 Ondřej Niesner 2021-07-28 00:16:13 UTC
(In reply to Vlad Zahorodnii from comment #1)
> Can you please check if changing the latency policy (in system settings) to
> "prefer smoothest animations" fixes the issue?

Running Firefox on Wayland will match my monitor refresh rate (144 hz) on GNOME 40 and KDE Plasma 5.22.3.
https://webglsamples.org/aquarium/aquarium.html I get stable 144 fps.

Running Chrome on Wayland will not match my monitor refresh rate and I got around 55 fps on https://webglsamples.org/aquarium/aquarium.html not even stable 60

This does not happen on GNOME 40.

Log from Chrome:
[27275:27275:0728/020403.343050:ERROR:cursor_loader.cc(107)] Failed to load a platform cursor of type kNull
[27316:27316:0728/020403.368223:ERROR:gpu_init.cc(440)] Passthrough is not supported, GL is egl
[27316:27316:0728/020403.371236:ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process.
[27316:27316:0728/020436.766161:ERROR:gles2_cmd_decoder.cc(8216)] [.WebGL-0xe023ba22100]GL ERROR :GL_INVALID_OPERATION : glClear: can't be called on integer buffers
[27316:27316:0728/020437.059872:ERROR:gles2_cmd_decoder.cc(10718)] [.WebGL-0xe023ba22100]RENDER WARNING: there is no texture bound to the unit 1
[27316:27316:0728/020437.104605:ERROR:gles2_cmd_decoder.cc(8216)] [.WebGL-0xe023ba22100]GL ERROR :GL_INVALID_OPERATION : glClear: can't be called on integer buffers
[27316:27316:0728/020437.106266:ERROR:gles2_cmd_decoder.cc(10738)] [.WebGL-0xe023ba22100]GL ERROR :GL_INVALID_OPERATION : glDrawArrays: Texture bound to texture unit 1 with internal format GL_RG32UI is not compatible with sampler type GL_SAMPLER_2D


Can I provide some additional information?
Comment 5 ctj9512 2022-05-07 19:43:15 UTC
I am experiencing the same issue. 

KWin 5.24.5

Version 101.0.4951.54 (Official Build) (64-bit)
Comment 6 Zamundaaa 2022-05-07 20:13:24 UTC
It's possible that supporting explicit sync and/or presentation timing could resolve some of the issues, but ultimately it's a chromium bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1310539
Comment 7 ctj9512 2022-05-29 16:51:36 UTC
Is there a specific reason why this issue does not occur on GNOME?
Comment 8 Josh Taylor 2022-10-17 10:43:17 UTC
Chrome for an example works at both 144hz/165hz with a Wayland compositor such as Wayfire or Sway.

This however seems capped at 58-60fps on Plasma under Wayland.

My monitor has a feature to check the current framerate, and it shows 144hz/165hz (I tested both HDMI (max is 144hz for my monitor) Displayport (max is 165hz for my monitor) for the desktop. glxgears shows the correct framerate as well.

I have a `Navi 10 Radeon RX 5600XT` graphics card, tried both Mesa 22.2.1 and mesa-git (c1cb7506bb39843384b5b6114cd8690a38655ef3, latest as of Monday, 17 October 2022).