How to run seperate apps on different gpu's on tesla

Hi all,

Could someone tell me how to use cudaSetDevice() to run 4 different codes on the four different gpu’s on a tesla machine???

Do I need to set it once in main or before every Kernel???

Thanks for any help,


there are 3 demos in the SDK projects, which can tell you how to use multi-gpus in one machine.

cudaOpenMP, simpleMultiGPU, MonteCarloMultiGPU

cudaSetDevice(0) from app 1, cudaSetDevice(1) from app 2, cudaSetDevice(2) from app 3, etc. you do that before you create a context, and then once you create a context it’s on that card, period.