third step :
sudo gedit /etc/initramfs-tools/modules and add the following modules
nvidia
nvidia_modeset
nvidia_uvm
nvidia_drm
fourth step :
sudo update-initframs -k “yourkernel” -u
fifth step :
reboot and you are done .
Note : if are not on Ubuntu follow this:
PolicyKit Local Authority policy to enable suspend and hibernate for all users. Should be installed into /var/lib/polkit-1/localauthority/90-mandatory.d or /etc/polkit-1/localauthority/90-mandatory.d
file to edit under the directory mentionned : enable-suspend-and-hibernate.pkla
copy this text and save and continue other steps
[Completely disable suspend and hibernate]
Identity=unix-user:*
Action=org.freedesktop.upower.suspend;org.freedesktop.upower.hibernate;org.freedesktop.login1.suspend*;org.freedesktop.login1.hibernate*
ResultAny=nyes
ResultInactive=yes
ResultActive=yes
[Disable hibernate by default in upower]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes
[Disable hibernate by default in logind]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.handle-hibernate-key;org.freedesktop.login1;org.freedesktop.login1.hibernate-multiple-sessions;org.freedesktop.login1.hibernate-ignore-inhibit
ResultActive=yes
@Mounir,
Thanks so much for your time. Just a couple of notes regarding grub and initramfs.
after updating grub run:
sudo update-grub
the update-initramfs options I typically use are:
sudo update-initramfs -u -k all
Just to make sure all installed kernels get updated. I usually only have a couple but it’s helpful.
For the “doesn’t work on ubuntu 18.04” issues, I suspect it’s a conflict between the NVIDIA driver and the Nouveau driver due to both being installed at the same time. try googling nouveau conflicts with nvidia to see if anything helps. I’m also having suspend, hibernate, resume issues on my 18.04 based distro.
It’s unfortunate that the distros seems to have removed all the configuration to support suspend, hibernate, resume rather than just allowing users to turn it off via gui configuration options if it doesn’t work for their computers. This causes the rest of us to have to figure out how to get it all put back in and up to date with current versions of what ever power management system is being used by our distros.
This is the output I got from bash when i executed your script omitting
echo -e “\e[1;38;5;166m - Fixing Nvidia no wake after suspend issue… \e[0m”
bc it may be incompatible. and was when I tried to run in bash. docs recommend using printf bc of compatibility issues with echo
.
.
.
shamrockstud@ras777:~$ bash fix-nvidia-suspend
[sudo] password for shamrockstud:
sed: -e expression #1, char 1: unknown command: `�'
fix-nvidia-suspend: line 5: /etc/default/grub’: Permission denied
fix-nvidia-suspend: line 6: /etc/initramfs-tools/modules”: Permission denied
fix-nvidia-suspend: line 7: /etc/initramfs-tools/modules”: Permission denied
fix-nvidia-suspend: line 8: /etc/initramfs-tools/modules”: Permission denied
fix-nvidia-suspend: line 9: /etc/initramfs-tools/modules”: Permission denied
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.8.0-59-generic
Found initrd image: /boot/initrd.img-5.8.0-59-generic
Found linux image: /boot/vmlinuz-5.8.0-53-generic
Found initrd image: /boot/initrd.img-5.8.0-53-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done
update-initramfs: Generating /boot/initrd.img-5.8.0-59-generic
update-initramfs: Generating /boot/initrd.img-5.8.0-53-generic