This guide fixes hibernation issues on Linux systems with NVIDIA GPUs, specifically addressing the "PM: hibernation: resume failed (-5)" error caused by conflicts between early KMS and NVIDIA's video memory preservation.
When attempting to hibernate with an NVIDIA GPU, the system either:
- Fails to hibernate with error:
Call to Hibernate failed: Specified resume device is missing or is not an active swap device - Hibernates successfully but resumes as a fresh boot, losing all application state
- Shows error in logs:
nvidia 0000:01:00.0: PM: pci_pm_freeze(): nv_pmops_freeze [nvidia] returns -5
- NVIDIA proprietary drivers installed
- Swap space configured (swapfile or swap partition) with size ≥ RAM
- Root access to your system
First, identify your swapfile location and get the correct offset:
# Show active swap
swapon --show
# Get the UUID of the partition containing your swapfile
findmnt -no UUID -T /swap/swapfile
# Get the swapfile offset (IMPORTANT: This is unique to your system)
sudo btrfs inspect-internal map-swapfile -r /swap/swapfileNote: The offset command varies by filesystem:
- Btrfs:
sudo btrfs inspect-internal map-swapfile -r /swap/swapfile - ext4/other:
sudo filefrag -v /swap/swapfile | head -n 4 | tail -n 1 | awk '{print $4}' | sed 's/\.\.//'
Save these values - you'll need them in the next steps.
# Find your swap partition UUID
lsblk -o NAME,UUID,TYPE | grep swapYou won't need an offset for swap partitions.
Edit the Limine configuration:
sudo nano /etc/default/limineAdd or modify the resume parameters:
For swapfile:
KERNEL_CMDLINE[default]+="resume=UUID=YOUR-UUID-HERE resume_offset=YOUR-OFFSET-HERE"For swap partition:
KERNEL_CMDLINE[default]+="resume=UUID=YOUR-SWAP-UUID-HERE"Also update /etc/kernel/cmdline to include the same parameters.
Edit GRUB configuration:
sudo nano /etc/default/grubAdd to GRUB_CMDLINE_LINUX_DEFAULT:
For swapfile:
GRUB_CMDLINE_LINUX_DEFAULT="... resume=UUID=YOUR-UUID-HERE resume_offset=YOUR-OFFSET-HERE"
For swap partition:
GRUB_CMDLINE_LINUX_DEFAULT="... resume=UUID=YOUR-SWAP-UUID-HERE"
Then regenerate GRUB config:
sudo grub-mkconfig -o /boot/grub/grub.cfgEdit your boot entry (usually in /boot/loader/entries/):
sudo nano /boot/loader/entries/arch.confAdd to the options line:
For swapfile:
options ... resume=UUID=YOUR-UUID-HERE resume_offset=YOUR-OFFSET-HERE
For swap partition:
options ... resume=UUID=YOUR-SWAP-UUID-HERE
Create or edit the NVIDIA modprobe configuration:
sudo nano /etc/modprobe.d/nvidia.confAdd these lines:
options nvidia NVreg_PreserveVideoMemoryAllocations=1
options nvidia_drm modeset=1
Enable the NVIDIA power management services:
sudo systemctl enable nvidia-suspend.service
sudo systemctl enable nvidia-hibernate.service
sudo systemctl enable nvidia-resume.serviceThis is the key step that resolves the conflict between early KMS and NVIDIA hibernation.
Edit mkinitcpio configuration:
sudo nano /etc/mkinitcpio.confRemove NVIDIA modules from the MODULES array:
Change this:
MODULES=(nvidia nvidia_modeset nvidia_uvm nvidia_drm)
To this:
MODULES=()
Ensure the resume hook is present after filesystems:
HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block encrypt filesystems resume fsck)
The resume hook must come after filesystems and before fsck.
Note: If you have encrypted storage, ensure encrypt comes before filesystems.
Rebuild your initramfs with the new configuration:
For standard Arch/mkinitcpio:
sudo mkinitcpio -PFor Omarchy/limine-mkinitcpio:
sudo limine-mkinitcpio -PReboot your system:
sudo rebootAfter reboot, verify the configuration:
# Check that the resume offset is correct
cat /sys/power/resume_offset
# Check that PreserveVideoMemoryAllocations is enabled
cat /proc/driver/nvidia/params | grep PreserveVideoMemoryAllocationsThe output should show PreserveVideoMemoryAllocations: 1.
Now test hibernation:
systemctl hibernateYour system should hibernate completely and, upon powering back on, resume with all applications in their previous state.
- Verify your UUID and offset are correct:
cat /proc/cmdline | grep resume- Check that the resume hook is in your initramfs:
lsinitcpio /boot/initramfs-linux.img | grep resume- Check journal logs for errors:
sudo journalctl -b -1 | grep -i "PM:"- Verify NVIDIA services ran:
sudo journalctl -b -1 -u nvidia-hibernate.serviceIf you see "nv_pmops_freeze returns -5", ensure you completed Step 5 correctly - this is the most common cause.
If you recreate your swapfile or it gets defragmented, you must:
- Get the new offset using the commands in Step 1
- Update your bootloader configuration (Step 2)
- Rebuild initramfs (Step 6)
- Reboot
The issue occurs because:
- Loading NVIDIA modules in early initramfs (early KMS) creates a conflict with
NVreg_PreserveVideoMemoryAllocations=1 - The NVIDIA driver tries to preserve video memory allocations across hibernation, but early KMS interferes with this process
- By removing NVIDIA modules from the initramfs and letting them load normally during boot, the hibernation/resume process can properly save and restore the GPU state
The NVIDIA drivers still load correctly - they just load later in the boot process, after the initramfs stage, which allows hibernation to work properly.
- Omarchy Linux with Limine bootloader
- NVIDIA GTX 1650 / RTX 2080TI
- NVIDIA driver version 590.48.01
- Encrypted Btrfs root with swapfile
This guide should work on any Arch-based distribution with similar configurations.
Solution derived from troubleshooting sessions and Arch Linux forum discussions regarding NVIDIA hibernation conflicts with early KMS.