Fixing broken suspend on Pop_OS
My Linux laptop used to suspend perfectly. I'd close the lid and it would go to sleep. Open it up, it would spring to life - presenting me with a password screen. But, some time in the last few months, it has stopped doing that.
If I close the lid, it keeps running. This is unhelpful.
If I manually run the suspend command - systemctl suspend
- the laptop blanks the screen then immediately turns it back on at the lock screen. It doesn't suspend.
I know that suspend physically works - becasue running any of these other command does properly suspend the machine. But powering it back up goes straight to the desktop - no lock screen!
sudo /lib/systemd/systemd-sleep suspend
sudo echo "mem" > /sys/power/state
sudo acpitool -s
The Fix
I found what was causing suspend to fail by running:
sudo systemd-analyze verify systemd-suspend.service
That spat out any errors in the suspend service. Highlighted in red was:
systemd-suspend.service: Failed to create systemd-suspend.service/start: Unit nvidia-resume.service is masked.
That was odd, because I don't have an Nvidia graphics card.
Looking in the relevant directory:
cd /etc/systemd/system/systemd-suspend.service.requires
I found:
nvidia-resume.service -> /lib/systemd/system/nvidia-resume.service
nvidia-suspend.service -> /lib/systemd/system/nvidia-suspend.service
I deleted the nvidia-resume.service
and nvidia-suspend.service
files.
For good measure, I also checked what Nvidia stuff I had installed:
apt list --installed | grep -i nvidia
I used sudo apt purge
to remove the remnants of any Nvidia stuff. Probably installed by mistake.
After that, suspend worked fine.
What "Fixes" Didn't Work
I went down a bit of a rabbit hole, following lots of suggestions from various people on the Internet. None of these helped me - but they may be useful pointers to you.
I tried disabling everything in /proc/acpi/wakeup
. I couldn't get PXSX
to be disabled. But even with everything else off, the suspend didn't work.
Killing Bluetooth with rfkill block bluetooth
didn't work. Nor did disabling WiFi.
I have an updated Kernel 6.8.0. I'm not sure of the ramifications of swapping to an older one.
Running sudo kernelstub -a mem_sleep_default=deep
and then rebooting didn't make a difference.
Switching from Wayland to X11 didn't fix it. Nor did unplugging the laptop from power. No external peripherals or screens were connected.
The whole system - including Flatpaks and Snaps - was updated.
This shell script works. But there's no way to tie it in to having the power button pressed or the lid closed.
Sherri W (SyntaxSeed) says:
@blog I had a similar problem last week on Ubuntu. It was an incomplete Snap Store update that was waking my PC up 30s after suspend.
Blake Eastman says:
@blog yeah nvidia on linux needs a lot of work. I have an nvidia machine running fedora and I had somewhat the opposite problem as you: when I shut the lid the laptop would suspend but when I opened it it would only wake for 30 seconds and then suspend again. Nothing I could do would permanently wake the machine and I would have to reboot every time.
The fix ended up being a kernel param to "wake on lid" or something like that. Oh nvidia... I won't be buying that brand again.
bsky.app said on bsky.app:
I had trouble with my install of Pop_OS as well, different problem. It was resolved with a usb installer and I chose “refresh OS install”. It kept all my files, apps, etc but gave me a clean OS again. Brilliant stuff
More comments on Mastodon.