Request High-Performance GPU on multi GPU systems.
This is a problem on laptops.
https://stackoverflow.com/questions/17458803/amd-equivalent-to-nvoptimusenablement
https://github.com/glfw/glfw/blob/0ccb690853e29ae38317d762f9deaa37ba101f4b/docs/compile.dox#L239
__GLFW_USE_HYBRID_HPG__ determines whether to export theNvOptimusEnablementandAmdPowerXpressRequestHighPerformancesymbols, which force the use of the high-performance GPU on Nvidia Optimus and AMD PowerXpress systems. These symbols need to be exported by the EXE to be detected by the driver, so the override will not work if GLFW is built as a DLL.
https://www.reddit.com/r/gamedev/comments/bk7xbe/psa_for_anyone_developing_a_gameengine_in_c/
someone pointed out: this won't have any effect if you code it into a dynamically loaded library. In that case, either supply a macro for library users to add it in, or link against libnvapi (fixes it on nv only.)
Therefore, I currently see no way to implement this easily. Suggestion: Wontfix & not our department
Here are some more resources I found.
- Via Windows registry https://stackoverflow.com/a/59732413
- Using NvApi https://stackoverflow.com/a/17277085
- 🥲😨😱☠️ http://lucasmagder.com/blog/2014/05/exporting-data-symbols-in-c-for-nvidia-optimus/
Bump, since it is now also handled inside windows. Maybe it is now easier to use.