Skip to content

Instantly share code, notes, and snippets.

Last active Jun 17, 2022
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" {
__declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
Copy link

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:

Copy link

Moguri commented Jul 1, 2019

Copy link

sci4me commented Jun 1, 2020

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

Copy link

peterix commented Mar 25, 2021

No, this is not relevant for anything other than Windows.

Copy link

IGR2014 commented Mar 29, 2022

More dumb question: There's nothing similar for Intel (integrated HD Graphics), right?

Copy link

tinuroth commented Jun 17, 2022

More dumb question: can I do this somehow from a managed C# application? It does Pinvoke for the purpose of calling native algos, but how would I extern "C" { __declspec(dllexport) ... } such properties to be picked up by the drivers? Can any of my native DLLs export this and it will be picked up?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment