Summary: | On Wayland, NVIDIA GPU with open kernel modules gets better FPS with triple buffering on | ||
---|---|---|---|
Product: | [Plasma] kwin | Reporter: | patchouli <patchouli.knowledge.uwu> |
Component: | performance | Assignee: | KWin default assignee <kwin-bugs-null> |
Status: | RESOLVED UPSTREAM | ||
Severity: | normal | CC: | nate, patchouli.knowledge.uwu, xaver.hugl |
Priority: | NOR | ||
Version First Reported In: | 6.2.2 | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | kwin perf statistics DP-1.csv |
Description
patchouli
2024-10-23 18:52:30 UTC
I followed an advice I got on Reddit and used `git bisect` to find the offending commit, and it seems to have been this one: b3358350b67b39ecea8fd4234df4ad8c0fa99017 is the first bad commit commit b3358350b67b39ecea8fd4234df4ad8c0fa99017 Author: Xaver Hugl <xaver.hugl@gmail.com> Date: Sat Oct 12 20:14:16 2024 +0000 backends/drm: disable triple buffering on NVidia by default There's some unresolved glitches on multi gpu systems. Until that's taken care of, triple buffering is disabled by default on NVidia unless the environment variable KWIN_DRM_DISABLE_TRIPLE_BUFFERING=0 is set BUG: 494547 BUG: 494407 (cherry picked from commit 0133431c1d4b8a07ff5027df7f59928382562b38) Co-authored-by: Xaver Hugl <xaver.hugl@gmail.com> src/backends/drm/drm_output.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) Just to make sure, if you put KWIN_DRM_DISABLE_TRIPLE_BUFFERING=0 into /etc/environment and reboot, the issue is also gone in 6.2.2? (In reply to Zamundaaa from comment #2) > Just to make sure, if you put KWIN_DRM_DISABLE_TRIPLE_BUFFERING=0 into > /etc/environment and reboot, the issue is also gone in 6.2.2? Yes, my KWin performance is significantly better if I set the environment variable to 0. Sorry for the double-comment, it's my first time using the bug tracker and I don't see the ability to edit. I wanted to mention that I have a single monitor (plugged in to my NVIDIA GPU) and a single GPU. I disabled my on-board graphics entirely. So I don't think the commit shouldn't have applied to me at all because I'm not even a multi-GPU user. Okay. That's pretty weird, you shouldn't need triple buffering with a dedicated GPU. Please set the KWIN_LOG_PERFORMANCE_DATA=1 environment variable; after a reboot KWin will dump a .csv file with some performance data into your home directory. If you attach that here after a few minutes of usage where the problem occurs, maybe it's possible to figure out why frames get dropped. Created attachment 175570 [details]
kwin perf statistics DP-1.csv
kwin perf statistics DP-1.csv after 6-7 minutes of playing a game and experiencing the KWin performance issue.
After some extra tinkering I found the following: - Plasma on X11 does not have the issue. - Going from the open kernel modules NVIDIA drivers to the closed kernel modules (`nvidia-open` to `nvidia` on Arch Linux) and disabling the GSP firmware fixes the issue - Other Wayland compositors (Hyprland and GNOME) do not have the issue either, even with the GSP firmware enabled and while using the open kernel modules. So for some reason, KWin (Wayland) works very poorly with this enabled and other compositors do not suffer from the same issue. The GPU scores identically (within margin of error) on benchmarks with either the open kernel modules, or the closed ones with the GSP firmware disabled on various OpenGL benchmarks. - Triple buffering also exhibits the issue, just on a much lower frequency and not to the same degree. I read on the implementation and it’s supposed to increase the performance for lower end hardware; and my RTX 4090 is somehow also affected by that too. > Going from the open kernel modules NVIDIA drivers to the closed kernel modules (`nvidia-open` to `nvidia` on Arch Linux) and disabling the GSP firmware fixes the issue
Then this is one of the GSP issues that are well known. It has to be resolved on the driver side.
|