Skip to content

Commit 42a6518

Browse files
authored
fix(windows): prefer discrete GPU on hybrid graphics systems, Add NvOptimusEnablement and AmdPowerXpressRequestHighPerformance exports to hint the NVIDIA/AMD driver to select the discrete GPU on Windows hybrid graphics system (#218)
Signed-off-by: Vikas Kendre <vikaskendre1989@gmail.com>
1 parent b4672a6 commit 42a6518

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/launch/xstudio/src/xstudio.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
// SPDX-License-Identifier: Apache-2.0
22

3+
#ifdef _WIN32
4+
extern "C" {
5+
__declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001; // NVIDIA
6+
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; // AMD
7+
}
8+
#endif
9+
310
#include <args/args.hxx>
411
#include <chrono>
512
#include <csignal>

0 commit comments

Comments
 (0)