Can't manage hibernation with intel CPU and NVIDIA GPU

Hello,

I need some advice on managing the hibernation mode. I tried for hours, but by now I’m almost out of ideas…

I have an i7 12700K on a Gigabyte Aorus Z790 Elite AX with 32GB of RAM and a RTX 4060ti 16GB.
I installed grub instead of systemd for boot because I find it’s booting faster, and I want to use the snapper integration.

When fresh installed, CachyOS uses ZRAM for swap. As far as I know, ZRAM does not support hibernation.

So first I disable ZRAM

sudo systemctl stop systemd-zram-setup@zram0.service
sudo systemctl mask systemd-zram-setup@zram0.service

Then I start gparted and generate a swap partition with 32GB size.

swapon --show

gives

NAME TYPE SIZE USED PRIO
/dev/nvme2n1p8 partition 32G 0B -2

sudo blkid | grep swap

gives

/dev/nvme2n1p8: UUID="296e2d67-e962-45bb-8bb3-7a8fbf318334" TYPE="swap" PARTLABEL="CachyOS-swap" PARTUUID="b3e91e4a-1a2d-425f-9cc1-6675c4b3bbac"

Then edit fstab

sudo nano /etc/fstab

and add the UUID for swap

# <file system>             <mount point>  <type>  <options>  <dump>  <pass>
UUID=F102-B14B                            /boot/efi      vfat    defaults,umask=0077 0 2
UUID=09863c53-0bb0-474f-b780-ef2f1e288527 /              btrfs   subvol=/@,defaults,noatime,compress=zstd,commit=120 0 0
UUID=09863c53-0bb0-474f-b780-ef2f1e288527 /root          btrfs   subvol=/@root,defaults,noatime,compress=zstd,commit=120 0 0
UUID=09863c53-0bb0-474f-b780-ef2f1e288527 /srv           btrfs   subvol=/@srv,defaults,noatime,compress=zstd,commit=120 0 0
UUID=09863c53-0bb0-474f-b780-ef2f1e288527 /var/cache     btrfs   subvol=/@cache,defaults,noatime,compress=zstd,commit=120 0 0
UUID=09863c53-0bb0-474f-b780-ef2f1e288527 /var/tmp       btrfs   subvol=/@tmp,defaults,noatime,compress=zstd,commit=120 0 0
UUID=09863c53-0bb0-474f-b780-ef2f1e288527 /var/log       btrfs   subvol=/@log,defaults,noatime,compress=zstd,commit=120 0 0
UUID=5153b110-760b-4ccd-aad3-d2e379efe590 /home          btrfs   defaults,noatime,compress=zstd,commit=120 0 0
tmpfs                                     /tmp           tmpfs   defaults,noatime,mode=1777 0 0
UUID=296e2d67-e962-45bb-8bb3-7a8fbf318334 none swap defaults 0 0

after written, update the system by

sudo systemctl daemon-reload

thereafter edit grub

sudo nano /etc/default/grub

and add the swap for resuming in the line

GRUB_CMDLINE_LINUX_DEFAULT='nowatchdog nvme_load=YES loglevel=3 resume=UUID=296e2d67-e962-45bb-8bb3-7a8fbf318334'

after written, update the system with

sudo grub-mkconfig -o /boot/grub/grub.cfg

Then edit the HOOKS in file mkinitcpio.conf

sudo nano /etc/mkinitcpio.conf

add resume after udev in the line

HOOKS=(base udev resume autodetect microcode kms modconf block keyboard keymap consolefont plymouth filesystems)

after written, update the system with

sudo mkinitcpio -P

Then reboot the system and it should work.

This is the first time I can see the menu-point hibernation in the closing menu, so far so good.
As I can see and understand, the system goes to hibernation when I click. But when I start the system, it shows resuming, but when it’s ready it shows as if it has had a fresh boot.
I did a bit of searching with ChatGPT, and it told me that there could be a problem with the NVIDIA VRAM and it should be added

NVreg_PreserveVideoMemoryAllocations=1

in /etc/default/grub.

I did this, but no success.

I can’t believe that no one uses hibernation with Intel CPU and NVIDIA GPU and has not managed the setup for hibernation.
And yes: all necessary steps for power management in the UEFI are made.
Could anyone give some advice?

Thank you very much
Jo

Mhm, I dont have any expierence with hibernation, since I use personally only sleep which is working OOB.

You might want to do a bugreport at the nvidia forum? Does switching to the closed driver helps?

Hello Peter,

thank you for your reply!
Several hours later, I tried a few more things:

linux-cachyos-nvidia vs. linux-cachyos-nvidia-open does not make any difference… When I remember correct, you recommended to use -nvidia-open for the future in an older post.

You are right, Stand by works OOB. But for me, it was a problem that my Microsoft mouse and keyboard wakes up the computer when the mouse moves a tenth of a millimeter. That means when anyone leaves the house through the door beneath my room with the machine and the door is closed too hard, the mouse moves this tenth of a millimeter and the machine wakes up…

But there is a very neat solution I show here for others who could have this problem. I found it when searching for a solution months ago when I used LMDE6.

Read here and the easier solution here. This works for me.

At least, I can’t remember if hibernation worked on LMDE 6. Because I searched for the described Mouse problem this time.

Anyway, I hope there will be a solution in the future.

So keep on going with your great work!
Greets
Jo

1 Like

Try going into your BIOS settings and disabling “Wake On USB”. You’ll have to press the power button to wake your computer and your mouse will stop waking the PC.