Robmaister's picture

NVidia Optimus not switching to discreet GPU

Project:The Open Toolkit library
Category:bug report
Status:closed (invalid)

Tested on Windows, going to test on Linux soon. Laptops that have an NVidia Optimus GPU ("auto"-switching between discreet and integrated GPU) use the integrated GPU for OpenTK applications when they should be using the discreet GPU.

From what I've read about the issue, a quick-and-dirty fix is to invoke a small piece of CUDA or DirectX code to switch to the discreet GPU on Windows, there's probably a better way to do it though. I'll do some digging around and see if NVidia provides a nicer way to do this.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mOfl's picture


I have encountered the same problem and have been looking for a solution, but with no success so far. Unfortunately, the discrete GPU only seems to kick in after (some) D3D or CUDA calls, but not OpenGL calls. I've read NVidia or Intel are working on drivers that also include OpenGL calls, but for now there's little you can do about the situation. I have already experimented with CUDA calls, initialized a CUDA context and stuff (there's an own whitepaper for CUDA development with Optimus), but nothing seems to work, I'm stuck with the integrated GPU. I did not calculate anything, however, so maybe this is a necessity for the driver to switch the devices.

The only solution for now is to create a profile for your application. In order to debug in VS 2010 with the discrete GPU, you have to create a profile for the Assemblyname.vshost.exe. I hope the future (or the community ;)) will bring us a driver call that indicates that the application requires the discrete GPU.

mOfl's picture


I have written a small application that can create an application profile in the NVIDIA driver and set the option to use the discrete GPU at startup. This way, all applications - including OpenTK applications - on Optimus systems (for debugging and distribution) can be forced to run on the discrete NVIDIA GPU. I have created a blog entry for this:

It does not fix the real problem of the driver not kicking in, but at least you do not have to create profiles yourself. Just add the file SOP.cs to your code and run the SOP_SetProfile() at startup. The first time you call this on your system, a new profile for the application is created. From the next start on, the discrete GPU will be used.

the Fiddler's picture


Status:open» closed (invalid)

There is no OpenGL extension to select a GPU in multi-GPU systems, so this cannot be fixed within the scope of OpenTK. Applications that need to run on a specific GPU can use vendor-specific APIs to force this selection.