Bug 457284

Summary: On X11 with AMD or NVIDIA GPU, lock screen wallpaper is sometimes all black after waking from sleep
Product: [Plasma] kwin Reporter: Erich Eickmeyer <eeickmeyer>
Component: compositingAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: al.neodim, bhush94, bugs.kde, butirsky, eduardo.cruz, francogpellegrini, higors88, jchevarley, jinujohnjoseph, kalzwayed, kde-bugzilla, kde, mugokwe42x, nate, notmart, qydwhotmail, sephiroth_pk, tatsoft, xaver.hugl
Priority: NOR Keywords: regression
Version: 5.25.3   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=456122
https://bugs.kde.org/show_bug.cgi?id=463379
Latest Commit: Version Fixed In: 5.26.5
Attachments: Bugged lock screen
Normal lock screen
Plasma under Wayland after returning from sleep

Description Erich Eickmeyer 2022-07-29 21:40:15 UTC
SUMMARY
Lock screen shows black on Nvidia hardware. We did not see the same result on intel hardware with the same setup.


STEPS TO REPRODUCE
1. Instal KDE 5.25.2 and 22.04 Jammy Jellyfish on a kubuntu focus system and reboot
2. Close the lid of the laptop and wait ~5 seconds for it to go to sleep
3. Open the lid and the lock screen should show up with a black background

OBSERVED RESULT

Lock screen has a black background because no background is selected

EXPECTED RESULT

Lock screen should should have a background selected

SOFTWARE/OS VERSIONSLinux/KDE Plasma: Kubuntu 22.04 / 5.25.2
KDE Plasma Version: 5.25.2
KDE Frameworks Version: 5.95.0
Qt Version: 5.15.3

ADDITIONAL INFORMATION

Occured on nvidia hardware, did not occur on intel hardware.
Comment 1 Nate Graham 2022-08-01 19:22:58 UTC
Do you see the interactive UI elements for the lock screen, or is the entire screen black?

Can you move the cursor?
Comment 2 Erich Eickmeyer 2022-08-01 22:15:27 UTC
(In reply to Nate Graham from comment #1)
> Do you see the interactive UI elements for the lock screen, or is the entire
> screen black?
 
The UI elements are there and it is interactive.

> Can you move the cursor?

Cursor is active.

The only issue is the background is black.
Comment 3 Nate Graham 2022-08-01 22:29:12 UTC
Thanks. Moving to KWin since it seems like this is probably a graphics issue. Possibly even an issue with the NVIDIA drivers.

Does it reproduce with both Wayland and X11?

Does this happen on the desktop too, or just the lock screen?
Comment 4 Erich Eickmeyer 2022-08-01 23:04:00 UTC
(In reply to Nate Graham from comment #3)
> Thanks. Moving to KWin since it seems like this is probably a graphics
> issue. Possibly even an issue with the NVIDIA drivers.
> 
> Does it reproduce with both Wayland and X11?

We are unable to even launch Wayland under 5.25.x as it immediately crashes on our Nvidia hardware. That might be a separate bug.

> Does this happen on the desktop too, or just the lock screen?

It's just the lock screen.
Comment 5 Nate Graham 2022-08-01 23:10:33 UTC
Thanks.
Comment 6 Eduardo 2022-08-06 13:54:41 UTC
I've got the same issue, background is always black, and sometimes it aggravates a little more as the current date and time information sometimes shows up incomplete, only a few of the numbers are displayed.

Only happens when directly returning from sleep. If I unlock it, then just lock the screen again without sleep, the lock screen shows up fine.

It wasn't always like this. It started happening a couple months back, I don't know exactly when... Hard to tell where the bug is located down the stack, could be kernel, nvidia drivers, or kde software. I would guess it's some sort of race condition, maybe something is being requested of the graphics card while it is still not ready back from sleep.

It happens on my 2 computers, both with kernel 5.18.16-zen, nvidia-dkms 515.65.01-1, kwin/plasma 5.25.4 under XOrg.
Comment 7 Riccardo Robecchi 2022-08-15 15:12:42 UTC
I have this issue on two different computers, a desktop and a notebook, both with all-AMD hardware, so this is not exclusive to NVIDIA. On the desktop, the issue is also present with the desktop itself, not just with the lock screen.
Comment 8 Fushan Wen 2022-09-16 14:52:23 UTC
Can't reproduce. Can you still reproduce it after removing ~/.cache/kscreenlocker_greet/ ? If you can test 5.26 Beta it would be better.
Comment 9 Nate Graham 2022-09-16 15:22:49 UTC
*** Bug 459075 has been marked as a duplicate of this bug. ***
Comment 10 Erich Eickmeyer 2022-09-16 15:35:10 UTC
(In reply to Fushan Wen from comment #8)
> Can't reproduce. Can you still reproduce it after removing
> ~/.cache/kscreenlocker_greet/ ? If you can test 5.26 Beta it would be better.

No effect. Cannot test on 5.26 Beta, I do not have access to binary builds at this time. Latest test on 5.25.5 resulted in same issue. Bear in mind, this is on an Nvidia discrete GPU in Performance mode, issue does not occur if in Powersave (integrated graphics) mode.
Comment 11 Nate Graham 2022-09-16 15:41:45 UTC
Jino, are you also using an NVIDIA GPU when you reproduce the issue?
Comment 12 Jinu 2022-09-16 16:26:30 UTC
(In reply to Nate Graham from comment #11)
> Jino, are you also using an NVIDIA GPU when you reproduce the issue?

Yes, I am also using and Nvidia GPU.
Comment 13 Nate Graham 2022-09-16 16:32:04 UTC
Thanks. This is pointing to a graphics issue in KWin or the NVIDIA driver; moving back to KWin.

Can anyone reproduce on Wayland?
Comment 14 Eduardo 2022-09-16 16:54:36 UTC
Created attachment 152122 [details]
Bugged lock screen

This is the lock screen I get when returning from sleep.
Date and time label only shows a "5, that's very random, sometimes more pieces of the date and time are shown, sometimes it shows complete, sometimes it is missing at all.
Background is black.
Profile picture is grey.
Comment 15 Eduardo 2022-09-16 16:55:36 UTC
Created attachment 152123 [details]
Normal lock screen

This is what my lock screen should be. I get this when just locking without going to sleep.
Comment 16 Eduardo 2022-09-16 17:09:32 UTC
Created attachment 152124 [details]
Plasma under Wayland after returning from sleep

Under Wayland it is even worse. The bug lives on into plasma desktop even after I unlock the lock screen after returning from sleep. As can be seen in the picture, the desktop renders completely crazy. No icons, no labels, black background, date and time on taskbar shows only "1"...
Comment 17 Nate Graham 2022-09-16 17:12:46 UTC
This is starting to feel like a bug in the NVIDIA driver itself. There's a long history of graphical glitches on suspend, unfortunately.
Comment 18 Eduardo 2022-09-16 17:16:35 UTC
(In reply to Nate Graham from comment #17)
> This is starting to feel like a bug in the NVIDIA driver itself. There's a
> long history of graphical glitches on suspend, unfortunately.

It's possible... however In comment #7 he said he got the bug with AMD hardware.
Comment 19 Riccardo Robecchi 2022-09-17 08:51:11 UTC
(In reply to Nate Graham from comment #17)
> This is starting to feel like a bug in the NVIDIA driver itself. There's a
> long history of graphical glitches on suspend, unfortunately.

I can reproduce on AMD hardware, specifically my laptop with a Ryzen 2500U CPU and Vega 8 GPU. I am therefore removing the mention of NVIDIA from the title.
One thing I noticed is that it often occurs after I connect or disconnect my laptop to/from the docking station. If I just leave it plugged in, the bug does not appear.
Comment 20 Nate Graham 2022-09-22 14:19:47 UTC
*** Bug 456723 has been marked as a duplicate of this bug. ***
Comment 21 Nate Graham 2022-09-22 14:22:19 UTC
We've made a change that we're pretty sure will fix this in Plasma 5.26! Please re-open if you find that you can still reproduce the issue in 5.26 after upgrade (and a reboot, of course!).
Comment 22 Nate Graham 2022-09-22 14:41:57 UTC
*** Bug 437808 has been marked as a duplicate of this bug. ***
Comment 23 Erich Eickmeyer 2022-09-22 14:58:17 UTC
(In reply to Nate Graham from comment #21)
> We've made a change that we're pretty sure will fix this in Plasma 5.26!
> Please re-open if you find that you can still reproduce the issue in 5.26
> after upgrade (and a reboot, of course!).

Sadly, I can't 100% confirm this. I just upgraded to Plasma 5.26 beta from the Kubuntu beta PPA which might not have the latest commits and, sadly, the issue still exists there. That said, I won't reopen as I don't believe this fits the test case.
Comment 24 Nate Graham 2022-09-22 15:09:46 UTC
The commits to fix it were just made yesterday and didn't make it into the beta. You'd have to be running the latest git version of the master branch or the plasma/5.26 branch.
Comment 25 Ali 2022-09-30 19:01:26 UTC
Hi, 
I just get it fixed by removing the NVIDIA driver completely and reinstall it again.

sudo apt-get purge '*nvidia*' -y
reboot
sudo apt-get install nvidia-driver-515
reboot
sudo apt-get install nvidia-modprobe 
reboot
Comment 26 Ali 2022-10-01 15:02:53 UTC
(In reply to Ali from comment #25)
> Hi, 
> I just get it fixed by removing the NVIDIA driver completely and reinstall
> it again.
> 
> sudo apt-get purge '*nvidia*' -y
> reboot
> sudo apt-get install nvidia-driver-515
> reboot
> sudo apt-get install nvidia-modprobe 
> reboot

issue reproduced , black background
Comment 27 Ali 2022-10-15 21:46:29 UTC
I downgraded the nvidia-driver to 510 and apply this line 
> sudo chmod +x /usr/share/screen-resolution-extra/nvidia-polkit
open nvidia-settings and save the x server display configuration by pressing  "save to x configuration file"
Comment 28 Erich Eickmeyer 2022-10-15 21:59:53 UTC
(In reply to Ali from comment #27)
> I downgraded the nvidia-driver to 510 and apply this line 
> > sudo chmod +x /usr/share/screen-resolution-extra/nvidia-polkit
> open nvidia-settings and save the x server display configuration by pressing
> "save to x configuration file"

That's merely a workaround and can actually break some laptop displays. Please do not give such advice as a "bugfix".
Comment 29 Riccardo Robecchi 2022-10-15 22:08:23 UTC
(In reply to Ali from comment #27)
> I downgraded the nvidia-driver to 510 and apply this line 
> > sudo chmod +x /usr/share/screen-resolution-extra/nvidia-polkit
> open nvidia-settings and save the x server display configuration by pressing
> "save to x configuration file"

Considering that, as people (me included) have pointed out multiple times, this issue is not related just to NVIDIA, I wouldn't be so quick in marking the issue as closed as you solving it by downgrading the NVIDIA driver doesn't fix the issue for people with AMD or Intel drivers. Let's leave this issue open until we are sure that it is fixed for everyone, thank you. Furthermore, as Erich points out, your workaround can cause further issues, so I would tread very carefully around this.

More on topic, I was actually able to reproduce the issue without suspending my laptop, but simply plugging in an external display. The laptop's screen  (oddly enough, not the external display) started exhibiting the behaviour, which also involved Plasma's desktop. The desktop was black unless it was focused (i.e. I clicked on it); after a few minutes the issue went away on its own on both the desktop and the lockscreen.
Comment 30 Alex A.D. 2022-10-18 11:23:46 UTC
There is al a related issue on that: bug 455738
Comment 31 Erich Eickmeyer 2022-10-25 18:47:49 UTC
Finally on Plasma 5.26.1. So far, I have not seen this bug appear, so I'm very close to marking this as fixed, but I want to do a little more testing before closing.
Comment 32 Erich Eickmeyer 2022-10-26 14:42:10 UTC
Confirmed bug is gone as of 5.26.1. Thanks!
Comment 33 Erich Eickmeyer 2022-10-26 14:43:48 UTC
*** Bug 455738 has been marked as a duplicate of this bug. ***
Comment 34 Joe 2022-10-31 13:25:18 UTC
This is fixed on my NVidia system (X11), but oddly enough, I am still seeing this on my AMD build (Wayland):

Operating System: Arch Linux
KDE Plasma Version: 5.26.2
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.7
Kernel Version: 6.0.2-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 3700X 8-Core Processor
Memory: 15.5 GiB of RAM
Graphics Processor: AMD Radeon RX 5500 XT
Manufacturer: Micro-Star International Co., Ltd.
Product Name: MS-7B85
System Version: 1.0

I am still getting a black wallpaper on the screen locker on occasions when resuming from sleep/hibernate. I don't see anything particularly useful in journalctl, either.
Comment 35 Riccardo Robecchi 2022-12-22 07:33:19 UTC
I just experienced this on my AMD system. It is the first time it happens in a while, though.
KDE Plasma version: 5.26.4
KDE Frameworks version: 5.101.0
Qt version: 5.15.7
Comment 36 Joe 2023-01-05 06:43:26 UTC
So updated to 5.26.5, and noticed there was a commit for blank lock screen wall papers. After updating, I have yet to see this bug again.

So perhaps it's fixed now?
Comment 37 Nate Graham 2023-01-05 15:33:34 UTC
Oh fabulous, maybe https://invent.kde.org/plasma/kscreenlocker/-/commit/50fc20dc940c87ffd62be0650b935324e164b59d was the fix.

Can other people upgrade to Plasma 5.26.5 and see if the issue is solved for them too?
Comment 38 Nate Graham 2023-01-05 21:16:53 UTC
*** Bug 463379 has been marked as a duplicate of this bug. ***
Comment 39 Franco Pellegrini 2023-01-18 11:48:14 UTC
(In reply to Nate Graham from comment #37)
> Oh fabulous, maybe
> https://invent.kde.org/plasma/kscreenlocker/-/commit/
> 50fc20dc940c87ffd62be0650b935324e164b59d was the fix.
> 
> Can other people upgrade to Plasma 5.26.5 and see if the issue is solved for
> them too?

I'm using AMD, and the problem continues.

Operating System: KDE neon 5.26
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.8
Kernel Version: 5.15.0-58-generic (64-bit)
Graphics Platform: X11
Processors: 12 × AMD Ryzen 5 5600G with Radeon Graphics
Memory: 30.7 GiB of RAM
Graphics Processor: RENOIR
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: B450M DS3H V2
Comment 40 Franco Pellegrini 2023-01-18 11:48:36 UTC
*** Bug 464445 has been marked as a duplicate of this bug. ***
Comment 41 Nate Graham 2023-01-18 19:45:56 UTC
Well darn. Erich, any chance backporting https://invent.kde.org/plasma/kscreenlocker/-/commit/50fc20dc940c87ffd62be0650b935324e164b59d has fixed it for you?
Comment 42 Bug Janitor Service 2023-02-02 05:01:40 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 43 Bug Janitor Service 2023-02-17 03:49:05 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 44 Nate Graham 2024-01-17 16:42:28 UTC
Re-opening as it's clearly not fixed since we're still getting bug reports about it, unfortunately.
Comment 45 Nate Graham 2024-01-17 16:42:45 UTC
*** Bug 475605 has been marked as a duplicate of this bug. ***
Comment 46 Jean-Francois Roy 2024-01-17 16:54:05 UTC
(In reply to Nate Graham from comment #44)
> Re-opening as it's clearly not fixed since we're still getting bug reports
> about it, unfortunately.

There is some confusion in this bug, 475605, and other duped bugs about the nature and symptoms of this bug. I am trying to gather more data on the specific flavor that I am running into daily on my system. Some basic questions that need to be summarized:

- Does it happen when the system locks the screen?
- Does it happen when the system puts the display to sleep?
- Does it happen when the system suspends?
- Are there more than one screen?
- Are there more than one GPU?
- Is it a PRIME system with muxing? If so, which GPU was driving the display?
- Is the cursor visible?
- Are there any GUI elements visible?
- Is the broken lock screen function (e.g. blindly typing your password and hitting Enter unlocks)?
- Is there a method that brings you back to a working desktop (e.g. killing kscreenlocker_greet).
- Is the desktop session using X11 or Wayland?

Each specific combination of these may be a different root issue. And of course there are other basic system information to answer, like kernel version, kernel cmdline, display modes, GPU driver version, etc.

I'm also unclear how to gather more information. The journal log is really unhelpful when it happens. Are there config flags, environment variables, etc. that someone can set to get more information.
Comment 47 Nate Graham 2024-01-17 17:12:20 UTC
Indeed, I just realized that myself and am un-duping some bug reports.
Comment 48 Nate Graham 2024-01-17 17:16:36 UTC
As for this specific one about just the wallpaper being black after resume, we think it's fixed and have no newer reports, so I'll close it again.