Problem after screen sleep: takes ages to restart

When my (desktop) Kubuntu goes in sleep mode (after about 10 minutes) it takes ages for the screen to restart and always the computer seems to restart. After having entered my password, I can see in the task bar that Plasma had to be restarted (several times?).

How can I solve this issue?

When your PC goes to sleep, the graphics driver can forget what was in video memory.

Plasma then has to rebuild everything from scratch when you wake it up, so the screen stays black for ages and you get that Plasma was restarted pop-up.

Tell NVIDIA to remember its stuff

# Turn on NVIDIA’s sleep/wake helpers
sudo systemctl enable nvidia-suspend.service nvidia-resume.service nvidia-hibernate.service

# Ask the driver to keep its video-memory
echo 'options nvidia NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=/var/tmp' \
  | sudo tee /etc/modprobe.d/nvidia-preserve-vram.conf

# Rebuild boot files and reboot
sudo update-initramfs -u
sudo reboot

1.Translation: Don’t dump my VRAM while I’m asleep.
2.Start Plasma with a clean slate

  • Go to System Settings - Startup & Shutdown - Desktop Session .
  • Set On login to Start with an empty session .This stops Plasma’s restore last session feature from tripping over itself after suspend.

After these two tweaks your Kubuntu machine should wake up within a few seconds, minus the annoying black screen and restart messages.

This might work for some, and I have posted this same method numerous times with about a 25% success.
Plasma here:

systemctl status nvidia-suspend.service nvidia-resume.service nvidia-hibernate.service
○ nvidia-suspend.service - NVIDIA system suspend actions
     Loaded: loaded (/usr/lib/systemd/system/nvidia-suspend.service; enabled; preset: enabled)
     Active: inactive (dead) since Fri 2025-06-06 10:19:34 MDT; 20min ago
 Invocation: 010b3c2d5a144d5ca751e681f4bd4b12
    Process: 5971 ExecStart=/usr/bin/logger -t suspend -s nvidia-suspend.service (code=exited, status=0/SUCCE>
    Process: 5973 ExecStart=/usr/bin/nvidia-sleep.sh suspend (code=exited, status=0/SUCCESS)
   Main PID: 5973 (code=exited, status=0/SUCCESS)
   Mem peak: 2.2M
        CPU: 444ms

Jun 06 10:19:34 me-Legion-5-15ACH6-zfs systemd[1]: Starting nvidia-suspend.service - NVIDIA system suspend ac>
Jun 06 10:19:34 me-Legion-5-15ACH6-zfs suspend[5971]: nvidia-suspend.service
Jun 06 10:19:34 me-Legion-5-15ACH6-zfs logger[5971]: <13>Jun  6 10:19:34 suspend: nvidia-suspend.service
Jun 06 10:19:34 me-Legion-5-15ACH6-zfs systemd[1]: nvidia-suspend.service: Deactivated successfully.
Jun 06 10:19:34 me-Legion-5-15ACH6-zfs systemd[1]: Finished nvidia-suspend.service - NVIDIA system suspend ac>

○ nvidia-resume.service - NVIDIA system resume actions
     Loaded: loaded (/usr/lib/systemd/system/nvidia-resume.service; enabled; preset: enabled)
     Active: inactive (dead) since Fri 2025-06-06 10:19:44 MDT; 20min ago
 Invocation: 9015a8267eb1439f86991752679f44e1
    Process: 6189 ExecStart=/usr/bin/logger -t suspend -s nvidia-resume.service (code=exited, status=0/SUCCES>
    Process: 6204 ExecStart=/usr/bin/nvidia-sleep.sh resume (code=exited, status=0/SUCCESS)
   Main PID: 6204 (code=exited, status=0/SUCCESS)
   Mem peak: 1.6M
        CPU: 10ms

Jun 06 10:19:44 me-Legion-5-15ACH6-zfs systemd[1]: Starting nvidia-resume.service - NVIDIA system resume acti>
Jun 06 10:19:44 me-Legion-5-15ACH6-zfs suspend[6189]: nvidia-resume.service
Jun 06 10:19:44 me-Legion-5-15ACH6-zfs logger[6189]: <13>Jun  6 10:19:44 suspend: nvidia-resume.service
Jun 06 10:19:44 me-Legion-5-15ACH6-zfs systemd[1]: nvidia-resume.service: Deactivated successfully.
Jun 06 10:19:44 me-Legion-5-15ACH6-zfs systemd[1]: Finished nvidia-resume.service - NVIDIA system resume acti>

○ nvidia-hibernate.service - NVIDIA system hibernate actions
     Loaded: loaded (/usr/lib/systemd/system/nvidia-hibernate.service; enabled; preset: enabled)
     Active: inactive (dead)
lines 11-35/35 (END)

Sleep is just a no go here on my end. :frowning:

less /etc/modprobe.d/nvidia-preserve-vram.conf

options nvidia NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=/var/tmp

@thingizkhan Just for the record I don’t need any input here, but just sharing my results…Now I just throw in Lock Screen in my absence. :wink:

1 Like