This problem happens on my Ubuntu system as well. When it does, log in again, open a terminal, and run
$ ps aux | grep suspend
If you have the same problem I do, you will see a failed/hanging suspend process. That's what causes the system to start right again, because the suspend isn't finishing itself.
If in the same terminal you try this
$ sudo /sbin/shutdown -h now
you will get a refusal from the system, with a message saying something like that's a destructive transaction, that's the system d's way of saying that as long as that suspend process is hung, you aren't shutting down.
The only fix I know of is to kill the suspend process
$ kill -9 nnnnnn
where nnnnnn
is the number of the hanging suspend process you see in the ps aux
output.
I tried to track discussion of this in forums on the kernel and drivers, but it is pretty tough going. Some people claim it is being solved by kernel updates, say into the latest 4.6
and 4.8
editions, but I don't see any benefit. My problem, I'm pretty sure, links back to commercial Nvidia drivers that don't always get out of the way.
I was also having another issue where my system would hang and lock up for a bit when I logged out (say a minute or two) but would then eventually recover. It was also slow to boot and slow to shutdown. Shutting down it would sit on a blinking cursor for a while before eventually shutting down.
In investigating that issue, it fixed this one. I had great spews of crash dump in journalctl
and searching for various errors that came out, someone suggested to try booting with the nomodeset
kernel parameter see if that makes a difference. Which fixed the issue, then I tried setting /sys/power/mem_sleep
to deep and it worked like a charm (lost 3% battery in overnight test).
It appears that Ubuntu still needs nomodeset
for NVIDIA GPUs in 18.04 from searching around. I don't understand why or what causes it, but it seems linked to the proprietary NVIDIA drivers. The fix I applied works for me but I have no idea if it's 'correct'.
To ensure these settings (nomodeset
and deep sleep) persist after reboots I edited my grub config (/etc/default/grub
) and changed
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
to
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nouveau.modeset=0 mem_sleep_default=deep"
I used nouveau.modeset=0
instead of nomodeset
after reading this ask Ubuntu thread and this Reddit thread that suggest this is required using nouveau with dual GPUs.
Best Answer
I had the very same problem after upgrading from ubuntu 16.04 to ubuntu 18.04.
I solved by disabling the wakeup option for the device that in my case was enabled.
But what really helped me to identify the device were its ids.
After googling a bit, turns out it's the bluethooth controller.. https://usb-ids.gowdy.us/read/UD/8087/0a2b
Finally disable it
Now my laptop really suspends. Hope this helps you too.