From 61848c1910bab107eafecbda38f1d3164a809444 Mon Sep 17 00:00:00 2001 From: Nicolas Dorier Date: Fri, 1 May 2026 23:32:09 +0900 Subject: [PATCH] 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. --- install/config/hardware/nvidia.sh | 6 ++++++ migrations/1777018591.sh | 9 +++++++++ 2 files changed, 15 insertions(+) create mode 100755 migrations/1777018591.sh diff --git a/install/config/hardware/nvidia.sh b/install/config/hardware/nvidia.sh index 5fb37232..e5605cae 100644 --- a/install/config/hardware/nvidia.sh +++ b/install/config/hardware/nvidia.sh @@ -24,6 +24,12 @@ if [[ -n $NVIDIA ]]; then # Configure modprobe for early KMS sudo tee /etc/modprobe.d/nvidia.conf </dev/null options nvidia_drm modeset=1 +EOF + + # Ensure NVreg_UseKernelSuspendNotifiers is used for hibernation + sudo tee -a /etc/modprobe.d/nvidia.conf </dev/null +options nvidia NVreg_PreserveVideoMemoryAllocations=0 +options nvidia NVreg_UseKernelSuspendNotifiers=1 EOF # Configure mkinitcpio for early loading diff --git a/migrations/1777018591.sh b/migrations/1777018591.sh new file mode 100755 index 00000000..1649b6ab --- /dev/null +++ b/migrations/1777018591.sh @@ -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 </dev/null +options nvidia NVreg_PreserveVideoMemoryAllocations=0 +options nvidia NVreg_UseKernelSuspendNotifiers=1 +EOF + sudo limine-update +fi