Skip to content

Instantly share code, notes, and snippets.

@statico

statico/gpu.cpp

Last active Sep 21, 2020
Embed
What would you like to do?
Trick to tell AMD and Nvidia drivers to use the most powerful GPU instead of a lower-performance (such as integrated) GPU
#ifdef _WIN32
// Use discrete GPU by default.
extern "C" {
// http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf
__declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
// http://developer.amd.com/community/blog/2015/10/02/amd-enduro-system-for-developers/
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
}
#endif
@parkercoates

This comment has been minimized.

Copy link

@parkercoates parkercoates commented Mar 22, 2018

Sadly, that AMD link has expired and I haven't found a better reference anywhere, other than this forum post: https://community.amd.com/thread/169965

@Moguri

This comment has been minimized.

Copy link

@Moguri Moguri commented Jul 1, 2019

@sci4me

This comment has been minimized.

Copy link

@sci4me sci4me commented Jun 1, 2020

Dumb question: Are these relevant in Linux (or OSX for that matter)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.