r/voidlinux • • 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!

27 Upvotes

55 comments sorted by

View all comments

Show parent comment

1

u/NomadicalYT Oct 11 '25

Hmm that seems like a problem with void’s sleep itself, not Nvidia

1

u/Electronic_Ask_184 Oct 11 '25

But I’ve tried many different Linux distributions, and this problem happens everywhere, not just on Void.

1

u/NomadicalYT Oct 11 '25

Bro is cursed

Maybe try using a different WM/graphical environment? They’re really easy to install on Void and I high recommend KDE Plasma