Bug 475542 - plasma 6 wayland nvidia: Keyboard input is very laggy in Electron apps
Summary: plasma 6 wayland nvidia: Keyboard input is very laggy in Electron apps
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: input (show other bugs)
Version: master
Platform: Arch Linux Linux
: NOR major
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: qt6, wayland
Depends on:
Blocks:
 
Reported: 2023-10-12 23:35 UTC by Jean-Francois Roy
Modified: 2023-10-25 16:22 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Francois Roy 2023-10-12 23:35:25 UTC
SUMMARY

In Electron apps, all of them running in XWayland in a wayland plasma 6 session, with an nvidia GPU, keyboard input is very laggy. I don't know if it's input processing or painting or refresh.

STEPS TO REPRODUCE

- On Arch Linux, install Discord or Slack with system electron (which is electron 25 at the time of writing), and type. Input will be very laggy.

OBSERVED RESULT

Laggy keyboard input.

EXPECTED RESULT

Normal keyboard input performance. Native wayland applications like Konsole are not affected.

SOFTWARE/OS VERSIONS

Operating System: Arch Linux 
KDE Plasma Version: 5.27.80
KDE Frameworks Version: 5.240.0
Qt Version: 6.6.0
Kernel Version: 6.5.7-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 32 × AMD Ryzen 9 7950X3D 16-Core Processor
Memory: 62.5 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 4090/PCIe/SSE2
Nvidia: 535.113.01

ADDITIONAL INFORMATION

No abnormal journal log or CPU activity. System is otherwise idle.
Comment 1 Nate Graham 2023-10-13 20:32:49 UTC
Is this reproducible in Plasma 5 as well for you? Or only in Plasma 6?
Comment 2 Jean-Francois Roy 2023-10-13 20:44:28 UTC
Only plasma 6. Does not repro in plasma 5 on the exact same system.
Comment 3 Nate Graham 2023-10-13 20:45:59 UTC
Thanks.
Comment 4 Jean-Francois Roy 2023-10-24 17:39:33 UTC
I've made a video recording of Element (desktop electron version) in plasma 5 and plasma 6 on the exact same system. It shows the issue pretty well, especially with audio to hear the keyboard keys. From the video, it seems plasma 6 is delaying buffer swaps or swapping the wrong buffer.

Plasma 5: https://drive.google.com/file/d/16zjCf5JwWq7yHWCKCgbUXV8zYQ69wX_c/view?usp=sharing
Plasma 6: https://drive.google.com/file/d/1Vkcy7VQGg1OOY-uBSUEJEKn1yHLybx7U/view?usp=sharing
Comment 5 Zamundaaa 2023-10-25 16:07:37 UTC
This is a NVidia driver bug, it's missing implicit synchronization (you can follow progress on that at https://gitlab.freedesktop.org/xorg/xserver/-/issues/1317 if you want). The fact that you see it in Plasma 6 and not Plasma 5 is because the issue is effectively a race condition, changes in timings (which we've introduced some time ago) or GPU load can cause the issue to appear or disappear.
Comment 6 Jean-Francois Roy 2023-10-25 16:22:09 UTC
I've been following the xwayland nvidia situation (both that bug and the patch to add explicit sync to xwayland https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/967). I filed this report because the difference between 5 and 6 was so pronounced.