3

Suspend works with nouveau but it would be nice to get NVIDIA drivers also working. I have tried with 390.12 and older version but the result is the same. Everything was working before upgrade from 17.04.

I made an issue here: [1] https://devtalk.nvidia.com/default/topic/1029413/linux/blanc-screen-after-suspend-on-ubuntu-17-10-nvidia-390-12-driver/

And there is a "fix" here: [2] https://devtalk.nvidia.com/default/topic/919984/linux/-solved-resume-from-suspend-not-working-with-980-ti-drivers-352-370-kernels-3-16-4-4/7

Older question here: [3] black screen after resuming from suspend

Tipi
  • 91
  • are you able to solve this issue ? I am still battling when on nvidia using 17.10 – Scott Stensland Feb 22 '18 at 12:27
  • Nope. I think this is the discussion which we should follow: https://devtalk.nvidia.com/default/topic/1017185/linux/problem-with-resume-from-suspend-ubuntu-16-04-gt-940mx-/post/5266400/ – Tipi Jun 21 '18 at 14:51

4 Answers4

2

I too have been on a journey figuring out what might be causing these issues.

Often mentioned are kernel parameters, drivers and BIOS settings. And yes, they are all involved in some way. But what exactly is happening when the system suspends and then tries to come back from that?

The BIOS offers options for power management. These should be set in such a way the OS can take full control, so generally they should be disabled.

With that out of the way, the OS can do its thing. This basically means it acts on a trigger and then checks off a list of things to power off and stuff to save for when the system needs to power on again. Along this way, something goes wrong.

Since it seems to be specifically the NVIDIA graphics that goes wrong, that seems to me the thing to investigate. I then came across this interesting part of the NVIDIA docs: https://download.nvidia.com/XFree86/Linux-x86_64/435.17/README/powermanagement.html

The introduction gives a very plausible cause for our problems:

The NVIDIA Linux driver includes support for the suspend (suspend-to-RAM) and hibernate (suspend-to-disk) system power management operations, such as ACPI S3 and S4 on the x86/x86_64 platforms. When the system suspends or hibernates, the NVIDIA kernel drivers prepare in-use GPUs for the sleep cycle, saving state required to return these GPUs to normal operation when the system is later resumed.

The GPU state saved by the NVIDIA kernel drivers includes allocations made in video memory. However, these allocations are collectively large, and typically cannot be evicted. Since the amount of system memory available to drivers at suspend time is often insufficient to accommodate large copies of video memory, the NVIDIA kernel drivers are designed to act conservatively, and normally only save essential video memory allocations.

The resulting loss of video memory contents is partially compensated for by the user-space NVIDIA drivers, and by some applications, but can lead to failures such as rendering corruption and application crashes upon exit from power management cycles.

And NVIDIA has come up with a solution:

To better support power management with these types of applications, the NVIDIA Linux driver provides a custom power management interface intended for integration with system management tools like systemd.

When I looked at the driver files (proprietary drivers on Arch), it indeed list these systemd unit files. They are not enabled by default, as they are considered 'experimental'. But I gave it a shot, by simply enabling the mentioned services for suspend, resume and hibernate.

In short (on Arch):

sudo systemctl enable nvidia-suspend.service
sudo systemctl enable nvidia-hibernate.service
sudo systemctl enable nvidia-resume.service

After trying it out some time, most issues were gone, but the system would still occasionally show a black screen on resume. Looking through the logs, the errors were now clearly pointing to modesetting. I had tried out a few kernel parameters concerning this, but had removed everything to be able to determine what works and what doesn't.

So, focusing on the modesetting, I added the following parameter to the kernel:

nvidia-drm.modeset=1

And apparently, I did not have the specific NVIDIA kernel module yet, so:

sudo pacman -S linux-headers nvidia-dkms

Now I no longer have the errors about modesetting and resume works great, also faster/cleaner than before.

kasimir
  • 131
  • 4
  • I don't have to try anything, everything's working perfectly well for me with the solution outlined above – kasimir Aug 31 '21 at 08:25
  • I just wanted to point out that there is currently a bug with the scripts mentioned (they're not included) - but my comment was kind of inappropriate ;) - so here the link again to the https://forums.developer.nvidia.com/t/problem-with-resume-from-suspend-ubuntu-16-04-gt-940mx/51410/172 (still the same as from @TipiT) – rémy Aug 31 '21 at 15:44
  • For me finally the boot parameters acpi_osi=! acpi_osi="Windows 2009" made it work .. – rémy Aug 31 '21 at 20:40
  • Yay for Arch linux! – Slava Nov 04 '21 at 08:38
1

Ooh, you are another fellow victim of the Nvidia-related bricking that royally ticked me off on Tuesday. Here's what I did to un-brick myself. Start your computer, make sure it doesn't suspend while you're doing all this.

sudo apt install linux-headers-$(uname -r)

After that:

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install nvidia-396

cross fingers, reboot and you should be in business. Worked for me.

  • I got all up to date. It is definitely a bug: https://devtalk.nvidia.com/default/topic/1017185/linux/problem-with-resume-from-suspend-ubuntu-16-04-gt-940mx-/post/5266400/ – Tipi Jun 21 '18 at 14:53
  • Thank you! Reverting to the nvidia-390 did the trick for me. – Anibal Sanchez Jan 09 '21 at 20:56
1

I've been looking for a solution for several months with no hope. I ran into many posts about this suspend/resume issue related to Nvidia graphics under Linux.

I tried many things, none worked:

  1. Playing with kernel parameters.
  2. Blacklisted nouveau module, even removed it completely (package: xserver-xorg-video-nouveau).
  3. Reinstalled Nvidia proprietary drivers.

Recently, I tried something and it seems working so far.

Simply run the nvidia-settings tool as a root and save its settings into an X Configuration File. You could save the file as /etc/X11/xorg.conf (used to be the default location for xorg configuration) or as a conf file under /usr/share/X11/xorg.conf.d/ directory.

I will update this post if this solution stopped working. By the way, I tried this solution after removing nouveau that didn't solve the issue. So I am not sure if it was the conf file alone or a combination of creating the conf file and removing nouveau.

My system: Kubuntu 18.04, desktop, Nvidia-390 proprietary drivers.

Update: It worked for three suspends in a row, but stopped the forth time. It was suspended for 7 hours, and it woke up to a blank screen.

1

I was able to solve it by adding nomodeset to the grub file

  1. Edit the grub file

    sudo nano /etc/default/grub
    
  2. add the word nomodeset to the end of the GRUB_CMDLINE_LINUX_DEFAULT string, so, if it was

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" 
    

    it will now be

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset"
    
  3. Ctrl+O to save and press Enter

  4. update grub2 (or just grub on older distros):

    sudo update-grub2
    
  5. reboot

abu_bua
  • 10,783
Jatin-CBS
  • 667