suspend – Laptop randomly shutting down / suspending after a few minutes. 20.04.2 LTS

I turn the latop on, I log in, then after 1-2 minutes the laptop shuts down.
Just before it turns off completely, it goes to the lock screen.

This has started today – and I don’t think I installed any updates in the last few days.

This is output from kern.log for the last 5 shutdowns.

May 26 17:23:52 jamest-Hybris kernel: (   17.087827) mce: CPU2: Package temperature/speed normal
May 26 17:23:52 jamest-Hybris kernel: (   17.087828) mce: CPU6: Package temperature/speed normal
May 26 17:23:52 jamest-Hybris kernel: (   17.193695) rfkill: input handler disabled
May 26 17:25:21 jamest-Hybris kernel: (  106.238840) wlp2s0: deauthenticating from 44:e9:dd:0c:a0:07 by local choice (Reason: 3=DEAUTH_LEAVING)
May 26 17:25:23 jamest-Hybris kernel: (  108.184069) PM: suspend entry (deep)
...
May 26 17:29:01 jamest-Hybris kernel: (   16.522151) rfkill: input handler enabled
May 26 17:29:03 jamest-Hybris kernel: (   18.299032) FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
May 26 17:29:03 jamest-Hybris kernel: (   18.385620) rfkill: input handler disabled
May 26 17:30:28 jamest-Hybris kernel: (  103.505036) wlp2s0: deauthenticating from 44:e9:dd:0c:a0:07 by local choice (Reason: 3=DEAUTH_LEAVING)
May 26 17:30:30 jamest-Hybris kernel: (  105.493465) PM: suspend entry (deep)
...
May 26 17:32:32 jamest-Hybris kernel: (   41.950990) mce: CPU7: Package temperature/speed normal
May 26 17:32:32 jamest-Hybris kernel: (   41.950990) mce: CPU4: Package temperature/speed normal
May 26 17:32:32 jamest-Hybris kernel: (   41.950991) mce: CPU0: Package temperature/speed normal
May 26 17:33:35 jamest-Hybris kernel: (  104.349444) wlp2s0: deauthenticating from 44:e9:dd:0c:a0:07 by local choice (Reason: 3=DEAUTH_LEAVING)
May 26 17:33:39 jamest-Hybris kernel: (  109.180738) PM: suspend entry (deep)
...
May 26 17:35:47 jamest-Hybris kernel: (   15.053073) rfkill: input handler enabled
May 26 17:35:48 jamest-Hybris kernel: (   15.404181) IPv6: ADDRCONF(NETDEV_CHANGE): wlp2s0: link becomes ready
May 26 17:35:49 jamest-Hybris kernel: (   16.834008) rfkill: input handler disabled
May 26 17:37:16 jamest-Hybris kernel: (  103.671054) wlp2s0: deauthenticating from 44:e9:dd:0c:a0:07 by local choice (Reason: 3=DEAUTH_LEAVING)
May 26 17:37:20 jamest-Hybris kernel: (  108.026954) PM: suspend entry (deep)

I haven’t (knowingly) done anything to trigger the suspend.

Some system information

sudo lshw -C video

  *-display                 
       description: VGA compatible controller
       product: UHD Graphics 630 (Mobile)
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 00
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:137 memory:a0000000-a0ffffff memory:90000000-9fffffff ioport:4000(size=64) memory:c0000-dffff

lspci

00:00.0 Host bridge: Intel Corporation 8th Gen Core 4-core Processor Host Bridge/DRAM Registers (Coffee Lake H) (rev 07)
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 630 (Mobile)
00:04.0 Signal processing controller: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem (rev 07)
00:12.0 Signal processing controller: Intel Corporation Cannon Lake PCH Thermal Controller (rev 10)
00:14.0 USB controller: Intel Corporation Cannon Lake PCH USB 3.1 xHCI Host Controller (rev 10)
00:14.2 RAM memory: Intel Corporation Cannon Lake PCH Shared SRAM (rev 10)
00:15.0 Serial bus controller (0c80): Intel Corporation Cannon Lake PCH Serial IO I2C Controller #0 (rev 10)
00:15.1 Serial bus controller (0c80): Intel Corporation Cannon Lake PCH Serial IO I2C Controller #1 (rev 10)
00:16.0 Communication controller: Intel Corporation Cannon Lake PCH HECI Controller (rev 10)
00:17.0 SATA controller: Intel Corporation Cannon Lake Mobile PCH SATA AHCI Controller (rev 10)
00:1d.0 PCI bridge: Intel Corporation Cannon Lake PCH PCI Express Root Port #9 (rev f0)
00:1d.5 PCI bridge: Intel Corporation Cannon Lake PCH PCI Express Root Port #14 (rev f0)
00:1d.6 PCI bridge: Intel Corporation Cannon Lake PCH PCI Express Root Port #15 (rev f0)
00:1f.0 ISA bridge: Intel Corporation HM470 Chipset LPC/eSPI Controller (rev 10)
00:1f.3 Audio device: Intel Corporation Cannon Lake PCH cAVS (rev 10)
00:1f.4 SMBus: Intel Corporation Cannon Lake PCH SMBus Controller (rev 10)
00:1f.5 Serial bus controller (0c80): Intel Corporation Cannon Lake PCH SPI Controller (rev 10)
02:00.0 Network controller: Intel Corporation Wireless-AC 9260 (rev 29)
03:00.0 Unassigned class (ff00): Realtek Semiconductor Co., Ltd. RTL8411B PCI Express Card Reader (rev 01)
03:00.1 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 12)

suspend-then-hibernate works, how to use it by default instead of suspend

I’ve tested the mode suspend-then-hibernate succesfully (sudo systemctl suspend-then-hibernate). I’ve found out how to use it when the lid is closed by editing /etc/systemd/logind.conf. However, that does not work for the power button. So, how can I configure Ubuntu/Gnome to use suspend-then-hibernate by default for the power button and the menu?

suspend – Execute a script upon a blank screen (screen off) in Ubuntu

Once the system is inactive, in 10 minutes it goes in a blank screen (but not in sleep!) and that’s precisely the moment I’d like to execute a long-running script in a terminal while I go for a coffee or take a break.
When I come back and “wake up” the system (although technically it’s not “sleeping”), I can manually stop the running program that has been executed at the screen off.

Example of such a command:

/usr/bin/screen -S screen-off -dm my-command

There is a bunch of similar questions (Execute a script upon logout/reboot/shutdown in Ubuntu) but they address services that are executed upon the sleep and wake up and this does not suit my needs.

suspend – 20.04 Wakeup from wireless keyboard/mouse only works with AC power

Using Ubuntu 20.04
Recently I bought an external monitor to help my eyes. I have 14″ FHD laptop.
All was good, until I realized that if I was on battery power and laptop was suspended, it will not wake up from wireless USB keyboard/mouse.
I landed up here
Wake up from suspend using wireless USB keyboard or mouse (for any Linux Distro)

But that did not help when laptop was sleeping on battery.

can anyone please help me with this.

NOTE: I suspend my laptop and switch off power before going to bed.

suspend – Ubuntu 20.04 briefly displays screen contents when waking up

I am new to Ubuntu/Linux

I just purchased a brand new Dell Precision 7550 with Ubuntu 20.04

I have set my account to ask for a password when waking up. When the system wakes up, it displays the full contents on the screen for 2 seconds before hiding the screen and asking for the password.

I am not used to this behavior in either Windows systems or Mac OS systems, where the screen goes directly to the lock screen upon waking up.

I am guessing there is some setting that I can use to have the Ubuntu machine wake up and NOT display the contents of the screen before showing the lock screen.

Thanks for any advice.

nvidia – Slow wake up after suspend

I’m running Ubuntu 21.04 on a HP laptop with intel i5-7300HQ and Nvidia 1050 mobile with Nvidia460-proprietary driver and X11 system.

When I suspend my laptop and wake it up, the laptop power up but the screen was frozen with black screen and only _ forzen on the screen.

After about 1 min, log in screen appear and I can login to my laptop.

But graphic card was change to integrate intel HD630 with Wayland.

For the swap, I use

/dev/nvme0n1p2          partition   19530748    0   -2```

boot – Ubuntu 20.04 Seems to Suspend When Installing on Tablet

I’m trying to install Ubuntu 20.04 Desktop on a Teguar 2945-10 found here: https://teguar.com/10-inch-fanless-panel-pc-tp-2945-10/

The issue is, when I try to install Ubuntu via a bootable USB, the screen will oftentimes go black and become non-responsive. Almost as if Ubuntu is erroneously suspending the OS during installation.

I’ve found that adding acpi=off to the kernel boot params will work. I’ve also tried nomodeset but I’ve actually found that’s significantly worse.

I have noticed that the file checking on the bootable USB warns about 1 error so I’m attempting to recreate the bootable USB but for some reason, the tablet didn’t recognize it because I think it wasn’t marked as a UEFI bootable device.

Is there something I’m missing from the installation process? The tablets do seem to have UEFI-enabled firmware on it. Do I need to handle this as a special case?

drivers – How to remove snd_hda_intel before suspend and reload it after resume?

Setup

  • OS: Ubuntu 20.04
  • Kernel: 5.8.2
  • GPU: GeForce RTX 2070 Mobile
  • Laptop: MSI GS65 8SF

Problem

When I suspend my laptop the second monitor, connected to the HDMI port that is handled by the GPU, doesn’t wake up.

Doing a lot of research in the nvidia dev-talk forum and asking in the alsa mailing list I discover that is not a problem of the nvidia drivers but it’s a problem related to the snd_hda_intel driver that is not able to handle correctly the audio controller of the GPU.

I found out that if I blacklist snd_hda_intel the problem is corrected and everything works well, apart from the audio of course.

I would like to know if there is a way to unload the driver before the suspend for loading it back on resume.

Of course a simple script that is doing a modprobe -r before the suspend operation is not working because the driver is in use.

Already tried

Even if I wrote a precise setup this is a problem that is going on since ubuntu 18.04 and I already tried a lot of different kernels. The problem is always the same.

last but not least

Of course if you have any other suggestion to fix the problem is welcome.

suspend – Different behaviour when closing laptop lid depending on power source – Ubuntu 20.04

I am new to using Ubuntu and I wanted to replicate my laptop’s behaviour from when I was running Windows. I would like to make it so that closing the lid triggers a different action depending on the current power supply:

  • when on battery – hibernate
  • when plugged in – suspend

I found multiple solutions that alter the /etc/systemd/logind.conf file, but changing the configuration there applies the action regardless of the power supply.

I also found answers that use dconf Editor, but that doesn’t seem to work for me.
I have the following settings, but the laptop always suspends when I close the lid.

enter image description here

Is there any other way of accomplishing said behaviour? Or does anyone have an idea why is the dconf Editor setting not working for me?