Forcing Machine to Use Dedicated Graphics Card?

前端 未结 2 1461
情歌与酒
情歌与酒 2020-12-14 03:22

I am part of a team developing an application using C++ with SDL and OpenGL.

On laptops when the application is ran the dedicated graphics card is not used and the G

2条回答
  •  孤街浪徒
    2020-12-14 03:54

    The easiest way from C++ to ensure that the dedicated graphics card is used instead of chipset switchable graphics under Windows is to export the following symbols (MSVC sample code):

    Enable dedicated graphics for NVIDIA:

    extern "C" 
    {
      __declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001;
    }
    

    Enable dedicated graphics for AMD Radeon:

    extern "C"
    {
      __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
    }
    

    Caveat: If the user has created a profile for the application to use integrated chipset, then these will not work.

    I am unsure if this would work similarly under Linux / MacOS (unlikely).

提交回复
热议问题