I’ve experienced an issue with suspend on Ubuntu and Kubuntu 18.04, but the issue only occurs on one machine.
Another three different machines I’ve tested had no suspend issues at all and I would have assumed that the fault was with my own crappy laptop, except that suspend was working fine on both Ubuntu and Kubuntu 17.10 and it also turns out that suspend works without issue on 18.04 when using a 4.14 kernel (more on that later).
Whilst searching the forums for a solution to my problem, it has become apparent that although suspend works fine for many people using 18.04 there are a few issues which look similar but have slightly different behaviours and different fixes.
As a quick troubleshooting guide I have outlined a few steps to narrow down where the problem might lie and what might help resolve the issue.
The first thing to check is that suspend actually works at all. It can appear that the machine is failing to resume after going to sleep, but in many cases the machine is failing to enter suspend properly in the first place.
Manually Select Suspend
You should be able to manually select suspend on any desktop but it's slightly hidden in Gnome Shell - you can either longpress the power button from the top right hand menu of the screen, or click that button whilst holding Alt or press the Super key and type in 'suspend'
If you manually select suspend you can check that the screen switches off and that the power LED is flashing. Any fan that may be spinning should also switch off.
In my case, the screen would switch off but the power LED stayed on and the fan would continue to run if already doing so. The machine did not respond to any keypresses or mouse movements or pressing the power button (which would normally ‘resume’).
The usual tricks of Ctrl + Alt + f1 or f2, f3 etc had no effect. The only thing that could be done was to force the machine to shutdown by holding down the power button.
In order to provide consistent language to describe the problem, I’m going to call this ‘seizing up and requiring a forced shutdown’.
Nvidia Graphics
I don’t have nVidia graphics on my machine, but for some people experiencing suspend issues who do, there is a fix that has reportedly resolved the issue for a number of people.
It’s outlined here by cascagrossa:
https://askubuntu.com/questions/1029...041395#1041395
and basically involves adding the kernel parameter ‘nouveau.modeset=0’ in /etc/default/grub
The assumption is that you are using the open source ‘nouveau’ graphics driver (if you are experiencing suspend problems whilst using the proprietary nVidia graphics drivers then it’s worth trying nouveau instead just to be sure the fault isn’t with the proprietary drivers)
For those who are unfamiliar with Linux, you want to open up a terminal and use
Code:
sudo nano etc/default/grub
to change the line
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
to be
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nouveau.modeset=0"
(press Ctrl + x to exit, press ‘y’ to agree to save the changes and press 'enter' to accept the filename)
and then run and reboot the machine.
s2idle
There has also been a problem with the machine not going into ‘deep’ sleep, but instead going into an ‘s2idle’ mode instead.
It’s easy to check, just type
Code:
cat /sys/power/mem_sleep
and you should see the default suspend mode with [square brackets] around it.
For the ‘normal’ suspend mode that most users expect, cat /sys/power/mem_sleep should return something like:
s2idle [deep]
If you have [s2idle] in the square brackets then s2idle is currently the default suspend mode.
The fix for that has been helpfully described here by monty47:
https://askubuntu.com/questions/1029...036122#1036122
Try An Older Kernel
I was unaware of a rather handy program called UKUU until I stumbled across a solution helpfully outlined by matalak here:
https://askubuntu.com/questions/1029...038528#1038528
It involves installing the Ubuntu Kernel Update Utility by following the steps from omgubuntu.co.uk:
https://www.omgubuntu.co.uk/2017/02/...-kernel-ubuntu
and then choosing any kernel from the 4.14 branch.
I chose the most up-to-date 4.14 kernel, mainly to see if the problem only turned up in the 4.15 branch, which it appears at least for my machine, that it did.
Under ‘Advanced options for Ubuntu’ in the grub menu you can then choose which kernel to boot into.
Using this method I was able to see that using 18.04 with a kernel from the 4.14 branch allowed suspend to work again without issue.
Bug Report
I have opened a bug report about my particular suspend issue and a few others have been afflicted with the same problem. I’ve not opened a bug report before, but I assume that the developers are busy and need to focus their time and energy on specific issues.
I was concerned that because the bug was only able to be reproduced on specific hardware combinations that it might not get any attention. I attempted to point people from AskUbuntu towards the bug report if the nVidia nouveau modeset trick didn’t help and the s2idle fix wasn’t at the root of their suspend problems.
That being said, whenever anyone added their voice to the bug report, I tried to show some appreciation that they’d taken the time to report it and also to confirm that the behaviour was a consistent failure to suspend, with the screen going blank, the power LED staying on and leaving an unresponsive machine that required a forced reset.
Unfortunately, this may have had a detrimental effect on the bug report, filling it up with discussion rather than a developer being able to look through and quickly see what the issue was.
I’ve not been told off for not keeping it succinct, and initially I thought it was important to put as much detail into describing the issue as possible, but looking at the bug report it has occurred to me that there’s quite a lot to read through, which might not be helpful to the busy developers.
Fortunately, despite not affecting a large number of users, one of the Canonical developers, Kai-Heng Feng, contacted the kernel team who applied a patch and he then posted the patched 4.15 kernel to test.
It’s in post #35 of the bug report: https://bugs.launchpad.net/ubuntu/+s...50/comments/35
The patched kernel has resolved my suspend issue and will hopefully be added into the upstream code, but for now I just have to make sure I don’t update the kernel when any updates are available.
Suspend Issues In 18.04 In General
I’d like to attempt to move the discussion away from the bug report and into this thread, so that anyone experiencing a similar issue can check for other fixes, discuss their findings and, if the problem seems to be a kernel issue too, can report their problem succinctly to the developers.
‘Suspend Issues In 18.04 In General’ is too large a topic to be helpful in a bug report, but should be a good place in the forums to gather all the issues and then be able to report them individually.
It was only by searching for a solution to my own problem that I became aware of a number of separate issues that had similar looking behaviour, so hopefully a bit of further discussion of people’s suspend issues will bring to light any other issues and help narrow down where things might be going wrong.