osu-framework icon indicating copy to clipboard operation
osu-framework copied to clipboard

Disable threaded optimization on NVIDIA GPUs for Windows users

Open khang06 opened this issue 3 years ago • 3 comments

Fixes ppy/osu#19421.

This pull request adds a bunch of code to interface with NVAPI to disable threaded optimization. Initializing NVAPI before the OpenGL context also seems to force the dedicated GPU to be used according to some online threads, but I haven't tested this myself because I don't have the hardware.

I'm a bit concerned about how the metadata is being filled out, but I couldn't find a good way to pass the game name from the game host all the way down to the graphics backend.

khang06 avatar Sep 03 '22 08:09 khang06

Thanks for the contribution.

Rather than reimplementing things from scratch, did you consider existing libraries? https://www.nuget.org/packages?q=nvapi

peppy avatar Sep 03 '22 09:09 peppy

Also I have no idea if it will be helpful in review of this change, but here's stable's code:

https://gist.github.com/1ad50c4d3d9e376977ebbd8c598279e8

peppy avatar Sep 03 '22 09:09 peppy

I did look into existing libraries, but I didn't really want to risk screwing up any license-related stuff from third-party packages. I'm only implementing a small subset of the API, so it wasn't much of a problem to just do it myself instead.

khang06 avatar Sep 03 '22 15:09 khang06

https://github.com/ppy/osu/pull/26354

peppy avatar Jan 15 '24 08:01 peppy