Salome HOME
Force high-performance graphics on dual-GPU systems cbr/force_gpu_windows
authorChristophe Bourcier <christophe.bourcier@cea.fr>
Thu, 19 Aug 2021 06:30:13 +0000 (08:30 +0200)
committerChristophe Bourcier <christophe.bourcier@cea.fr>
Thu, 19 Aug 2021 06:30:13 +0000 (08:30 +0200)
src/Session/SALOME_Session_Server.cxx

index 621fc466c4530577e30ea56b5ae1c2020d84239c..35e46458efaf6b45a6b0052580af9aaad3884129 100644 (file)
 #include <QTextStream>
 #include <QWaitCondition>
 
+#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.