-
-
Save bmcbm/375f14eaa17f88756b4bdbbebbcfd029 to your computer and use it in GitHub Desktop.
# Use systemd for managing NVIDIA driver suspend in drivers ====>>> PRIOR to version 470 <<<===== | |
# https://download.nvidia.com/XFree86/Linux-x86_64/450.66/README/powermanagement.html | |
# https://forums.developer.nvidia.com/t/unable-to-set-nvidia-kernel-module-parameters/161306 | |
# Please note: In Fedora Linux you may need to just install the xorg-x11-drv-nvidia-power pakage | |
# as sugested by @goombah88 in the comments below. | |
TMP_PATH=/var/tmp | |
TMPL_PATH=/usr/share/doc/nvidia-driver-460/ | |
echo "options nvidia NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=${TMP_PATH}" | sudo tee /etc/modprobe.d/nvidia-power-management.conf | |
sudo install --mode 644 "${TMPL_PATH}/nvidia-suspend.service" /etc/systemd/system | |
sudo install --mode 644 "${TMPL_PATH}/nvidia-hibernate.service" /etc/systemd/system | |
sudo install --mode 644 "${TMPL_PATH}/nvidia-resume.service" /etc/systemd/system | |
sudo install "${TMPL_PATH}/nvidia" /lib/systemd/system-sleep | |
sudo install "${TMPL_PATH}/nvidia-sleep.sh" /usr/bin | |
sudo systemctl enable nvidia-suspend.service | |
sudo systemctl enable nvidia-hibernate.service | |
sudo systemctl enable nvidia-resume.service | |
This also worked for me on an XPS 15 with a 3050 Ti (Ampere), Ubuntu 22.04, driver 550.
This fixed my pci_pm_suspend() and the PreserveVideoMemory stuff that would pop up and prevent laptop sleep.
If you deleted the service files, like nvidia-powerd.service or nvidia-persistenced.service, you either find them here or you can reinstall the drivers like this.
After reinstalling, I was able to see the service files, and then doing what the OP said worked.
Doing systemctl list-unit-files | grep nvidia
now gets me:
joao@joao-XPS-15-9520:~$ systemctl list-unit-files | grep nvidia
nvidia-hibernate.service enabled enabled
nvidia-persistenced.service static -
nvidia-resume.service enabled enabled
nvidia-suspend.service enabled enabled
Good luck!
This also worked for me on an XPS 15 with a 3050 Ti (Ampere), Ubuntu 22.04, driver 550.
...
So far seems to have work on my Lenovo Legion Slim 7 4060 PopOS kernel 6.8, also driver 550. Kind of frustrating because PopOS ships with nvidia drivers and so everytime I have to update OS it updates my drivers 😅 and I have to repeat this process.
nvidia-hibernate.service enabled enabled
nvidia-powerd.service enabled enabled
nvidia-resume.service enabled enabled
nvidia-suspend.service enabled enabled
This worked for me too! I have a Razer Blade 14 2022 with Nvidia driver 535.129.03 on Ubuntu 23.10