Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have a machine with two discrete GPUs and one integrated GPU. I can currently switch between them using NVIDIA's software, but I would like the ability to do so within my applications for purposes of benchmarking and general convenience. Apparently this requires the "NDA version" of NVIDIA's Driver API, which I know not how to obtain. Would using this API be the only way to accomplish what I seek, and if so, how would I obtain it? A solution using Windows APIs would also be acceptable, though less preferable to one which would leverage a cross-platform API. I have created a similar thread concerning the matter on NVIDIA's forum, which is down at the time of this writing.

Thanks for reading my question; it is much appreciated!

Edit: Here's a link to the original post I made on the NVIDIA forums - no luck on either site yet, though.

share|improve this question
    
Does using cudaChooseDevice requires the "NDA version" of NVIDIA's Driver API? I mean the one from these functions: developer.download.nvidia.com/compute/cuda/2_3/toolkit/docs/… –  zacharmarz Feb 26 '11 at 11:18
    
@zacharmarz Unfortunately, this will not work; when I am using integrated graphics, using cudaGetDeviceCount() will result in a value of one. When I am using discrete graphics, it results in a value of two. It is not possible for me to select a discrete GPU/GPUs for computation when I am in integrated graphics mode, or vice versa. –  void-pointer Feb 26 '11 at 11:40
1  
On a laptop, this is probably by design. Having both devices running would gobble battery power like crazy and nullify any savings by switching off the discrete chip and running the integrated chip instead. This is probably physically controlled at the hardware layer rather than just running both and routing the right device to the display. –  Bob Somers Feb 27 '11 at 11:47
    
I was going to propose the same thing as zacharmarz and as Bob points out it's most probably a hardware boundary. I don't think there's another (conviennent, standard) way to achieve what you want. –  Dave O. Feb 28 '11 at 1:25
    
@Dave O. I agree with you and Bob Somers, but the frustrating thing is that NVIDIA's driver utility can do this without having me to configure my graphics settings through BIOS, so I know that there is a function which it is invoking in order to do this. –  void-pointer Feb 28 '11 at 9:36

1 Answer 1

up vote 2 down vote accepted

As far as I know there is no way to do this from the CUDA APIs, and honestly I doubt that there is a publicly available way to do it at all. Switching the current graphics device is a deeply rooted OS thing, something that likely only the device driver itself can do. I've never heard of the device driver exposing that functionality to other software.

There might be something buried deep in the Windows API that could do it, but I don't think a cross-platform solution exists because as far as I know switching graphics devices on the fly isn't supported in Linux at the moment. (I also have a laptop with two devices, an integrated Intel and discrete ATI FireGL, but for Linux I have to set the device specifically in the BIOS.)

I think you're just to have to switch them by hand.

share|improve this answer
    
I think that you are right about this - I searched though the Windows API and could not find any functions that could switch between discrete and integrated GPUs, though it is possible to switch among multiple GPUs which are all "visible" to the driver at the same time using the ChoosePixelFormat() function in the Win32 API. I am pretty sure that this is possible to do using the "NDA version" of the NVAPI, but you would need to register as a developer and wait for your application to be approved. –  void-pointer Feb 28 '11 at 4:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.