Bug 477738 - [NVIDIA] kwin on Wayland black screen with cursor after most resume-from-RAM
Summary: [NVIDIA] kwin on Wayland black screen with cursor after most resume-from-RAM
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.27.9
Platform: Arch Linux Linux
: VHI critical
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: wayland
: 437808 451386 (view as bug list)
Depends on:
Blocks: 482772
  Show dependency treegraph
 
Reported: 2023-11-29 23:33 UTC by Ethan Nguyen
Modified: 2024-05-10 19:01 UTC (History)
22 users (show)

See Also:
Latest Commit:
Version Fixed In:
osobukoman: performance+
osobukoman: Wayland+
osobukoman: X11+
osobukoman: Catalyst+
osobukoman: dpi+
osobukoman: Gallium3D+
osobukoman: Intel+
osobukoman: Mesa+
osobukoman: nouveau+
osobukoman: NVIDIA+
osobukoman: r300g+
osobukoman: r600g+
osobukoman: Decision-Required+
osobukoman: Triaged+
osobukoman: ReviewRequest+


Attachments
System journal logs (80.84 KB, text/plain)
2023-11-30 03:46 UTC, Ethan Nguyen
Details
kwin logs 2024-01-20 (49.87 KB, text/x-log)
2024-01-20 18:43 UTC, Ethan Nguyen
Details
DRM debug logs 2024-01-20 (3.38 MB, text/x-log)
2024-01-20 18:45 UTC, Ethan Nguyen
Details
journalctl -b (499.10 KB, text/plain)
2024-02-18 17:22 UTC, Victor Ryzhykh
Details
sudo dmesg (153.65 KB, text/plain)
2024-02-18 17:23 UTC, Victor Ryzhykh
Details
Nvidia build config (14.13 KB, application/gzip)
2024-02-25 17:37 UTC, Victor Ryzhykh
Details
dmesg logs (89.37 KB, text/plain)
2024-03-16 11:12 UTC, stefano.d
Details
journcal ctl logs (280.35 KB, text/plain)
2024-03-16 11:12 UTC, stefano.d
Details
glitches (507.66 KB, image/jpeg)
2024-03-16 11:12 UTC, stefano.d
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ethan Nguyen 2023-11-29 23:33:44 UTC
SUMMARY
After I suspend to RAM and resume, my KDE setup (Wayland, Nvidia 1060, using the nvidia driver, on Arch Linux) leaves me with a black screen and a working cursor that changes when I hover over a textbox (but I can't see the textbox) on the lockscreen.

I see this in the system journal right after I resume from RAM:

```
kwin_wayland[1399]: kwin_wayland_drm: Atomic commit failed! Permission denied
kwin_wayland[1399]: kwin_wayland_drm: Presentation failed! Permission denied
kwin_wayland[1399]: kwin_wayland_drm: Atomic commit failed! Permission denied
kwin_wayland[1399]: kwin_wayland_drm: Presentation failed! Permission denied
kwin_wayland[1399]: kwin_wayland_drm: Atomic modeset commit failed! Permission denied
kwin_wayland[1399]: kwin_wayland_drm: Setting dpms mode failed!
kwin_wayland[1399]: kwin_wayland_drm: Atomic modeset commit failed! Permission denied
kwin_wayland[1399]: kwin_wayland_drm: Setting dpms mode failed!
kwin_wayland[1399]: kwin_core: Could not find window with uuid "{38667f04-f9ad-4cc3-958b-f8d804def467}"
kwin_wayland[1399]: kwin_core: Could not find window with uuid "{38667f04-f9ad-4cc3-958b-f8d804def467}"
kwin_wayland[1399]: kwin_core: Could not find window with uuid "{38667f04-f9ad-4cc3-958b-f8d804def467}"
kwin_wayland[1399]: kwin_core: Could not find window with uuid "{38667f04-f9ad-4cc3-958b-f8d804def467}"
```

and then lots of these lines, filling up my journal until I reboot

```
kwin_core: Applying KScreen config failed!
```

I can't seem to find a way to recover from this other than to reboot, which is, of course, extremely disruptive.

STEPS TO REPRODUCE
1. Put the computer to sleep (i.e. suspend to RAM)
2. Wake it back up

OBSERVED RESULT
Black screen -- no lock screen displayed, but I can still move my mouse cursor around and see it respond to the presence of a text box

EXPECTED RESULT
I should be able to see my lock screen.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux, latest packages
(available in About System)
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.112.0
Qt Version: 5.15.11

ADDITIONAL INFORMATION
My hardware (Nvidia 1060, nvidia proprietary driver) is probably relevant? Not quite sure how to attach bugtraces, but I can if needed. Thank you!
Comment 1 Ethan Nguyen 2023-11-29 23:40:40 UTC
And apologies for the second message but some other things I thought of:

* I already am doing the "preserve video memory after suspend" referenced https://wiki.archlinux.org/title/NVIDIA/Tips_and_tricks#Preserve_video_memory_after_suspend
* I already use the modesetting driver referenced at https://community.kde.org/Plasma/Wayland/Nvidia, and I also use `fbdev=1`
Comment 2 fanzhuyifan 2023-11-30 03:19:42 UTC
(In reply to etnguyen03+kdebugs from comment #1)
> And apologies for the second message but some other things I thought of:
> 
> * I already am doing the "preserve video memory after suspend" referenced
> https://wiki.archlinux.org/title/NVIDIA/
> Tips_and_tricks#Preserve_video_memory_after_suspend
> * I already use the modesetting driver referenced at
> https://community.kde.org/Plasma/Wayland/Nvidia, and I also use `fbdev=1`

Would you be able to post complete logs when you trigger this?

Did you also enable nvidia-suspend.service? If so you should see something in the journal on that.

Did this start happening after a recent update? Which version of the nvidia drivers are you on?

Thanks!
Comment 3 Ethan Nguyen 2023-11-30 03:46:28 UTC
Created attachment 163629 [details]
System journal logs
Comment 4 Ethan Nguyen 2023-11-30 03:47:01 UTC
(In reply to fanzhuyifan from comment #2)
> Would you be able to post complete logs when you trigger this?

Attaching.

> Did you also enable nvidia-suspend.service? If so you should see something
> in the journal on that.

Yes, and I see logs:

```
systemd[1]: Starting NVIDIA system suspend actions...
░░ Subject: A start job for unit nvidia-suspend.service has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit nvidia-suspend.service has begun execution.
░░ 
░░ The job identifier is 2476.
suspend[3794]: nvidia-suspend.service
logger[3794]: <13>Nov 29 20:48:28 suspend: nvidia-suspend.service
systemd[1]: nvidia-suspend.service: Deactivated successfully.
░░ Subject: Unit succeeded
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit nvidia-suspend.service has successfully entered the 'dead' state.
systemd[1]: Finished NVIDIA system suspend actions.
░░ Subject: A start job for unit nvidia-suspend.service has finished successfully
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit nvidia-suspend.service has finished successfully.
░░ 
░░ The job identifier is 2476.
```

> Did this start happening after a recent update? Which version of the nvidia
> drivers are you on?

So I recently upgraded my hardware (but did not upgrade my GPU), and as part of that I reinstalled my OS + KDE and switched to Wayland. I think this has more to do with my switch to Wayland (I can try Xorg if that's useful). Before switching to Wayland, suspend worked completely fine.

I am on nvidia 545.29.06-2.
Comment 5 Zamundaaa 2023-12-12 15:26:51 UTC
Please put
> QT_LOGGING_RULES="kwin_wayland_*.debug=true"
into /etc/environment, reboot, and then test this again and attach the KWin log afterwards. You can get that (filtered to only KWin) with
> journalctl --user-unit plasma-kwin_wayland --boot 0

If you could record a drm debug log as described in https://invent.kde.org/plasma/kwin/-/wikis/Debugging-DRM-issues that could also be useful.
Comment 6 Bug Janitor Service 2023-12-27 03:46:22 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 7 Bug Janitor Service 2024-01-11 03:45:41 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 8 Nate Graham 2024-01-17 16:47:56 UTC
*** Bug 451386 has been marked as a duplicate of this bug. ***
Comment 9 Nate Graham 2024-01-17 16:53:37 UTC
*** Bug 437808 has been marked as a duplicate of this bug. ***
Comment 10 Ethan Nguyen 2024-01-20 18:42:59 UTC
Hi - sorry for the late response, I was away for a few weeks. On kwin 5.27.10-2, I have noticed that this happens less often -- or sometimes something slightly different happens (I can unlock my session fine, but then one of my monitors, and every window that I drag into it more than 50%, appears black or does not update).

Logs of this are attached.
Comment 11 Ethan Nguyen 2024-01-20 18:43:21 UTC
Created attachment 165083 [details]
kwin logs 2024-01-20
Comment 12 Ethan Nguyen 2024-01-20 18:45:17 UTC
Created attachment 165084 [details]
DRM debug logs 2024-01-20
Comment 13 Nate Graham 2024-02-09 00:40:09 UTC

*** This bug has been marked as a duplicate of bug 475605 ***
Comment 14 Nate Graham 2024-02-16 15:25:39 UTC
Not a duplicate of that issue, my mistake. That's X11-only and this is on Wayland.
Comment 15 Victor Ryzhykh 2024-02-18 11:24:53 UTC
It seems that on KDE6 there is no such problem on Wayland with Nvidia drivers.
I just made that image https://disk.yandex.ru/d/QgccYm1t71gLWw
I downloaded it to my computer in livecd mode.

Operating System: ROSA Fresh Desktop 2023.1
KDE Plasma Version: 5.93.0
KDE Frameworks Version: 5.249.0
Qt Version: 6.7.0
Kernel Version: 6.7.4-generic-2rosa2023.1-x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-7700K CPU @ 4.20GHz
Memory: 15.5 ГиБ of RAM
Graphics Processor: NVIDIA GeForce RTX 3050/PCIe/SSE2
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: B250M-D3H

I assembled the kernel according to this recommendation 
https://community.kde.org/Distributions/Packaging_Recommendations#Kernel_configuration

I put the computer into standby mode several times and after exiting standby 
mode there were no problems with the operation of the Nvidia driver.
Comment 16 fanzhuyifan 2024-02-18 16:17:07 UTC
(In reply to Victor Ryzhykh from comment #15)
> It seems that on KDE6 there is no such problem on Wayland with Nvidia
> drivers.
> I just made that image https://disk.yandex.ru/d/QgccYm1t71gLWw
> I downloaded it to my computer in livecd mode.
> 
> Operating System: ROSA Fresh Desktop 2023.1
> KDE Plasma Version: 5.93.0
> KDE Frameworks Version: 5.249.0
> Qt Version: 6.7.0
> Kernel Version: 6.7.4-generic-2rosa2023.1-x86_64 (64-bit)
> Graphics Platform: Wayland
> Processors: 8 × Intel® Core™ i7-7700K CPU @ 4.20GHz
> Memory: 15.5 ГиБ of RAM
> Graphics Processor: NVIDIA GeForce RTX 3050/PCIe/SSE2
> Manufacturer: Gigabyte Technology Co., Ltd.
> Product Name: B250M-D3H
> 
> I assembled the kernel according to this recommendation 
> https://community.kde.org/Distributions/
> Packaging_Recommendations#Kernel_configuration
> 
> I put the computer into standby mode several times and after exiting standby 
> mode there were no problems with the operation of the Nvidia driver.

What Nvidia driver version are you using? After suspending and resuming, could you check the output of "cat /sys/devices/system/cpu/cpuidle/low_power_idle_system_residency_us"?
Comment 17 Victor Ryzhykh 2024-02-18 16:57:44 UTC
(In reply to fanzhuyifan from comment #16)
> What Nvidia driver version are you using? After suspending and resuming,
> could you check the output of "cat
> /sys/devices/system/cpu/cpuidle/low_power_idle_system_residency_us"?
Nvidia 545 driver is used.
I made a disk image to test the functionality of Wayland on my desktop computer.
I specifically provided a link to the disk image so that others could also test how Wayland works on Nvidia.
I can't install KDE6 on my desktop computer until program Lokalize is ported to kf6.
I have KDE5 running on my desktop computer.
I have KDE6 installed on my ASUS ROG Zephyrus M16 (GU603HE-K8007) laptop.
But it has hybrid graphics, so there is no such possibility for verification.
On a laptop with KDE 6, it works well on X11 and Wayland.
I hope that someone will be able to check Wayland’s work on NVIDIA, using the image of the disk that I applied above.
Comment 18 fanzhuyifan 2024-02-18 17:01:25 UTC
(In reply to Victor Ryzhykh from comment #17)
> (In reply to fanzhuyifan from comment #16)
> > What Nvidia driver version are you using? After suspending and resuming,
> > could you check the output of "cat
> > /sys/devices/system/cpu/cpuidle/low_power_idle_system_residency_us"?
> Nvidia 545 driver is used.
> I made a disk image to test the functionality of Wayland on my desktop
> computer.
> I specifically provided a link to the disk image so that others could also
> test how Wayland works on Nvidia.
> I can't install KDE6 on my desktop computer until program Lokalize is ported
> to kf6.
> I have KDE5 running on my desktop computer.
> I have KDE6 installed on my ASUS ROG Zephyrus M16 (GU603HE-K8007) laptop.
> But it has hybrid graphics, so there is no such possibility for verification.
> On a laptop with KDE 6, it works well on X11 and Wayland.
> I hope that someone will be able to check Wayland’s work on NVIDIA, using
> the image of the disk that I applied above.

Could you paste the output of `journalctl -b` and `sudo dmesg` on the reported working system with plasma 6 and nvidia? Just wanted to check which suspend level the system entered.
Comment 19 Victor Ryzhykh 2024-02-18 17:03:18 UTC
(In reply to Victor Ryzhykh from comment #17)
> Nvidia 545 driver is used.
There is a file in the nvidia driver
/etc/modprobe.d/nvidia-power-management.conf
with text


# The destination should not be using tmpfs, so we prefer
# /var/tmp instead of /tmp
options nvidia NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=/var/tmp
Comment 20 Victor Ryzhykh 2024-02-18 17:22:29 UTC
Created attachment 165925 [details]
journalctl -b

(In reply to fanzhuyifan from comment #18)
> Could you paste the output of `journalctl -b` 
Done.
Comment 21 Victor Ryzhykh 2024-02-18 17:23:41 UTC
Created attachment 165926 [details]
sudo dmesg

(In reply to fanzhuyifan from comment #18)
>  and `sudo dmesg` on the
> reported working system with plasma 6 and nvidia? Just wanted to check which
> suspend level the system entered.
Done.
Comment 22 Victor Ryzhykh 2024-02-19 14:15:18 UTC
(In reply to fanzhuyifan from comment #18)
> Could you paste the output of `journalctl -b` and `sudo dmesg` on the
> reported working system with plasma 6 and nvidia? Just wanted to check which
> suspend level the system entered.
Did you manage to see anything useful?
Comment 23 Victor Ryzhykh 2024-02-25 15:56:35 UTC
Build version 6.0.0.

Operating System: ROSA Fresh Desktop 2023.1
KDE Plasma Version: 6.0.0
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Kernel Version: 6.7.6-generic-1rosa2023.1-x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-7700K CPU @ 4.20GHz
Memory: 15.5 ГиБ of RAM
Graphics Processor: NVIDIA GeForce RTX 3050/PCIe/SSE2
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: B250M-D3H

When idle, the computer goes into sleep mode, as configured in the energy saving settings. All previously running applications continue to run after waking up.
Comment 24 Victor Ryzhykh 2024-02-25 17:36:48 UTC
(In reply to Victor Ryzhykh from comment #23)
> When idle, the computer goes into sleep mode, as configured in the energy
> saving settings. All previously running applications continue to run after
> waking up.
The nvidia driver is compiled using the following configs
Comment 25 Victor Ryzhykh 2024-02-25 17:37:55 UTC
Created attachment 166095 [details]
Nvidia build config

(In reply to Victor Ryzhykh from comment #23)
> When idle, the computer goes into sleep mode, as configured in the energy
> saving settings. All previously running applications continue to run after
> waking up.

The nvidia driver is compiled using the following configs
Comment 26 Victor Ryzhykh 2024-02-26 14:06:13 UTC
But if we talk about kde6, it is very good. Today this is the best of the kde6 for me. Working on kde6 is very convenient. It’s a shame that I have to go back to kde5. I hope this doesn't last very long.
P.S.
In the distribution, the main one is KDE5, and I cannot compile them so that they can be installed simultaneously with KDE6.
Comment 27 Victor Ryzhykh 2024-02-26 14:07:27 UTC
(In reply to Victor Ryzhykh from comment #26)
> But if we talk about kde6, it is very good. Today this is the best of the
> kde6 for me. Working on kde6 is very convenient. It’s a shame that I have to
> go back to kde5. I hope this doesn't last very long.
> P.S.
> In the distribution, the main one is KDE5, and I cannot compile them so that
> they can be installed simultaneously with KDE6.

I'm sorry. Accidentally wrote in the wrong bar.
Comment 28 cow70296 2024-03-11 13:45:17 UTC
Same issue. It happens any time going idle, or closing laptop lid.

Operating System: Arch Linux 
KDE Plasma Version: 6.0.1
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Kernel Version: 6.7.9-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 8 × AMD Ryzen 7 3700U with Radeon Vega Mobile Gfx
Memory: 13.5 GiB of RAM
Graphics Processor: AMD Radeon Vega 10 Graphics
Manufacturer: LENOVO
Product Name: 20NF0018US
System Version: ThinkPad E595
Comment 29 stefano.d 2024-03-16 11:12:08 UTC
Created attachment 167311 [details]
dmesg logs

Not sure, if this is related, but after hibernate and waking up, I see so much glichtes and artefacts, that the desktop gets unusable such that I have to restart the desktop.
Distribution: KDE Neon
Desktop: KDE Plasma 6.0.2
Qt Version: 6.6.2
Graphics Platform: Wayland
Graphics Card: NVIDIA GTX 1060 
NVIDIA Driver Version: 535.161.07
Comment 30 stefano.d 2024-03-16 11:12:25 UTC
Created attachment 167312 [details]
journcal ctl logs
Comment 31 stefano.d 2024-03-16 11:12:40 UTC
Created attachment 167313 [details]
glitches
Comment 32 Victor Ryzhykh 2024-03-30 14:12:23 UTC
(In reply to Victor Ryzhykh from comment #17)
> Nvidia 545 driver is used.
When I used drivers 545, I had no crashes after exiting sleep mode, but after switching to drivers 550, problems appeared. Although it is possible that the transition to new drivers simply coincided with some other change.
Comment 33 Victor Ryzhykh 2024-03-30 14:13:13 UTC
(In reply to Victor Ryzhykh from comment #32)
> (In reply to Victor Ryzhykh from comment #17)
> > Nvidia 545 driver is used.
> When I used drivers 545, I had no crashes after exiting sleep mode, but
> after switching to drivers 550, problems appeared. Although it is possible
> that the transition to new drivers simply coincided with some other change.

Operating System: ROSA Fresh Desktop 2023.1
KDE Plasma Version: 6.0.3
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Kernel Version: 6.8.2-generic-1rosa2023.1-x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-7700K CPU @ 4.20GHz
Memory: 15.5 ГиБ of RAM
Graphics Processor: NVIDIA GeForce RTX 3050/PCIe/SSE2
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: B250M-D3H
Comment 34 Victor Ryzhykh 2024-03-30 22:46:46 UTC
(In reply to Victor Ryzhykh from comment #32)
> When I used drivers 545, I had no crashes after exiting sleep mode, but
> after switching to drivers 550, problems appeared. Although it is possible
> that the transition to new drivers simply coincided with some other change.

Oops. I have now reinstalled the system.
The system exits sleep mode on the 550 drivers, on wayland, without errors.
Apparently the old system had accumulated errors from constant testing of different versions of the compiled packages for KDE6.