Bug 448679 - KWin (desktop effects) shutters picture into triangles on Alt+Tab after sleep
Summary: KWin (desktop effects) shutters picture into triangles on Alt+Tab after sleep
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: tabbox (show other bugs)
Version: git master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Vlad Zahorodnii
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-17 22:09 UTC by ratijas
Modified: 2023-08-06 16:18 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Journalctl logs (17.47 KB, text/plain)
2022-07-10 11:14 UTC, BlankSpruce
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ratijas 2022-01-17 22:09:01 UTC
SUMMARY

Sometimes after waking up from sleep, laptop's KWin/X11 session may randomly break when switching apps via Alt+Tab.
The whole screen turns into randomly splattered triangles with rescaled and mispositioned content of windows parts.

The glitch can be "fixed" by switching to another TTY and back, for example pressing Ctrl+Alt+F2, Ctrl+Alt+F1. The fix is temporary, and it would glitch out again soon. Permanent fix is to reboot and don't go into sleep mode.

STEPS TO REPRODUCE
1. Boot up Plasma/X11, put system to sleep, and wake it up.
2. Switch apps via Alt+Tab (not consistent, likely won't work on a first try)

OBSERVED RESULT

Shuttered screed full of triangle artifacts.

EXPECTED RESULT

uhm… not this, I can tell 'ya that much.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.24.80
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.2
Kernel Version: 5.16.0-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

I recorded the glitch on a phone's camera:

- https://www.youtube.com/watch?v=cI-AB1lCobY
- https://www.youtube.com/watch?v=V7_2l8taH0E
Comment 1 ratijas 2022-06-01 08:40:30 UTC
This is still highly relevant.
Comment 2 ratijas 2022-06-01 08:41:28 UTC
Moving to tabbox component, because it seems to be the one which triggers the bug. Flickering always starts on Alt+Tab with my Big Icons switcher.
Comment 3 BlankSpruce 2022-07-10 11:14:41 UTC
Created attachment 150508 [details]
Journalctl logs

I've collected journalctl around the time issue occurs. At 12:14:02 I've pressed Alt+TAB, at 12:14:05 Ctrl+Alt+F2, at 12:14:06 Ctrl+Alt+F1. KWin was started with command:
QT_LOGGING_RULES="kwin_*.debug=true" kwin_x11 --replace &

System configuration:
Operating System: Manjaro Linux
KDE Plasma Version: 5.24.5
KDE Frameworks Version: 5.95.0
Qt Version: 5.15.5
Kernel Version: 5.10.126-1-MANJARO (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i5-8300H CPU @ 2.30GHz
Memory: 15.5 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1650/PCIe/SSE2
Comment 4 ratijas 2022-07-21 08:22:03 UTC
Part 3: https://www.youtube.com/watch?v=Xa5Dw2xzE04

Same bug, another video, just in case.
Comment 5 Kapybara 2022-08-29 17:25:44 UTC
(In reply to ratijas from comment #4)
> Part 3: https://www.youtube.com/watch?v=Xa5Dw2xzE04
> 
> Same bug, another video, just in case.

I was dealing with the same annoying issue and this seemed to fix it: https://wiki.archlinux.org/title/NVIDIA/Tips_and_tricks#Preserve_video_memory_after_suspend . Not only that, it fixed other instabilities I was experiencing as well, like the X11 server completely crashing in rare cases, when the sound volume popup was shown.

The driver discards the contents of the VRAM when suspending by default and tries to recostruct the previous state on wake up somehow(?). This fix instructs the driver to save the original contents and restore them on wake up.

Here's a one liner fix:

echo "options nvidia NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=/var/tmp" | sudo tee /etc/modprobe.d/nvidia-vram-fix.conf

While this fixes the issue, I'm still not entirely sure, if this is 100% Nvidia's fault, as Gnome can handle the driver's default behavior.
Comment 6 David Edmundson 2023-08-02 13:32:17 UTC
Does this still occur? Some context loss handling was cleaned up recently.
Comment 7 ratijas 2023-08-06 16:18:19 UTC
> Does this still occur? Some context loss handling was cleaned up recently.

Haven't seem this in a while, although not sure when was it fixed. Let's assume it was.