Two general Multi-GPU questions.

  1. If I want to use multiple GPU’s in parallel do I have to use cutStartThread? Is there something magical or special about cutStartThread?

  2. Does cudaSetDevice set the device for the entire process or just the current thread?

The reason I am asking is because it seems that cudaSetDevice sets the device for all of the threads in a process, not just the current process. I’m wondering what I’m doing wrong.

I’m assuming you’re using 4.0 or later.

  1. Don’t use cut* ever. It’s not an officially supported part of CUDA, just some things to make SDK examples easier to read. Use your thread library of choice.

  2. It’s set only for the current thread.

Is there any way, specifically any command, available to check/verify which device is being used by the current thread?

cudaGetDevice

OK mystery solved. I Googled cudaGetDevice and all that came up was entries for cudaSetDevice. So I thought the command didn’t exist. It turns out that this is a feature of Google.