How to change the default device on multigpu ?

Hello,

i have 2 gpu, and unfortunately i would like to use the second card (device=1).
I did it replacing CUT_DEVICE_INIT(); by cudaSetDevice(1); and it works
but is there any others ways to indicate to CUT_DEVICE_INIT() to use the device 1 automatically ?
(to make me easier to test all SDK examples without replacing each cut_device_init)

thanks for your help
Seb

What you can do I don’t know if it will help, but take a look at the cutil.h and search for CUT_DEVICE_INIT() and change this line:

CUDA_SAFE_CALL(cudaSetDevice(dev));

to something like this

CUDA_SAFE_CALL(cudaSetDevice(1));

If you ask me this should do the trick.

BTW cutil.h can be found in $CUDA_SDK_INSTALL_PATH/common/inc