My fan doesn't stop when I Sleep / `systemctl suspend`, and battery drops... fast

I just installed Tumbleweed on a brand new MSI gaming PC, with an elaborate cooling system and a lot of fans (I guess that’s needed when you have a GPU?).

My problem is that when I suspend (either by clicking Sleep or by running systemctl suspend), my screen goes black but I can still hear the fans… I tried to eliminate all potential running processes that could possibly hinder the sleeping process, but I couldn’t find anything preventing that behaviour.

As a result when “sleeping” my battery drops from 100% to 0% in about 11h30min (according to my tonight’s test). And that’s unplugged, no HDMI for example.

Does anyone know how to avoid this, or maybe at least establish a diagnosis of the problem? Thanks!

EDIT: after some research: I didn’t know the difference between sleep (suspend to RAM) and hibernate (suspend to disk).

→ Sleep is working fine, and consumes battery as expected.
→ Hibernate doesn’t work:

▶ systemctl hibernate
Call to Hibernate failed: Sleep verb "hibernate" not supported

…and:

▶ cat /sys/power/state 
freeze mem

I have run:

▶ sudo systemctl enable --now nvidia-suspend nvidia-hibernate nvidia-resume

… and rebooted, no better. (I have Intel Core i7 and hybrid Intel/Nvidia GPU)

Does anyone know of a way to re-install the Hibernate functionnality? Thanks!

I may be wrong as I have not used hibernate since OpenSUSE41 ( a few years ago) but you have to have a swap file (unencrypted) larger than main memory for the memory to be saved to.
Hibernate writes all memory to swap and grub reloads it when the computer is awaken.
If swap is not large enough - hibernate is disabled.

Also the grub line needs resume pointed to the swap partition - this line in /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT=

@ultome AFAIK the current kernel has security on to disable hibernation with secure boot enabled.

What would be the consequences of disabling secure boot?

@ultome This is probably a good explanation: SUSE and Secure Boot: The Details | SUSE Communities

I don’t understand it all. But:

  1. I tried setting more Swap space than RAM capacity, and added:
GRUB_CMDLINE_LINUX_DEFAULT="resume=UUID=%my_swap_partition_UUID% splash=silent quiet security=apparmor nosimplefb=1 mitigations=auto"

To my Grub parameters: still no hibernation.

And: I tried disabling Secure Boot in BiOS… Didn’t help either.

Am I doing something wrong, missing something? Thanks!

@ultome did you check the state of secure boot? Did you still boot the UEFI shim?

mokutil --sb-state
efibootmgr (check the BootCurrent entry in the list)

I don’t understand all of it, just enough to get that Secure Boot is a good thing for security, though not a necessary one if you’re confident enough to take the risk of disabling it. But:

I tried setting more swap space than RAM capacity (32.3GiB for swap for 31.2GiB of RAM), and added:

GRUB_CMDLINE_LINUX_DEFAULT="resume=UUID=%my_swap_partition_UUID% splash=silent quiet security=apparmor nosimplefb=1 mitigations=auto"

…to my Grub parameters: still no hibernation.

And:

I tried disabling Secure Boot in BiOS… Didn’t help either.

Am I doing something wrong, missing something? Thanks!

~                                                                                                      ⍉
▶ mokutil --sb-state
SecureBoot enabled

~                                                                                                      ⍉
▶ sudo efibootmgr
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0000,0002,0003,0004
Boot0000* opensuse-secureboot   HD(1,GPT,a2b9f725-f22b-4f40-86d8-1a110f34e653,0x800,0x100000)/File(\EFI\opensuse\shim.efi)
Boot0002* UEFI:CD/DVD Drive     BBS(129,,0x0)
Boot0003* UEFI:Removable Device BBS(130,,0x0)
Boot0004* UEFI:Network Device   BBS(131,,0x0)

I thought I had disabled secure boot… I’ll try disabling it again and see if it changes something

@ultome Try using YaST Bootloader to swap, then check the BIOS settings.

I disabled through the BiOS, but… At first I though hibernate worked at last (my fan stopped), but then on resume it was almost like a reboot, all my apps were closed as if I had just booted…

Can you explain more precisely?

@ultome Make sure the “Secure Boot Support” box is unchecked on this tab and press ok;
Screenshot from 2023-12-08 12-34-44

Then check the output from efibootmgr and should have two entries opensuse-secure and opensuse?


Done. However:

▶ sudo efibootmgr
[sudo] password for root: 
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0000,0002,0003,0004
Boot0000* opensuse-secureboot   HD(1,GPT,a2b9f725-f22b-4f40-86d8-1a110f34e653,0x800,0x100000)/File(\EFI\opensuse\shim.efi)
Boot0002* UEFI:CD/DVD Drive     BBS(129,,0x0)
Boot0003* UEFI:Removable Device BBS(130,,0x0)
Boot0004* UEFI:Network Device   BBS(131,,0x0)

…I still only have the secureboot option. I checked in the BiOS as well, it’s the only openSUSE boot option in there as well.

Hibernate still behaves pretty much like a reboot (just skipping the Grub menu).

Just trying to revive this thread! Is everyone out of ideas? Not being able to hibernate is a real inconvenience, because I have to shut my laptop down every time I know I won’t use it for more than 10 hours…

Could you share your equipment profile?
Use inxi for this.