r/voidlinux • u/NomadicalYT • Nov 22 '24
solved Fixing KDE Plasma sleep (suspend) with Void Linux & Nvidia
Hello everyone
You may have noticed that after installing Nvidia drivers on your Void Linux operating system with KDE Plasma, the suspend and hibernate functions no longer work. I just spent hours figuring out why, so here's the solution:
Also for anybody wondering, the technical term for "sleep" is "suspending your session to RAM"
---
- ⚠️ Symptoms:
You're using elogind and you've installed Nvidia drivers. When suspending the session, one of the following happens:
- Your screen goes completely blank, and the computer will not wake
- Your screen flashes black and then returns to the login (SDDM) screen
- Your computer suspends properly, but when waking from suspend, it turns on for a second but then goes back to sleep and/or becomes unresponsive
- Once logged back in, your software doesn't seem like it can access your hardware anymore. The most common one is Wi-Fi not detecting anything.
---
- ℹ️ Why This Happens:
So, it turns out the reason this is happening is because Nvidia needs to put its drivers to sleep before the entire session suspends. To do this, Nvidia uses a script called nvidia-sleep.sh, which they attempt to make elogind run before and after suspending/hibernating to handle Nvidia drivers.
On Void, elogind runs scripts placed in
/usr/lib64/elogind/system-sleep/
/etc/elogind/system-sleep
/usr/libexec/elogind/system-sleep/
before and after suspending, passing the $1 arguments pre for pre-suspend and post for post-suspend.
Guess what! Nvidia places its driver handler script in /usr/libexec/elogind/system-sleep/, which is run, but elogind on void doesn't run suspend scripts with root (for some reason 🥹). This means that instead of running, the Nvidia script asks for a password on an invisible terminal, and weird things happen.
Luckily for us, Void's very own zzz also gets configured to run Nvidia's scripts when called, and this one actually runs properly. Therefore, we can remove Nvidia's nvidia-sleep.sh script from elogind and instead have elogind run zzz when suspending the system.
---
- ✅ The Solution
First, we need to disable Nvidia's nvidia-sleep.sh:
sudo mv /usr/libexec/elogind/system-sleep/nvidia.sh /usr/libexec/elogind/backup/
Next, we can make elogind use zzz:
• 1. Open the elogind sleep config file:
Kate: kate /etc/elogind/sleep.conf
Nano: sudo nano /etc/elogind/sleep.conf
• 2.Uncomment and set the following parameters:
AllowSuspend=yes
SuspendByUsing=/usr/bin/zzz
HibernateByUsing=/usr/bin/ZZZ
• 3. Open terminal and reload elogind:
loginctl reload
---
Congrats! You're done. Hopefully that fixes the issue and everything works great again. If not, hopefully this information serves as a starting point for troubleshooting any further issues with this problem.
If you're still here, you deserve a cookie: 🍪
Thanks for reading!
3
u/BinkReddit Nov 22 '24
Congrats on the sleuthing! Looks like it's rather painful to run Nvidia.
2
u/089sudg9078n Nov 22 '24
Didn't fix it for me so I will have to keep looking.
This issue will remain for now. :) Hope this fixes it for others
2
u/furryfixer Nov 23 '24
If your solution works, that is very well, but your explanation of the problem does not seem to apply to everyone. I am a long-time nvidia user, and am running the proprietary drivers and elogind. There have been issues with "sleep" in Plasma, in both Void and Arch using Wayland, but not with X11. ELogind/sleep/suspend works flawlessly there in both distros, so the problem would not be elogind, but possibly plasma/nvidia/wayland. Also, using elogind by invoking "loginctl suspend" from a terminal window as a regular user works, and wake from suspend is normal. I do not have wifi to assess your last symptom after wake however.
So the question is, what on your system prevents elogind from working? There are PAM settings and a polkit action needed for elogind to have adequate permissions, which is usually installed with it. Do you have
"/usr/share/polkit-1/actions/org.freedesktop.login1.policy"?
If you do, is it, or some of the PAM settings, modified in some way? Make sure you do not have acpid running as well, as it would compete with elogind.
2
u/AlexMPO1 May 06 '25
omg, thank you so much!! i was searching for a solution for hours and this is was right solution to the exact problem. Have a nice day and thanks for the cookie!
2
u/karjala May 11 '25
This worked, but unfortunately I'm getting an extra zombie [zzz] process every time I close the lid and zzz executes.
Anyone knows how I can solve this?
1
u/Due_Seesaw3084 Nov 22 '24
This has been an issue for me since about, 2006. If you fix it across everything, I'd be so happy. It's been across almost every machine and many operating systems, including Intel and AMD CPU, either Laptop or Desktop forms, and with either AMD integrated or card, Intel (integrated) or Nvidia (card) graphics. Any OS, including Windows and many Linux versions. You wouldn't think that it would be that difficult to suspend to RAM or disk. I guess that it is.
So, it's a huge problem that I have always blamed on MS, for setting the specs power and main board power use configs - with all the manufacturers who will use 99% windows on their machines and sell those licenses.
1
u/QuintaQQ May 11 '25
Sadly doesn't fix the problem for me :(
1
u/Electronic_Ask_184 Oct 11 '25
This is the only Reddit post that describes a problem almost identical to mine. I’ve tried many different Linux distributions, and in almost all of them I encountered the same issue: after waking the laptop from sleep, the system would boot into an empty console where I couldn’t type anything or perform any actions. The solution suggested in that post didn’t work for me. I’m running Void Linux with XFCE.
1
u/parrot-beak-soup Nov 26 '25
Old post, but I recently reinstalled void and noticed I had this issue. Solved it for me. Thanks!
1
u/el-calde May 07 '25
I will be trying this just installed void. Void is actually my favorite distro and the only reason i stopped using it was because of rhis same issue. Will report back!!
2
u/karjala May 05 '25
Worked for me. Thanks :)
1
u/furryfixer Dec 01 '24
I am using the proprietary nvidia drivers, and have the nvidia scripts that you reference.
1
u/karjala May 29 '25
From what I see, one needs to repeat the removal of nvidia.sh from libexec after every update of nvidia, since the update places it back there again.
Is there a way to automate this without having to remember to "do something" after every nvidia update?
1
u/cgwhouse Dec 21 '25
Worked like a charm. Thank you very much! For anyone reading this, this fix is still relevant as of 12/21/2025 for the Void + Plasma + Nvidia combo. If it helps, I have also supplied kernel parameters as per https://wiki.archlinux.org/title/NVIDIA/Tips_and_tricks#Preserve_video_memory_after_suspend