Fix hibernation on new NVidia drivers (#5519)

New drivers don't seem to expose the necessary suspend interface to use `NVreg_PreserveVideoMemoryAllocations`.

I explained the issues I experienced on:
https://github.com/basecamp/omarchy/discussions/5500

While https://github.com/omacom-io/omarchy-pkgs/pull/84 fixed part of
the issue, the default value of `NVreg_PreserveVideoMemoryAllocations`
is `2`, which doesn't work.
This commit is contained in:
Nicolas Dorier
2026-05-01 16:32:09 +02:00
committed by GitHub
parent 21f712c325
commit 61848c1910
2 changed files with 15 additions and 0 deletions
+6
View File
@@ -24,6 +24,12 @@ if [[ -n $NVIDIA ]]; then
# Configure modprobe for early KMS
sudo tee /etc/modprobe.d/nvidia.conf <<EOF >/dev/null
options nvidia_drm modeset=1
EOF
# Ensure NVreg_UseKernelSuspendNotifiers is used for hibernation
sudo tee -a /etc/modprobe.d/nvidia.conf <<EOF >/dev/null
options nvidia NVreg_PreserveVideoMemoryAllocations=0
options nvidia NVreg_UseKernelSuspendNotifiers=1
EOF
# Configure mkinitcpio for early loading
+9
View File
@@ -0,0 +1,9 @@
echo "Ensure NVreg_UseKernelSuspendNotifiers is used for hibernation"
if [[ -f /etc/modprobe.d/nvidia.conf ]] && ! grep -q "NVreg_PreserveVideoMemoryAllocations" /etc/modprobe.d/nvidia.conf; then
sudo tee -a /etc/modprobe.d/nvidia.conf <<EOF >/dev/null
options nvidia NVreg_PreserveVideoMemoryAllocations=0
options nvidia NVreg_UseKernelSuspendNotifiers=1
EOF
sudo limine-update
fi