Bug 469623 - [wayland] Desktop corruption with AMD GPU when using Maximize and Minimize effects
Summary: [wayland] Desktop corruption with AMD GPU when using Maximize and Minimize ef...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Desktop Containment (show other bugs)
Version: 5.27.10
Platform: Fedora RPMs Linux
: HI normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
: 467771 472357 472991 473736 475064 480318 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-05-11 14:10 UTC by Alex Tucker
Modified: 2024-02-08 21:50 UTC (History)
13 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0


Attachments
Screen recording (3.45 MB, video/x-matroska)
2023-05-11 14:10 UTC, Alex Tucker
Details
wayland-info during bug (22.82 KB, text/plain)
2024-01-25 17:42 UTC, Georgijs
Details
desktop bug (1.22 MB, image/png)
2024-01-26 22:10 UTC, Georgijs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Tucker 2023-05-11 14:10:34 UTC
Created attachment 158860 [details]
Screen recording

SUMMARY

STEPS TO REPRODUCE
1. Potentially suspend / resume -- not confirmed
2. Potentially use multi-monitor with main screen higher resolution than the other -- not confirmed
3. After some time, I close/minify window to reveal desktop -- doesn't happen always.

OBSERVED RESULT

On my larger screen, 2560x1440, the desktop/background/wallpaper is reduced to the same size as my other screen, 1920x1080 and positioned top left, while the remaining screen not covered by the desktop has an animated trace of any window effects / drags that remain and flicker as I move the mouse.

I'll take a screen recording as it's hard to describe!

In addition, right clicking outside of this reduced desktop area doesn't provide any context menu or actions.

EXPECTED RESULT

Desktop remains full size and uncorrupted.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora Linux 38 / KDE Plasma
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.105.0
Qt Version: 5.15.9

ADDITIONAL INFORMATION
Graphics Platform: Wayland
Graphics Processor: AMD Radeon Graphics (using open source amdgpu)
Comment 1 Zamundaaa 2023-05-17 14:30:37 UTC
The glitches are caused by there not being anything behind the windows. We should probably fix those separately, but the wallpaper being the wrong size is a bug in plasmashell
Comment 2 Zamundaaa 2023-08-09 09:27:16 UTC
*** Bug 472357 has been marked as a duplicate of this bug. ***
Comment 3 Zamundaaa 2023-08-09 12:46:22 UTC
*** Bug 472991 has been marked as a duplicate of this bug. ***
Comment 4 Zamundaaa 2023-08-28 19:18:54 UTC
*** Bug 467771 has been marked as a duplicate of this bug. ***
Comment 5 Nate Graham 2023-08-28 19:27:23 UTC
*** Bug 473736 has been marked as a duplicate of this bug. ***
Comment 6 Bug Janitor Service 2023-08-28 19:30:30 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/4369
Comment 7 Zamundaaa 2023-08-28 19:33:16 UTC
Can someone with an affected system test if the environment variable KWIN_USE_BUFFER_AGE=0 makes a difference?
Comment 8 Zamundaaa 2023-09-19 12:30:37 UTC
.
Comment 9 Bug Janitor Service 2023-10-04 03:46:59 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 10 Fushan Wen 2023-10-04 03:54:58 UTC
I can hardly reproduce the bug nowadays, so not sure if the magic really 
takes effect.
Comment 11 Alex Tucker 2023-10-05 10:39:28 UTC
I've not been able to consistently reproduce this bug for some time, but have since been using a dedicated AMD GPU with more VRAM (8GB). The only time I noticed the bug return was when temporarily reverting back to the GPU (actually an APU, the 5700G CPU has a GPU on chip) with less VRAM -- 4GB I think, though may be less as it's auto-configured in BIOS.

Let me do some testing to see whether I can reproduce without the dedicated GPU and try out the KWIN_USE_BUFFER_AGE=0.
Comment 12 Zamundaaa 2023-10-12 21:33:30 UTC
*** Bug 475064 has been marked as a duplicate of this bug. ***
Comment 13 Alex Tucker 2023-10-15 11:15:55 UTC
I finally managed to reproduce the bug, after paring down my system to just the AMD GPU I was originally using ("APU" 5700G CPU with GPU) and restricting the VRAM in the BIOS to 1GB. I believe it was 4GB when I originally posted this report, but wanted to see whether I could reproduce the bug more quickly by reducing the available VRAM.

I'm running with two monitors, three virtual desktops and two separate activities (for home and for work).

As far as I can tell, the bug more often happens after resuming from suspend.

I'll now try with KWIN_USE_BUFFER_AGE=0. I've added this to .config/plasma-workspace/env/kwin.sh with the following contents:

KWIN_USE_BUFFER_AGE=0
export KWIN_USE_BUFFER_AGE
Comment 14 Alex Tucker 2023-10-15 14:16:13 UTC
> I'll now try with KWIN_USE_BUFFER_AGE=0. I've added this to
> .config/plasma-workspace/env/kwin.sh with the following contents:
> 
> KWIN_USE_BUFFER_AGE=0
> export KWIN_USE_BUFFER_AGE

After adding the above and restarting, suspending and resuming, opening Chrome and swapping activities, I can confirm that the bug is still present.

I had a look in /proc and confirmed that KWIN_USE_BUFFER_AGE=0 is set for processes /usr/bin/kwin_wayland as well as /usr/bin/kwin_wayland_wrapper.

Is there a debug setting I can enable somewhere?
Comment 15 Vlad Zahorodnii 2023-11-20 09:22:37 UTC
Can you make 1920x1080 your primary screen and try disconnecting it?

Also, can you post the output of `wayland-info` when the glitch is reproducible?
Comment 16 David Edmundson 2023-11-22 09:59:07 UTC
Marking as needs info from #c15
Comment 17 Alex Tucker 2023-12-06 16:15:37 UTC
I haven't been able to reproduce this for the past week or so.

I again pared down my system to be just the AMD 5700G CPU+GPU and reduced memory to 1GB.

I also removed KWIN_USE_BUFFER_AGE=0 and tried swapping and disconnecting the primary screen as per comment 15.

Numerous suspend/resume and usage later, the bug has not reappeared for me.

Unless any of the other reporters/duplicates can reproduce, I'm happy to close this.
Comment 18 Nate Graham 2023-12-07 18:45:31 UTC
Great news!
Comment 19 Bug Janitor Service 2023-12-22 03:46:03 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 20 Bug Janitor Service 2024-01-06 03:46:16 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!
Comment 21 Georgijs 2024-01-25 17:40:11 UTC
Hi,

I am constantly annoyed bug same bug.
I experience this bug at least once a day on my working laptop.
The workaround I use to fix this is rotate display and then revert changes.

Operating System: Fedora Linux 39
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.111.0
Qt Version: 5.15.11
Kernel Version: 6.6.8-200.fc39.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 PRO 5850U with Radeon Graphics
Memory: 11,5 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Manufacturer: LENOVO
System Version: ThinkPad P14s Gen 2a

Really looking forward this bug resolution.
I always use dual monitor setup: at work and at home with same laptop but different resolution screens.
I mostly never shutdown my system, suspend to RAM only.
In home setup both monitors have same resolution. And it does not matter whether I have same DPI on laptop and monitor. Bug still appears.
At work I have ultrawide monitor with higher resolution.
Issue mostly happens either, when I click to show desktop (Peek at desktop via shortcut keys).
Or maximizing/minimizing window.
Or when window is stacked to the side and I click on the desktop for a menu.
I was not able to reproduce it on purpose, but it happens on daily basis.
Comment 22 Georgijs 2024-01-25 17:42:21 UTC
Created attachment 165215 [details]
wayland-info during bug

Attached wayland-info during bug occurence
Comment 23 Nate Graham 2024-01-26 21:41:32 UTC
Georgijs, is your issue exactly the same as what's shown in Alex's screen recording? Or does it look different?
Comment 24 Georgijs 2024-01-26 22:10:25 UTC
Created attachment 165261 [details]
desktop bug

Dear Nate, I was looking for this open bug for a long time. I am quite sure that I experience the same bug.
The similarities we have with original author:
- multiple external monitors, one at home and one at work
- wayland session
- wake up from sleep, which is not direct cause but likely contributes to this bug somehow
- AMD GPU (not sure if it is relevant)
Comment 25 Georgijs 2024-01-26 22:16:35 UTC
I wonder how author managed to record using OBS studio, as for me it was not working properly during the bug. I have managed to record on the phone: https://www.youtube.com/watch?v=tJRnJKkVHmM
Comment 26 Georgijs 2024-01-27 07:57:30 UTC
The scenario of the bug sometimes can be achieved by following sequence:
1. you are connected at work to external monitor (laptop+external).
2. you put your laptop to sleep
3. you disconnect work monitor
4. you take your laptop home and connect another external display
5. you wake up you laptop from sleep
6. you login and show desktop, when you do so you might see the glitch with the desktop
I was able to reproduce: https://www.youtube.com/watch?v=rPh_MKD1c8A

Yesterday at work I was able to stabely reproduce this bug for 4 times in a row, just by following sequence:
1. Your laptop is connected to external monitor
2. You disconnect the monitor
3. Lock the computer
4. Connect external display
5. Unlock the laptop
6. Show desktop on external screen.
On 5th try it was not reproducing anymore.

Important: When your was exposed to such bug, system can randomly enter into glitch during showing desktop. It is not like you always have to come from Lock state. You might be working with windows and then at one point you decide to take a look a the desktop and then this bug randomly might appear.
Comment 27 Georgijs 2024-01-27 08:05:42 UTC
Small comment: I always use external display in extended mode as a primary desktop, my laptop serves as a secondary screen.
I do not remember having this bug just on laptop alone, but I rarely use laptop in such mode.
I have experienced this bug on Fedora 38 on older KDE versions, as well as on my personal laptop OpenSuse Thumbleweed. So this is not specific to distribution. Both laptops I have are ThinkPads:
- Personal - ThinkPad T14s (Gen 1) with Ryzen 5 PRO 4650U and built in AMD GPU.
- Work laptop i use the most - ThinkPad P14s Gen 2a with Ryzen 7 PRO 5850U and built in AMD GPU.
Comment 28 Nate Graham 2024-01-29 21:50:30 UTC
Georgijs, any chance you can upgrade to the Plasma 6 RC1 release to see if it's fixed there? An enormous number of cchanges have been made to KWin since Plasma 5, so there's a chance one of them has fixed it, or re-fixed it.
Comment 29 Georgijs 2024-01-30 14:33:18 UTC
I will try KDE Neon Unstable Edition and post my feedback.
Comment 30 Georgijs 2024-02-01 10:09:20 UTC
Dear Nate,

I have been running neon-testing-20240130-0309.iso for whole day and I was not able to reproduce same issue.
Well sometimes it is difficult to force bug to appear quickly, but I did my best to compromise and still was not able to reproduce. I will try once again at some point.
Comment 31 Nate Graham 2024-02-01 21:14:48 UTC
Ok, great!

If it does happen again in the same form, you can re-open this bug report.
Comment 32 Zamundaaa 2024-02-08 21:50:13 UTC
*** Bug 480318 has been marked as a duplicate of this bug. ***