Enumerating and Selecting Devices
cudaSetDevice and per-GPU contexts.
More Than One GPU
A single machine can hold several GPUs. To use them all, your program first needs to discover how many devices are present before it sends any work.
Counting the Devices
One call tells you how many GPUs the runtime can see. cudaGetDeviceCount writes that number into an int you hand it.
int count;
cudaGetDeviceCount(&count);All lessons in this course
- Enumerating and Selecting Devices
- Partitioning Work Across GPUs
- Peer-to-Peer Memory Access
- Multi-GPU with NCCL