Forced machine to use a dedicated graphics card?

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

On laptops, when the application starts, the dedicated video card is not used and the GL context is not created, because the integrated graphics card does not support the GL version that we want.

I have a feeling that this problem is specific to the laptop in question, and not something that we can solve with the code. But, if anyone knows if there is a solution that would be great.

+8
c ++ graphics sdl opengl
source share
2 answers

Does it use NVidia graphics? AFAIK, the process of automatically switching from integrated to dedicated is based on application profiles. Your application is not included in the list of drivers for well-known 3D applications, so the user must manually switch to a dedicated graphics processor.

Try changing the executable name of your application to what the driver is looking for. For example, "Doom3.exe". If this works, you have found your problem.

If this does not help, try the instructions in this video on how to get the driver to insert the application into your list of 3D applications:

http://www.frequency.com/video/how-to-whitelist-game-with-nvidias/24814032

But the above is only for checking if this is really your problem. To actually resolve this issue, you should check with the graphics driver providers (AMD and NVidia) the best way to insert a profile for your application in your lists. NVidia provides NVAPI , while AMD ADL and AGS . They are definitely worth exploring.

+3
source share

The easiest way from C ++ to use a dedicated graphics card instead of switchable graphics on a chipset under Windows is to export the following characters (MSVC code example):

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; } 

Warning. If the user created a profile for the application to use the integrated chipset, then this will not work.

I am not sure if this will work similarly to Linux / MacOS (unlikely).

+10
source share

All Articles