Score:1

Ubuntu 20.04 suspend does not work

jp flag

I found a few related questions, but nothing for 20.04, and questions for 20.04 are about resuming after suspend, or suspend on lid close etc.

I recently updated my XPS 15 laptop from Xubuntu 18.04 to 20.04 and suspend is no longer working. Basically nothing happens when I close the lid or click on "suspend" in xfce4-session-input. The screen goes black, but the CPU and fans are still running. Same when I close the lid. When I press a key it asks for the user password.

Any tips on how to fix "sleep" on Ubuntu 20.04?

cat /sys/power/mem_sleep shows [s2idle] deep.

Thanks.

inxi -F output:

System:    Host: omer-XPS-15-9570 Kernel: 5.11.0-25-generic x86_64 bits: 64 Desktop: i3 4.17.1
           Distro: Ubuntu 20.04.2 LTS (Focal Fossa)
Machine:   Type: Laptop System: Dell product: XPS 15 9570 v: N/A
           serial: <superuser/root required>
           Mobo: Dell model: 0D0T05 v: A00 serial: <superuser/root required> UEFI: Dell v: 1.8.1
           date: 02/01/2019
Battery:   ID-1: BAT0 charge: 85.8 Wh condition: 88.2/97.0 Wh (91%)
CPU:       Topology: 6-Core model: Intel Core i7-8750H bits: 64 type: MT MCP L2 cache: 9216 KiB
           Speed: 3961 MHz min/max: 800/4100 MHz Core speeds (MHz): 1: 3989 2: 1119 3: 2903
           4: 2982 5: 901 6: 900 7: 900 8: 900 9: 904 10: 3760 11: 3400 12: 3400
Graphics:  Device-1: Intel UHD Graphics 630 driver: i915 v: kernel
           Device-2: NVIDIA GP107M [GeForce GTX 1050 Ti Mobile] driver: N/A
           Display: x11 server: X.Org 1.20.9 driver: modesetting unloaded: fbdev,vesa
           resolution: 3840x2160~60Hz
           OpenGL: renderer: Mesa Intel UHD Graphics 630 (CFL GT2) v: 4.6 Mesa 20.2.6
Audio:     Device-1: Intel Cannon Lake PCH cAVS driver: snd_hda_intel
           Sound Server: ALSA v: k5.11.0-25-generic
Network:   Device-1: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter
           driver: ath10k_pci
           IF: wlp59s0 state: up mac: 9c:b6:d0:c3:bb:65
           Device-2: Qualcomm Atheros type: USB driver: btusb
Drives:    Local Storage: total: 476.94 GiB used: 51.82 GiB (10.9%)
           ID-1: /dev/nvme0n1 vendor: Toshiba model: KXG60ZNV512G NVMe 512GB size: 476.94 GiB
Partition: ID-1: / size: 467.96 GiB used: 51.82 GiB (11.1%) fs: ext4 dev: /dev/nvme0n1p2
Sensors:   System Temperatures: cpu: 31.0 C mobo: N/A
           Fan Speeds (RPM): cpu: 0 fan-2: 0
Info:      Processes: 276 Uptime: N/A Memory: 15.28 GiB used: 856.2 MiB (5.5%) Shell: zsh
           inxi: 3.0.38
Score:1
st flag

I had the same issue with Ubuntu 22.04. The root cause was that I was using the nouveau driver instead of the proprietary one from NVIDIA. Once I switched to that suspend started working again.

Score:1
zw flag

So you did a "dist-upgrade" from 18 to 20. What are your power settings say? It should look like this:

[1]

"Laptop Lid" should be in "Suspend mode". The file /etc/systemd/logind.conf should have not active entries (all entries start with "#")

To confirm that your system is still able to sleep, open a terminal and enter:

sudo systemctl suspend

If that does not work, you seem to have an "inhibitor", some code that prevents your system to go to sleep. Check this answer on how to find out...

Update

In xfce you'll always see the the powermanager listed - this is ok and the standard. If this is the only line, there are no inhibitors that will interfere with the powermanagement.

Update2

After we discussed some missing information, it seems that your system can't sleep. As you tried "systemctl suspend" in vain, some driver must be the culprit.

Getting a decent answer would include a list of drivers you are using - add them to your question. Use

inxi -F
jp flag
`systemd-inhibit --list --mode=block` shows `xfce4-power-manager`. Now what?
kanehekili avatar
zw flag
Yeah, the power-manager is responsible for it. But what does the rest say? On my device it looks like this: `xfce4-power-manager 1000 yourUserName 896 xfce4-power-man handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch xfce4-power-manager handles these events block`
jp flag
It says `handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch`
kanehekili avatar
zw flag
I've updated my answer - you've got no problem concerning an inhibitor... What happens if you enter in the terminal: `sudo systemctl suspend` ?
jp flag
`sudo systemctl suspend` seems to work. At least the screen goes black. This laptop is pretty quiet when idle so can't tell for sure if it's suspended or just entered screen saving mode or something like that. When I close the lid or choose "suspend" in xfce4-session-manager the screen goes dark, but the laptop is actually running. Only way to understand is by checking battery usage after a few hours.
jp flag
Here's an update: `sudo systemctl suspend` does not work. I realized this after an hour of video call making the laptop running hot. After `sudo systemctl suspend` the screen goes black and the computer becomes unresponsive to key presses, but the fan keeps running. Before updating to 20.04 (in 18.04), suspend would immediately stop everything, including the fans. So I think suspend is not working.
kanehekili avatar
zw flag
I'd setup my Ubuntu to 20.04 instead of "upgrading" it. It has never worked with my hardware... I know it's a pain to save everything and set it up again.
jp flag
This is already installed from scratch. By "upgrade" I mean installing (from scratch) 20.04 to a 18.04 system. Sorry for confusing wording.
kanehekili avatar
zw flag
See my **Update2**. Copy the output of the command and paste it into your answer & format it. Using comments will render that unreadable
jp flag
`inxi -F` output added
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.