"SOLVED" : SUSPEND , RESUMING and WAKEUP with nvidia370.28

Hi all

How to solve the issues of suspending , hibernating and wakeup with nvidia-370.28

first step :
Just open this file
sudo gedit /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla and enable hibernation


[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
ResultActive=yes

second step :

on /etc/default/grub :

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nvidia-drm.modeset=1 vga=0 rdblacklist=nouveau nouveau.modeset=0 "

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

regards
Mounir

PS : I hope it works for you
AMEN

1 Like

You never mentioned the file’s name.

great thanks Hussam . i added it .

Mounir, is this possibly a typo in your script?:

third step :
sudo gedit /etc/initramfs-tools/modules and add the following modules

nvidia
vidia_modeset
nvidia_uvm
nvidia_drm

you write “vidia_modeset”, I’m assuming it should be nvidia_modeset

johnatananderson
yes …it is a typo error.
great thanx

how can I run this command? When I tried to this command
"sudo update-initframs -k “yourkernel” -u "

Terminal shows me this error.
“update-initframs: command not found”
Can somebody help me? I am new to Linux world.

That’s a typo
sudo update-initramfs -u
should be sufficient.

The solution doesn’t work for ubuntu 18.04

Step 1.

[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

step 2.
GRUB_CMDLINE_LINUX_DEFAULT=“quiet splash nvidia-drm.modeset=1 vga=0 rdblacklist=nouveau nouveau.modeset=0”

step 3.
nvidia
nvidia_modeset
nvidia_uvm
nvidia_drm

step 4.
update-initramfs -u

and after reboot I still see black screen with a message
“alarms can be up to one month in the future”

I want to second the “doesn’t work for ubuntu 18.04”. Any other ideas for that OS?

@Mounir,
Thanks so much for your time. Just a couple of notes regarding grub and initramfs.

  1. after updating grub run:
    sudo update-grub

  2. 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.

Just createed an account to confirm that this solution worked in Ubuntu 20.04. Done after upgrading to the latest Nvidia Drivers 460.

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

A script to make this change

#!/bin/bash
 sudo sed -i "s/ResultActive=no/ResultActive=yes/g" /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla
  sudo bash -c 'echo -e GRUB_CMDLINE_LINUX_DEFAULT=\"quiet splash nvidia-drm.modeset=1 vga=0 rdblacklist=nouveau nouveau.modeset=0 \" >> /etc/default/grub'

  sudo tee -a /etc/initramfs-tools/modules <<EOF
  nvidia
  nvidia_modeset
  nvidia_uvm
  nvidia_drm
  EOF

  sudo update-grub
  sudo update-initramfs -u -k all