Help Switching between Discrete and Integrated GPUs

Hello everyone,

I am developing CUDA applications on an Alienware M17x portable block which has two discrete GTX 280M GPUs and an integrated GeForce 9400M GPU. I can switch between the two manually using existing utilities, but I would like to have the ability to do so within my applications for purposes of benchmarking and general convenience. After reading the webpage describing the NVAPI, I downloaded it and read the corresponding documentation, but found no function by which I would be able to switch between the discrete and integrated GPUs. Further searching revealed that I would need the “NDA edition” of the API in order to do this; I would like to know whether it is possible to do what I describe using the NVAPI, or if not, how I would be able to obtain a copy of the “NDA edition” of the NVAPI in order to do so. As far as I know, it is not possible to do this using any of the Windows APIs, but if it is, a solution using them would be acceptable though less preferable to one which would use the NVAPI.

Thank you very much for reading my question; I really appreciate it!

Edit: Here’s a cross-post I made on the Game Development Stack Exchange while the NVIDIA forums were down - no luck on either site so far, though.

cudaSetDevice(your_favorite_number here)

Assume your IGP is 0, your GTX 280M are 1 and 2. Start your code by calling cudaSetDevice(1) e.g. and it will run on your first GTX 280M. The assignment of host thread to GPU will be valid for the remainder of the program until another cudaSetDevice call.

Thank you very much for your reply! Unfortunately, I have already tried this, but it does not work: my when laptop is in integrated graphics mode, the GeForce 9400 is given the ID of device zero and no other devices appear to be available for computation. When my laptop is in discrete graphics mode, the GTX 280M GPUs show up as devices zero and one, but no other devices are available for computation. I have even tried to obtain device properties for device IDs greater than or equal to the number resulting from a call to cudaGetDeviceCount() when I was both in discrete and integrated graphics mode, but this results in errors, as expected.

What makes me the most disappointed is that the driver utility written by NVIDIA can do this switching without having me to reboot and configure the graphics settings in the BIOS, so I know a function call to do this exists and that it is indeed possible. The reason I chose to get a laptop with NVIDIA’s GPUs was that they make high-quality software and create a good environment with which developer may work, so the fact that they are hiding this useful functionality from developers is a little discouraging. Is there some way that I can invoke the same function which this driver utility does in order to switch between discrete and integrated graphics?

On the page you linked to it says

So I assume that means you firstly apply to register as a developer and, if accepted, then sign an NDA to get access to the non public bits of the API.

I did read this, but I was hoping for a publicly available function before I resort to using the NDA version of the API. Since there does not seem to be any other way to switch between the two, I will try to register as a developer. Thank you very much for your help!

Hi, did you manage to get the GPU switching to work correctly? I also have an m17x and would like to use the 9400m IGP for windows display and develop cuda on the 280m’s. Is it easy to become a registered developer?


Hello and sorry for the late response! I have recently switched over to Ubuntu 11.04, 64-bit and I have not yet applied to become a developer since being able to switch GPUs without entering the BIOS setup is only a matter of convenience for me. If anyone finds an easier way to do this, though, I would certainly be interested in knowing.