From 75a47701169839a66562017dbe57788b22fa18c6 Mon Sep 17 00:00:00 2001 From: Christophe Bourcier Date: Thu, 19 Aug 2021 08:30:13 +0200 Subject: [PATCH] Force high-performance graphics on dual-GPU systems --- src/Session/SALOME_Session_Server.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Session/SALOME_Session_Server.cxx b/src/Session/SALOME_Session_Server.cxx index 621fc466c..35e46458e 100644 --- a/src/Session/SALOME_Session_Server.cxx +++ b/src/Session/SALOME_Session_Server.cxx @@ -77,6 +77,18 @@ #include #include +#ifdef WIN32 +extern "C" { +// For DWORD (see end of file) +#include "windef.h" +// Force high-performance graphics on dual-GPU systems + // http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf + __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; + // https://community.amd.com/thread/169965 + __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; +} +#endif + //! CORBA server for SALOME GUI session /*! * SALOME_Session_Server launches a SALOME session servant. -- 2.39.2