How to change the default device on multigpu ?


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

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:


to something like this


If you ask me this should do the trick.

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