[Solved] Can't suspend a Cinnamon 20.3 computer with a NVIDIA GTX 970

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
somelurker
Level 4
Level 4
Posts: 206
Joined: Fri Jul 01, 2016 6:10 pm

[Solved] Can't suspend a Cinnamon 20.3 computer with a NVIDIA GTX 970

Post by somelurker »

I'm running Cinnamon Mint 20.3 on a desktop with a Nvidia GTX 970. I'm very surprised that I can't suspend this machine because I explicitly tested suspending on the live USB before I installed it. I've tried all 4 available video drivers, and here are the results:

1. xserver-xorg-video-nouveau: Computer won't suspend. Trying to do so results in going to the lock screen but not a suspension.
2. nvidia-driver-390: Same result as nouveau driver
3. nvidia-driver-470: Computer suspends but won't wake up. If I press a key, the computer makes a sound that indicates it's coming out of suspend, but the display says "no signal" and I have to force reboot with the power button.
4. nvidia-driver-510: Same result as nvidia-driver-470

Is all hope lost? I upgraded from Mate to Cinnamon after the Cinnamon live USB was able to suspend my system and wake me from the suspension. I had no idea the actual installation would be different.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
SMG
Level 25
Level 25
Posts: 31778
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Can't suspend a computer with a NVIDIA GTX 970

Post by SMG »

somelurker wrote: Thu May 26, 2022 1:24 am I'm running Cinnamon Mint 20.3 on a desktop with a Nvidia GTX 970. I'm very surprised that I can't suspend this machine
The workaround mentioned in this post has worked for many people. If you need detailed instructions for editing the file then see this post and the subsequent ones in that topic.

I seem to recall the feedback I've received that it worked was with the Nvidia-470. The Nvidia-510 is a still a relatively new driver and I do not recall if I have received feedback on it and the workaround yet.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
somelurker
Level 4
Level 4
Posts: 206
Joined: Fri Jul 01, 2016 6:10 pm

Re: Can't suspend a computer with a NVIDIA GTX 970

Post by somelurker »

Thanks! The "exit 0" trick actually worked! This problem was a major thorn in my side. I've come to accept that some things are inevitably broken when I try to install Linux on this computer. But thanks to people like you, there are fewer of those broken things over time.

In retrospect, I suppose it should come as no surprise that a change in desktop environment would be insufficient to change how the sleep function worked. But my upgrade to Cinnamon wasn't for nothing. To be honest, the desktop icon arrangement feature alone justifies the change. In Mate, just watching the icons move around and mess themselves up every time I copy a new file or install a new app was frustrating. I've now tested all 3 flavors of Mint (Cinnamon, Mate, and XFCE).

As for the reason why sleep worked properly in the live USB, I'm guessing either the kernel version was different or special startup settings were applied (perhaps a nomodeset?). All I know is that the mere fact that the live USB worked is no longer a guarantee that an installation will as well. These days I use the Mint live USB more for access to a terminal and apps like GParted than to actually try out whether it works.
User avatar
SMG
Level 25
Level 25
Posts: 31778
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Can't suspend a computer with a NVIDIA GTX 970

Post by SMG »

somelurker wrote: Thu May 26, 2022 5:29 pm Thanks! The "exit 0" trick actually worked!
Glad to hear that. Which driver version are you using?
somelurker wrote: Thu May 26, 2022 5:29 pmAs for the reason why sleep worked properly in the live USB, I'm guessing either the kernel version was different or special startup settings were applied (perhaps a nomodeset?).
Usually, sleep does not work without a driver installed. Considering Nvidia drivers are proprietary, I suspect you were using an older version of the nouveau open-sources driver (old than the latest one available) in the live session.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
somelurker
Level 4
Level 4
Posts: 206
Joined: Fri Jul 01, 2016 6:10 pm

Re: [Solved] Can't suspend a Cinnamon 20.3 computer with a NVIDIA GTX 970

Post by somelurker »

I decided to start with the newest version (nvidia-driver-510) and then work backwards towards the older version if needed, but the exit 0 trick ended up working with nvidia-driver-510, so I stopped there!

I tried digging into why the trick works but even after following the linked thread I couldn't quite figure out why. The first link you posted lead to another thread where someone just mentioned "exit 0" out of the blue. I guess the source got lost somewhere along the way. I was only able to follow the source of the trick to evil-harry-dread's post here: viewtopic.php?p=2100602#p2100602

Oh well. For now I'm just happy that I have a working system. Not having suspend was a fairly serious problem; it forced me to choose between wasting time turning off/on the computer constantly and leaving it on wasting electricity.
User avatar
SMG
Level 25
Level 25
Posts: 31778
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: [Solved] Can't suspend a Cinnamon 20.3 computer with a NVIDIA GTX 970

Post by SMG »

somelurker wrote: Thu May 26, 2022 6:08 pm I decided to start with the newest version (nvidia-driver-510) and then work backwards towards the older version if needed, but the exit 0 trick ended up working with nvidia-driver-510, so I stopped there!
Just a heads-up that one person has given me feedback that each time they updated a kernel or the Nvidia driver, they had to add that back in.
somelurker wrote: Thu May 26, 2022 6:08 pmI tried digging into why the trick works but even after following the linked thread I couldn't quite figure out why.
I have not looked into it specifically, but based on what I've seen in posts on this forum, it seems to affect only certain GPUs (and not all of them). We get a lot of posts from 700 series GPUs, a few 900 series GPUs, and I've also see a few Quadros helped with the workaround.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
somelurker
Level 4
Level 4
Posts: 206
Joined: Fri Jul 01, 2016 6:10 pm

Re: [Solved] Can't suspend a Cinnamon 20.3 computer with a NVIDIA GTX 970

Post by somelurker »

Yeah I feared that might be the case. Nvidia driver updates are infrequent. The kernel updates would be the main problem. In my last installation, my setup was weird enough that I had to occasionally move the EFI boot entries around every time grub was updated. This graphics card problem would be yet another file I need to update occasionally.

Is there an easy way to write a script to automatically insert the line into the file after every kernel update? I don't necessarily need to check for a kernel update. I could just automatically update the file every time the computer boots up, if needed. The logic would go something like this:

1. Check whether "exit 0" is the second (or third line)
2. If yes, quit. If not, insert line and save file

A weaker solution would be to have a script file that could be manually executed whenever I see a kernel update in Update Manager; I manually do all my updates at the moment. This weaker solution would fail were I to enable automatic updates though.
User avatar
SMG
Level 25
Level 25
Posts: 31778
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: [Solved] Can't suspend a Cinnamon 20.3 computer with a NVIDIA GTX 970

Post by SMG »

somelurker wrote: Thu May 26, 2022 11:53 pmIs there an easy way to write a script to automatically insert the line into the file after every kernel update?
I would presume there is, but that is not part of my current skill set with regards to helping others. We do have a Scripts & Bash section of the forum if you would like to pursue that option.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
Locked

Return to “Graphics Cards & Monitors”