Old GeForce Experience Bug Won’t Let Some PCs Sleep But There’s A Fix

geforce 3080
Troubleshooting issues with our PC can be a frustrating experience, especially if the cause of the problem is hard to detect. Power management bugs are often the worst to get sorted. It seems like either the system won't go to sleep, or it won't start up right after sleeping. Hardware these days seems to be pretty reliable, but the occasional software bug can get in the way. Such seems to be the case with NVIDIA's GeForce Experience, as many users have discovered removing the app lets their PCs return to a restful state. 

Many times it's easy to find the cause of sleep issues; just go to an administrative command prompt and enter powercfg /requests to see what's keeping the system up at night. However, that didn't work for one developer named Dmitry. Windows Power Management tools were of no help, as there were no outstanding requests. Dmitry outlined the investigative process on his blog, Details of Note, and it's a fun read. He'd gotten a new flight stick, and that was the only change to his machine, so it was time to go to Google.

What he discovered is that most folks who had a controller keeping a system awake managed to track it down to the GeForce Experience game library application. Why on earth would NVIDIA's optimization tool stop a PC from sleeping just because a controller changed? According to the Windows control panel, there wasn't any analog drift causing the system to register input. As it turns out, it's GeForce Experience's Shadow Play. When he turned off the overlay, the display would go to sleep like normal, but when the Shadow Play and sharing overlay was enabled, the system stayed awake. 

debug tool
Part of the code of Dmitry's debug tool for raw input

Shadow Play is a fun part of GeForce Experience that is always keeping track of what's going on in a game and recording the last little bit of game play using the GeForce GPU's video encoder. Then when something the player wants to save happens in the game, hit a hotkey and that video is committed to the disk. It's a great tool to share gameplay videos on YouTube or social media.

As Dmitry outlined in his blog post, as long as the controller was connected to the PC and Shadow Play was enabled, the system wouldn't let the display go to sleep. Unplug the joystick with the overlay enabled and it was fine. Similarly, turn off Shadow Play and leave the joystick enabled, and it also allows the display to sleep. Dmitry reported his findings to NVIDIA, but also wanted to take a crack at fixing it. 

He wrote a utility to keep track of when the system last received input from any device using Microsoft's XInput API, and it correctly identified that there was no input. Then he hooked into NVIDIA's Share utility with x64dbg to look for a cause. He discovered that the Shadow Play overlay was constantly polling raw input devices looking for anything, and if it found something it'd keep the display active. Just having the joystick plugged in seemed like enough to make the overlay think it found some input. So right here, we can see that if a PC isn't sleeping while GeForce Experience is running, unplugging any controller might be enough to fix it. So would quitting the GeForce Experience app.

However, if this is happening to you and you want to leave everything set up the way it is, Dmitry put together a PowerShell script to fix it. This script looks for the libcef.dll file used by GeForce Experience and examines some bytes at a specific address. If those byte values match up, then the script will kill the process and apply a one-byte patch library file. This prevents GFE from polling raw input, and the PC will resume power management as normal. However, since NVIDIA's support team has acknowledged Dmitry's report, we could just simply wait for a new version of the app to land.