0

Related to Forcing Machine to Use Dedicated Graphics Card?

I want to use dedicated GPU (Intel Arc in my case) for the app.

For AMD / Nvidia we can select related dedicated GPUs by exporting special variables to be read by graphics runtime:

extern "C" {

// Starting with the Release 302 drivers, application developers can direct the
// Nvidia Optimus driver at runtime to use the High Performance Graphics to
// render any application - even those applications for which there is no
// existing application profile.
//
// See
// https://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf
__declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;

// This will select the high performance AMD GPU as long as no profile exists
// that assigns the application to another GPU.  Please make sure to use a 13.35
// or newer driver.  Older drivers do not support this.
//
// See
// https://community.amd.com/t5/firepro-development/can-an-opengl-app-default-to-the-discrete-gpu-on-an-enduro/td-p/279440
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 0x00000001;

}  // extern "C"

Do we have some way to ensure app without Intel graphics profile will start on dedicated Intel GPU?

It's possible to manually enumerate installed GPUs using IDXGIFactory6::EnumAdapterByGpuPreference with DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE flag and choose dedicated GPU(s) if present.

But if simpler way is possible, it will be handy.

  • You can't choose the GPU but you can request Windows to use the hi-performance one as explained here: [Programmatically set Graphics Performance for an app](https://stackoverflow.com/questions/59732181/programmatically-set-graphics-performance-for-an-app) which is equivalent to enum and use adapters by hi-performance preference – Simon Mourier Aug 01 '23 at 22:34
  • @SimonMourier Well, it is internal implementations details of Win32 API, so a bit risky to use reliably :) Anyway, much better than nothing. Add this trick when use Vulkan renderer (without DXGI), thank you! – dimhotepus Aug 01 '23 at 23:01

0 Answers0