Skip to content

fix: stop G-SYNC dropping the monitor to its lowest refresh rate - #154

Merged
mtucciarone merged 3 commits into
mtucciarone:mainfrom
Kendoismebutmaybenot:fix/gsync-refresh-drop
Nov 12, 2026
Merged

mtucciarone merged 3 commits into
mtucciarone:mainfrom
Kendoismebutmaybenot:fix/gsync-refresh-drop

Conversation

@Kendoismebutmaybenot

@Kendoismebutmaybenot Kendoismebutmaybenot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🐛 What's Fixed

  • With an NVIDIA card and G-SYNC set to "windowed and full screen mode", focusing Eden made the whole monitor drop to its lowest refresh rate (40 Hz on a 240 Hz panel) whenever Eden was idle. The screen flickers and the cursor stutters until another window is focused.

Why it happens

The driver ties the monitor's refresh rate to whichever focused app presents straight to the screen. Eden only draws when something changes, so an idle Eden window presents nothing and the panel falls to its floor. Explorer and browsers present the same way and avoid this only because NVIDIA ships a driver profile for them with G-SYNC forced off. Eden is unknown to the driver, so it gets treated like a game.

Switching to vsync does not help. I tested PresentMode::AutoVsync and the panel still dropped to 40 Hz, so the present mode from #119 is left as it is.

The fix

On startup, before the graphics device is created, Eden registers the same driver setting for its own exe through NVAPI (G-SYNC application override = force off, the value NVIDIA's own Explorer profile uses). New file src/core/nvidia_profile.rs, one call in main.rs.

  • No new dependencies. nvapi64.dll is loaded from System32 only, and without an NVIDIA driver nothing happens.
  • If the exe already has a G-SYNC value in a driver profile, it is left alone, so anyone who wants G-SYNC in Eden can turn it back on in the NVIDIA settings and keep it.
  • Asking the driver takes about 125 ms (the driver loading its profile database). Eden only waits for that on the first launch and after the driver changes. On other launches the same check runs on a background thread. A small marker file in %LOCALAPPDATA%\ExplorerEden\nvidia_profile.txt records the exe name and driver file it was confirmed for.

How I measured it

I counted real vertical blanks (D3DKMTWaitForVerticalBlankEvent) on a 2560x1440 240 Hz G-SYNC monitor, RTX 5070 Ti, driver 32.0.16.2114, with Eden focused:

Build Refresh rate, Eden focused Longest gap between refreshes
1.3.0 150 to 172 Hz average 24.8 ms (40 Hz)
1.3.0 with AutoVsync same dips 24.8 ms
This fix, first launch, no profile beforehand 240.0 Hz 4.6 ms

The 240 Hz row was measured on the first launch, which shows the driver picks the profile up in the same process when it is written before the device is created.

🔗 Related Issues

None filed.

With G-SYNC enabled for windowed apps, the NVIDIA driver ties the monitor's refresh rate to the focused app. Eden draws on demand, so an idle window pulled a 240 Hz panel down to 40 Hz. Register the same driver profile setting NVIDIA ships for Explorer (G-SYNC forced off) for Eden's own exe, before the graphics device is created. An existing G-SYNC value for the exe is left alone.

@mtucciarone mtucciarone left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall it looks like a great attempt from what's likely an LLM. I'll have to test this locally first but if you don't mind making a quick refactor to get these tests out of the src files that would be great.

Thanks!

Some(Outcome::Written)
}

#[cfg(test)]

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening this up @Kendoismebutmaybenot. Do you mind moving all of the tests into the appropriate tests/unit folder in the repo please? Thanks 🙏🏽

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening this up @Kendoismebutmaybenot. Do you mind moving all of the tests into the appropriate tests/unit folder in the repo please? Thanks 🙏🏽

▎ Done, the tests are in tests/unit/nvidia_profile.rs now, using the same #[path] include as the other unit tests, so they can still reach the module's private helpers. And yes, I made this with the help of Claude. I've tested it on my own setup and the refresh-rate drop is gone. Let me know if you want anything else changed

Same #[path] include the other unit tests use, so they still reach the
module's private helpers through super::*.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mtucciarone
mtucciarone merged commit d721294 into mtucciarone:main Nov 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants