how to use many graphic cards simultaneously


I have 4 teslas.
now, I can use many cores in a graphic card.
but I have no idea to use many graphic cards simultaneously.
I need your advices about using many graphic cards once.

for example, I calculate addition of two vectors(matrix).
[1 2 3 4] and [5 6 7 8].
1st card, 1+5
2nd card, 2+6
3rd card, 3+7
4th card, 4+8
is it possible to compute simultaneously by using many graphic cards??


It’s possible by leveraging CUDA thread. Please reference mult-thread demo in SDK

thank you.

you mean simplemultigpu??

There are several examples in the SDK that use multiple GPUs. The gist is you create a thread per device and in each thread call cudaSetDevice. After that point all the CUDA calls within that thread will use the specified GPU for its operations. I use a manager object to create the threads, start them, wait for completion and then read the results from each into a final output form.