Woundorf
Woundorf

Reputation: 223

Is there a way to programmatically select the rendering GPU in a multi-GPU environment? (Windows)

Question

I have an OpenGL application that will run in machines with diverse multi-GPU configurations (and possibly different Windows versions, from XP to 7). Is there a general way to select the specific GPU that will act as the OpenGL renderer independently of the GPU combination (e.g. NVIDIA + NVIDIA, NVIDIA + AMD, NVIDIA + Intel, etc.)? It has to be a solution that can be applied from application code, i.e. directly in C++ or a script that would be called from the application, with no end-user intervention.

Below are the details of several tests I have done to try to find a solution, starting with very specific cases, but maybe there is a solution that can work in all or most cases.

Is ther any reliable method to force which GPU does the OpenGL rendering?

Any hint will be very appreciated. Thanks in advance!

Tried possible solutions

Windows XP 64 with two NVIDIA Quadro

Testing with combinations of two Quadro cards

using the same driver (version 275.36) under Windows XP 64-bit, I have had relative success with various methods, such as:

Windows 7 64 with Intel and AMD

This system runs with Windows 7 64-bit and the graphics cards are one Intel HD Graphics 2000 (integrated in the CPU (Sandy Bridge)) and one AMD Radeon HD 6450. In all cases rendering works on both screens, but the rendering GPU varies depending on some variables:

With this system I have also tried a solution proposed in the OpenGL forums. TL;DR: it's a hacky method to choose the driver used by OpenGL, so it can choose between GPUs that use different drivers, but not between cards that use the same driver. I obtained the following results:

Upvotes: 20

Views: 5683

Answers (1)

BЈовић
BЈовић

Reputation: 64293

Since you are using nvidia Quadro cards, you can use the WGL_NV_gpu_affinity extension to select the GPU.

I am not sure about ATI chips, but I think it is AMD_gpu_association

Upvotes: 6

Related Questions