Jump to content

NVIDIA GeForce Experience overlay preventing your display from sleeping? I fixed it!

nuzayets

Like in the title. NVIDIA's had this bug with GeForce Experience for 3 or more years now, it happens if you have a joystick plugged in. People have basically had to choose to either turn the overlay off, or unplug their joysticks every time. So I got annoyed and decided to fix it myself.

 

The fix is pretty simple to apply:

  1. Disable the GeForce Experience overlay while we apply the patch.
    7j90g4V.png
  2. Open PowerShell as an Administrator (you need to be able to write to GFE's directory):
    - Hit Winkey+R, type powershell and press CTRL+SHIFT+Enter.
    - OR hit the Start menu, begin typing powershell, right click on Windows PowerShell and click Run as administrator.
  3. Paste the following code:
    ## Make sure NVIDIA GeForce Experience overlay is disabled before running this script.
    ## PowerShell should be started as Administrator.
    ## This was tested against GeForce Experience:
    ##  - 3.20.5.70
    ##  - 3.20.5.83
    
    $path = Split-Path ((Get-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\GeForceExperience\Shell\Open\Command).'(default)' -replace '"',"")
    $file = [System.IO.File]::ReadAllBytes("$path\libcef.dll")
    $offset = 0x61e0ae8
    if($file[$offset] -eq 4 -and $file[$offset+2] -eq 5 -and $file[$offset+4] -eq 8) {
    	Stop-Process -Name "NVIDIA GeForce Experience" -ErrorAction SilentlyContinue
    	Stop-Process -Name "NVIDIA Share" -ErrorAction SilentlyContinue
    	[System.IO.File]::WriteAllBytes("$path\libcef.dll.bak", $file)
    	$file[$offset] = 6    # Replace usage 0x04 (Joystick) with keyboard
    	$file[$offset+2] = 6  # Replace usage 0x05 (Gamepad) with keyboard
    	$file[$offset+4] = 6  # Replace usage 0x08 (Multi-axis Controller) with keyboard
    	[System.IO.File]::WriteAllBytes("$path\libcef.dll", $file)
    } else {
    	Write-Output "Your libcef.dll doesn't seem to match the version this file was tested against."
    }
    

     

  4. Re-enable the GeForce Experience overlay.

If you want to know why this particular byte in this particular file, I've written up how I debugged the issue here: https://details-of-note.blogspot.com/2020/12/nvidia-3-year-old-bug.html

Until NVIDIA issues a patch, I will try to keep the patching script up to date here: https://github.com/nuzayets/rawinput-debug

 

I hope this will be of interest to the community here ... If NVIDIA sees it, maybe they'll actually fix it and I won't have to keep updating the patch.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×