summaryrefslogtreecommitdiff
path: root/x11-drivers/nvidia-drivers/files
diff options
context:
space:
mode:
Diffstat (limited to 'x11-drivers/nvidia-drivers/files')
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-470.conf8
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-545.conf8
-rw-r--r--x11-drivers/nvidia-drivers/files/system-sleep.elogind7
3 files changed, 17 insertions, 6 deletions
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-470.conf b/x11-drivers/nvidia-drivers/files/nvidia-470.conf
index a20f2a19..1ba489dd 100644
--- a/x11-drivers/nvidia-drivers/files/nvidia-470.conf
+++ b/x11-drivers/nvidia-drivers/files/nvidia-470.conf
@@ -11,10 +11,12 @@ alias nouveau off
# Enabling may possibly cause issues with SLI and Reverse PRIME.
#options nvidia-drm modeset=1
-# Suspend options. Allocations=0 recommended over =1 unless enable nvidia's
-# systemd sleep services (nvidia-hibernate, nvidia-resume, nvidia-suspend).
+# Suspend options. Note that Allocations=1 requires suspend hooks currently
+# only used when either systemd or elogind is used to suspend. If using
+# neither or have issues, try Allocations=0 (revert if it does not help
+# as =0 is not recommended).
options nvidia \
- NVreg_PreserveVideoMemoryAllocations=0 \
+ NVreg_PreserveVideoMemoryAllocations=1 \
NVreg_TemporaryFilePath=/var/tmp
# !!! Security Warning !!!
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-545.conf b/x11-drivers/nvidia-drivers/files/nvidia-545.conf
index ecb549e1..e8ca7805 100644
--- a/x11-drivers/nvidia-drivers/files/nvidia-545.conf
+++ b/x11-drivers/nvidia-drivers/files/nvidia-545.conf
@@ -16,10 +16,12 @@ alias nouveau off
# experimental, "may" cause issues X mode switching, sleep, or more).
#options nvidia-drm fbdev=1
-# Suspend options. Allocations=0 recommended over =1 unless enable nvidia's
-# systemd sleep services (nvidia-hibernate, nvidia-resume, nvidia-suspend).
+# Suspend options. Note that Allocations=1 requires suspend hooks currently
+# only used when either systemd or elogind is used to suspend. If using
+# neither or have issues, try Allocations=0 (revert if it does not help
+# as =0 is not recommended).
options nvidia \
- NVreg_PreserveVideoMemoryAllocations=0 \
+ NVreg_PreserveVideoMemoryAllocations=1 \
NVreg_TemporaryFilePath=/var/tmp
# !!! Security Warning !!!
diff --git a/x11-drivers/nvidia-drivers/files/system-sleep.elogind b/x11-drivers/nvidia-drivers/files/system-sleep.elogind
new file mode 100644
index 00000000..d36e2697
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/system-sleep.elogind
@@ -0,0 +1,7 @@
+#!/bin/sh
+case ${1-} in
+ pre) nvidia-sleep.sh suspend;;
+ # run in background given resume is flaky if elogind did not finish
+ post) nvidia-sleep.sh resume &;;
+ *) exit 1;;
+esac