Bug 475468 - On X11 with NVIDIA GPU, window and panel resizing is very laggy when any panels are set to Floating or Adapting transparency
Summary: On X11 with NVIDIA GPU, window and panel resizing is very laggy when any pane...
Status: ASSIGNED
Alias: None
Product: kwin
Classification: Plasma
Component: performance (show other bugs)
Version: git master
Platform: Other Linux
: HI normal
Target Milestone: ---
Assignee: ratijas
URL:
Keywords: regression
: 482100 482193 482717 483015 485254 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-10-11 14:12 UTC by ratijas
Modified: 2024-05-04 11:33 UTC (History)
17 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 ratijas 2023-10-11 14:12:36 UTC
SUMMARY

The lag and jitter during panel floating and defloating has gotten much worse recently. Not sure whether to attribute it to panels refactoring or a random NVIDIA driver update. The lag makes fullscreen effects such Desktop Grid and Overview open practically without animation; everything is a slideshow running in seconds per frame when a panel or window resizes.

Note that in case or maximizing a window in a way that does not involve panel (de-)floating (say, horizontally with a bottom panel) only skips first couple of frames due to a window being resized only once, and then simply cross-fading inside compositing.

STEPS TO REPRODUCE
1. Run Plasma 6 on X11 with NVIDIA
2. Set panels floating to auto.
3. Move windows around, touching panels borders, so they float/defloat; add virtual desktops, have a window that touches a panel on one of them, the other is empty, and Slide between them.

OBSERVED RESULT
LL..aaag  g   gggggg

EXPECTED RESULT
No lag

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.27.80
KDE Frameworks Version: 5.240.0
Qt Version: 6.5.3
Kernel Version: 6.5.5-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-6700HQ CPU @ 2.60GHz
Memory: 15.6 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 970M/PCIe/SSE2

ADDITIONAL INFORMATION

Screen recording on YouTube: https://www.youtube.com/watch?v=uDtBd3sOm5I
Comment 1 Nate Graham 2023-10-12 20:50:50 UTC
Is it just floating panels, or does the lag happen for anything else? Like notifications appearing, panel pop-ups opening, etc
Comment 2 Nate Graham 2023-10-12 20:51:10 UTC
Also do you see it on Wayland too, or just X11?
Comment 3 Justin Zobel 2023-11-29 09:35:18 UTC
Setting to NEEDSINFO.
Comment 4 ratijas 2023-11-29 11:36:44 UTC
This is X11. The lag happens on any window resize. Less for Qt Widgets apps, more for QtQuick apps. Since panels are QtQuick views, and they animate by interpolating their window size, they lag a lot to the point where it is a complete slideshow at seconds per frames.

On Wayland window resizing is 60fps smooth for Qt Widgets & QtQuick apps and Plasma panels.

I think we should be able to detect if animation takes too long to draw a frame, and when it does — fall back to a different strategy, like changing size once and animating panel internally, or not animating at all.
Comment 5 Jianqing Liu 2023-12-06 23:02:01 UTC
Also observed this problem on intel integrated graphics

Operating System: Arch Linux 
KDE Plasma Version: 5.90.0
KDE Frameworks Version: 5.246.0
Qt Version: 6.6.1
Kernel Version: 6.6.4-zen1-1-zen (64-bit)
Graphics Platform: X11
Processors: 20 × 12th Gen Intel® Core™ i7-12700K
Memory: 62.5 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 770
Comment 6 David Edmundson 2024-02-22 15:48:30 UTC
> random NVIDIA driver update

Please confirm if this issue still persists
Comment 7 ratijas 2024-02-24 05:30:52 UTC
Can confirm this issue still persists on a fresh installation of Arch Linux with a fresh build of packages from git master.
Comment 8 ratijas 2024-03-19 12:12:03 UTC
How to brig back UI smoothness if you have a laggy panel on Plasma 6:

- For each Plasma panel out there:
- Floating: OFF
- Opacity: either always opaque or always translucent.
Comment 9 Nate Graham 2024-03-19 19:12:04 UTC
*** Bug 482717 has been marked as a duplicate of this bug. ***
Comment 10 Nate Graham 2024-03-19 19:12:15 UTC
*** Bug 483015 has been marked as a duplicate of this bug. ***
Comment 11 rickard 2024-03-19 20:10:38 UTC
(In reply to Nate Graham from comment #1)
> Is it just floating panels, or does the lag happen for anything else? Like
> notifications appearing, panel pop-ups opening, etc

I have only checked moving windows and switching desktops. Can't say I've noticed anything else but I did a quick check and popups etc didn't lag. 

Floating panels needs to be OFF, otherwise the stutter will always occur if a window is close to the panel, even if you set it to opaque.

I don't think the bug is present with the nouveau driver, I ran it for a while to test out NVK. So it could be a proprietary driver issue, don't quote me on that tho'.
Comment 12 Nate Graham 2024-03-27 16:42:16 UTC
*** Bug 482193 has been marked as a duplicate of this bug. ***
Comment 13 Nate Graham 2024-03-27 16:42:20 UTC
*** Bug 482100 has been marked as a duplicate of this bug. ***
Comment 14 Andy B 2024-04-09 16:55:39 UTC
Chiming in to say that I'm experiencing this issue too:

- I am using X11, on Arch Linux, using latest Nvidia drivers (550.67-1)
- It seems to affect most animations (or it could be anything that involves transparency, not sure).
- For me, it affects nearly all popups, modals and windows, not just the panel. Anything that fades/animates in/out of view stutters like crazy
- Stuttering causes the entire desktop to lag, including the cursor
- Disabling compositing doesn't help
- I'm unable to test with animations fully disabled as there is no option to disable "Window Open/Close Animation", it only lets me choose between "Fade", "Glide" and "Scale"
- Last time I tried Wayland it was not affected and was buttery smooth. However, I am no longer able to test Wayland as it seems to have broken itself recently somehow. This is probably related to my multi-GPU setup, but I haven't been able to fix it yet.
- Disabling transparency on the panel seems to have fixed the issue on the panel, however other animations are still affected.
Comment 15 Andy B 2024-04-09 18:06:27 UTC
Sorry for the additional comment, but I have managed to disable all the animations by setting the animation speed in "General Behavior" to "Instant" and unchecking all the animations in "Desktop Effects" (the radio buttons were a bit confusing). There still seems to be animations playing though, for example, the tooltips in the icon tray still "morph" and this causes large stutters.

Even with animations off though, there is stuttering all over the place, so not sure what's going on. For example, if I enable the "Show FPS" "Desktop Effect", every time I maximize a window there's a big red spike in the "Paint Duration" graph. Strangely enough, shrinking the window doesn't cause any stuttering. This happens even with "simple" applications like "Konsole" and "System Settings".
Comment 16 Nate Graham 2024-04-09 18:47:49 UTC
*** Bug 485254 has been marked as a duplicate of this bug. ***
Comment 17 Nate Graham 2024-04-09 19:49:09 UTC
*** Bug 485254 has been marked as a duplicate of this bug. ***
Comment 18 rickard 2024-04-22 09:19:35 UTC
Seems like there's more to this, I noticed having 2 windows on top of eachother can cause stutter too. In my case it was Firefox.
Window 1 had many tabs opened.
Window 2 had 1 tab opened.
If window 1 was over window 2 - Stutter.
If window 2 was over window 1 - Smooth
If I closed window 2 - Smooth
Comment 19 Bug Janitor Service 2024-04-25 19:02:33 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4265
Comment 20 Gregorplanet 2024-04-26 14:21:27 UTC
I am having the same issue with window resizing and panel set to floating on Fedora 40 (X11) with Nvidia Driver 550.76. Before the upgrade (Fedora 39 with Plasma 5.27.11) and with the same configuration, it was smooth.
Comment 21 rickard 2024-04-27 03:48:52 UTC
kwin 6.0.4.1
nvidia vulkan dev 550.40.61

I can't reproduce this anymore so it seems like it's fixed?

The nvidia changelog:

    Fixed crash in vkLatencySleepNV that happened under some circumstances
    Fixed performance drop when NVIDIA Reflex was enabled under some circumstances
    Fixed HEVC decode scaling list and made them universal
    Fixed indexed draws after executing secondary command buffer with index type change
    Fixed reconvergence hang with partitioned subgroup operations
    Fixed inconsistency between vkGetPhysicalDeviceSurfaceSupportKHR and vkGetPhysicalDevicePresentRectanglesKHR on certain displays