SUMMARY For the last week or so, whenever I try to put computer to sleep it logs out instead. But writing sudo pm-suspend in Terminal works - computer goes to sleep correctly. STEPS TO REPRODUCE 1. Try to put computer in sleep mode from kickoff launcher entry, or using "sleep" button on the keyboard OBSERVED RESULT System immediately logs out instead of going to sleep EXPECTED RESULT Sleep mode should behave correctly SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: 5.21.5 (available in About System) KDE Plasma Version: 5.21.5 KDE Frameworks Version: 5.82.0 Qt Version: 5.15.2 Linux kernel: 5.4.0-73-generic ADDITIONAL INFORMATION It seems that after unsuccessful sleep (logging back to system) some of it's functionality turns out to be broken until reboot, such as Global Shortcuts. But needs more testing.
I can confirm that, I have exactly the same problem. Operating System: KDE neon 5.22 KDE Plasma Version: 5.22.4 KDE Frameworks Version: 5.85.0 Qt Version: 5.15.3 Kernel Version: 5.13.0-1009-oem (64-bit) Graphics Platform: X11 Processors: 16 × AMD Ryzen 7 5700G with Radeon Graphics Memory: 62,2 GiB of RAM Graphics Processor: AMD RENOIR
In my case it turned out to be issue with Nvidia driver 460. Updating to 465 solved all issues with sleep.
The issue was resolved for me after I switched to another processor and GPU (Ryzen 5800X + GeForce 1080ti) a while ago, but now it's back after I switched GPU to Radeon 6700XT. In my case, it seems to correlate with the GPU being used: I had the issue with AMD graphics, but it was working with nvidia, so it may be related to the graphical stack. The current workaround for me is to use `sudo pm-suspend` instead of the built-in Sleep functions in Plasma. As stated in the original description, `sudo pm-suspend` works fine but `systemctl suspend` or any "sleep" function in Plasma causes immediate log out instead of going to sleep. My updated system information is: Operating System: KDE neon 5.24 KDE Plasma Version: 5.24.4 KDE Frameworks Version: 5.93.0 Qt Version: 5.15.3 Kernel Version: 5.14.0-1032-oem (64-bit) Graphics Platform: X11 Processors: 16 × AMD Ryzen 7 5800X 8-Core Processor Memory: 62,7 GiB of RAM Graphics Processor: AMD Radeon RX 6700 XT
> but `systemctl suspend` or any "sleep" function in Plasma causes immediate log out instead of going to sleep. And those are the ones we use, so this makes sense. Seems like the issue is at a deeper level of the stack than us; either in systemd or the kernel. This would especially make sense if changing hardware or hardware drivers is able to make a difference. I would encourage you to report this to the kernel devs.
@Nate Thank you for the reply. I agree that the issue may be at a deeper level. However, it manifests itself at the desktop environment level, at least I don't have another means to reproduce it. It doesn't crash the system, the X server keeps running, the login manager keeps running. It's the plasma session that gets terminated somehow. Do you have any suggestions about how I can better track the source of the problem?
You said `systemctl suspend` does a logout instead of a sleep. that's a raw systemd thing, far below any KDE code. It's possible there is a bug in Systemd, but I suspect the likelier explanation is that systemd gets bad data from the kernel due to driver and hardware issues. Hence my suggestion to file a bug on the Kernel. This is far beyond my level of expertise, so hopefully the kernel devs can provide further assistance.
Ok, the issue is resolved, this time for real. It is actually related to the Nvidia drivers. Removing the Nvidia drivers leaves the following broken symlinks: /etc/systemd/system/systemd-hibernate.service.requires/nvidia-hibernate.service /etc/systemd/system/systemd-hibernate.service.requires/nvidia-resume.service /etc/systemd/system/systemd-suspend.service.requires/nvidia-resume.service /etc/systemd/system/systemd-suspend.service.requires/nvidia-suspend.service Removing those symlinks fixes the issue with `systemctl suspend`
Glad you found it! I never would have guessed that the NVIDIA drivers might actually override the system's low-level power management actions
Also, please report this issue to the NVIDIA folks, either by sending an email to linux-bugs@nvidia.com or making a post at https://forums.developer.nvidia.com/c/gpu-unix-graphics/linux. They should know about these additional required cleanup steps when the driver is uninstalled.