Bug 475662 - Failed to put system to sleep. System resumed again
Summary: Failed to put system to sleep. System resumed again
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: core (show other bugs)
Version: 5.27.8
Platform: Arch Linux Linux
: NOR major
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-15 13:38 UTC by James North
Modified: 2023-10-20 17:30 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James North 2023-10-15 13:38:36 UTC
SUMMARY
I'm attempting to put my KDE Wayland session on NVIDIA to sleep. I've tried three times, but it just keeps waking up! I've tried clicking sleep from the menu, and I've tried sudo systemctl suspend. No dice.

Here is some of  journalctl -r:

Oct 16 00:23:31 archalpha kmix[4738]: org.kde.kmix: No such icon "audio-card-pci"
Oct 16 00:23:31 archalpha kmix[4738]: org.kde.kmix: No such icon "audio-card-pci"
Oct 16 00:23:31 archalpha plasmashell[4546]: org.kde.plasma.pulseaudio: No object for name "alsa_output.pci-0000_2d_00.1.hdmi-stereo.monitor"
Oct 16 00:23:31 archalpha plasmashell[4546]: org.kde.plasma.pulseaudio: No object for name "alsa_output.pci-0000_2f_00.4.iec958-stereo.monitor"
Oct 16 00:23:31 archalpha rtkit-daemon[732]: Recovering from system lockup, not allowing further RT threads.
Oct 16 00:23:31 archalpha rtkit-daemon[732]: Supervising 0 threads of 0 processes of 0 users.
Oct 16 00:23:31 archalpha rtkit-daemon[732]: Recovering from system lockup, not allowing further RT threads.
Oct 16 00:23:31 archalpha rtkit-daemon[732]: Supervising 0 threads of 0 processes of 0 users.
Oct 16 00:23:31 archalpha rtkit-daemon[732]: Recovering from system lockup, not allowing further RT threads.
Oct 16 00:23:31 archalpha rtkit-daemon[732]: Supervising 0 threads of 0 processes of 0 users.
Oct 16 00:23:31 archalpha rtkit-daemon[732]: Recovering from system lockup, not allowing further RT threads.
Oct 16 00:23:31 archalpha rtkit-daemon[732]: Supervising 0 threads of 0 processes of 0 users.
Oct 16 00:23:31 archalpha rtkit-daemon[732]: Recovering from system lockup, not allowing further RT threads.
Oct 16 00:23:31 archalpha rtkit-daemon[732]: Supervising 0 threads of 0 processes of 0 users.
Oct 16 00:23:31 archalpha wireplumber[928]: PipeWire's BlueZ SPA missing or broken. Bluetooth not supported.
Oct 16 00:23:31 archalpha wireplumber[928]: SPA handle 'api.bluez5.enum.dbus' could not be loaded; is it installed?
Oct 16 00:23:31 archalpha systemd[1]: systemd-suspend.service: Failed with result 'exit-code'.
Oct 16 00:23:31 archalpha systemd[1]: systemd-suspend.service: Main process exited, code=exited, status=1/FAILURE
Oct 16 00:23:31 archalpha kwin_wayland[4426]: kwin_core: Applying KScreen config failed!
Oct 16 00:23:31 archalpha kwin_wayland[4426]: kwin_core: Applying KScreen config failed!
Oct 16 00:23:31 archalpha kwin_wayland[4426]: kwin_core: Applying KScreen config failed!
Oct 16 00:23:31 archalpha kwin_wayland[4426]: kwin_core: Applying KScreen config failed!
Oct 16 00:23:31 archalpha kwin_wayland[4426]: kwin_core: Applying KScreen config failed!
Oct 16 00:23:31 archalpha kwin_wayland[4426]: kwin_core: Applying KScreen config failed!
Oct 16 00:23:31 archalpha kwin_wayland[4426]: kwin_core: Applying KScreen config failed!
Oct 16 00:23:31 archalpha kwin_wayland[4426]: kwin_core: Could not find window with uuid "{cf203a26-beed-47b2-bbcb-04248de21b0b}"
Oct 16 00:23:31 archalpha kwin_wayland[4426]: kwin_core: Could not find window with uuid "{cf203a26-beed-47b2-bbcb-04248de21b0b}"
Oct 16 00:23:31 archalpha kwin_wayland[4426]: kwin_core: Could not find window with uuid "{cf203a26-beed-47b2-bbcb-04248de21b0b}"
Oct 16 00:23:31 archalpha kwin_wayland[4426]: kwin_core: Applying KScreen config failed!
Oct 16 00:23:31 archalpha kwin_wayland[4426]: kwin_core: Applying KScreen config failed!
Oct 16 00:23:31 archalpha kwin_wayland[4426]: kwin_core: Applying KScreen config failed!
Oct 16 00:23:31 archalpha kwin_wayland[4426]: kwin_core: Applying KScreen config failed!
Oct 16 00:23:31 archalpha kscreenlocker_greet[16354]: qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
Oct 16 00:23:31 archalpha kscreenlocker_greet[16354]: qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
Oct 16 00:23:31 archalpha kwin_wayland[4426]: kwin_core: Applying KScreen config failed!
Oct 16 00:23:31 archalpha kwin_wayland[4426]: kwin_core: Applying KScreen config failed!
Oct 16 00:23:31 archalpha kwin_wayland[4426]: kwin_wayland_drm: Atomic modeset commit failed! Permission denied
Oct 16 00:23:29 archalpha rtkit-daemon[732]: Demoted 0 threads.
Oct 16 00:23:29 archalpha rtkit-daemon[732]: Demoting known real-time threads.
Oct 16 00:23:29 archalpha systemd-sleep[16464]: Failed to put system to sleep. System resumed again: Device or resource busy
Oct 16 00:23:29 archalpha rtkit-daemon[732]: The canary thread is apparently starving. Taking action.
Oct 16 00:23:29 archalpha kernel: PM: suspend exit
Oct 16 00:23:29 archalpha kernel: random: crng reseeded on system resumption
Oct 16 00:23:29 archalpha kernel: Restarting tasks ... done.
Oct 16 00:23:29 archalpha kernel: OOM killer enabled.
...
Oct 16 00:23:29 archalpha kernel: Call Trace:
Oct 16 00:23:29 archalpha kernel: task:dolphin         state:D stack:0     pid:6071  ppid:662    flags:0x00004006
Oct 16 00:23:29 archalpha kernel: Freezing user space processes failed after 20.008 seconds (6 tasks refusing to freeze, wq_busy=0):
Oct 16 00:23:29 archalpha kernel: Freezing user space processes
Oct 16 00:23:29 archalpha kernel: Filesystems sync: 0.035 seconds
Oct 16 00:23:09 archalpha rtkit-daemon[732]: Demoted 0 threads.
Oct 16 00:23:09 archalpha rtkit-daemon[732]: Demoting known real-time threads.
Oct 16 00:23:09 archalpha systemd[1]: NetworkManager-dispatcher.service: Deactivated successfully.
Oct 16 00:23:09 archalpha rtkit-daemon[732]: The canary thread is apparently starving. Taking action.

STEPS TO REPRODUCE
1. Use Arch Linux with a NVIDIA card, then try to put the desktop to sleep. Clicking Sleep or running sudo systemctl suspend; it doesn't matter.

OBSERVED RESULT
KDE will wake up within a minute at the display manager.

EXPECTED RESULT
KDE falls asleep until I wake it up again.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.5.7-arch1-1 (64-bit)
(available in About System)
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.110.0
Qt Version: 5.15.11

ADDITIONAL INFORMATION
By default, when I resumed a session, the desktop would be completely corrupted. So I followed the steps here and enabled nvidia-suspend.service/nvidia-hibernate.service + added options nvidia NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=/tmp/nvprsrv to /etc/modprobe.d/nvidia-power-management.conf, added it to the FILES array in mkinitcpio, and regenerated initramfs. After this, suspend worked properly and when it came back from sleep it worked again. However, it doesn't sleep at all anymore!
Comment 1 James North 2023-10-15 13:48:40 UTC
Additionally, when it comes back from suspend, the primary monitors are switched as I reported here: https://bugs.kde.org/show_bug.cgi?id=475653
Comment 2 James North 2023-10-16 23:36:22 UTC
In the four times I've suspended/rebooted my computer since filing this bug, I have not been able to reproduce it yet. A reboot is what allowed me to suspend again initially.
Comment 3 James North 2023-10-17 05:30:32 UTC
Another piece of information that may prove important:

I don't have any normal swap on this machine. I'm using zram managed by zram-generator: https://wiki.archlinux.org/title/Zram#Using_zram-generator

I just noticed this note:

> Hibernating to swap on zram is not supported, even when zram is configured with a backing device on permanent storage. logind will protect against trying to hibernate to a swap space on zram.

Now, I'm not trying to hibernate. I'm trying to suspend/sleep. And it works currently. This seemed important to mention however.
Comment 4 Nate Graham 2023-10-20 17:24:02 UTC
This is fixed in Plasma 6 already, thankfully!

*** This bug has been marked as a duplicate of bug 379474 ***
Comment 5 Zamundaaa 2023-10-20 17:30:07 UTC
I'm afraid KWin isn't involved in handling system suspend, so the fix won't apply here. Please report this to NVidia if it happens again