I am a newbie to cuda multi-gpu programming. I started a bunch of threads. Each thread does a SetDevice(device_number) then runs a bunch of code. After the code is run I want to confirm that it ran on the GPU it was supposed to have run on. Is there a command to use to check/see/confirm what is the GPU device number currently in use by my program in the current thread?
seibert
2
cudaGetDevice(int *device) will give you the current device in your host thread.
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Two general Multi-GPU questions. | 4 | 2908 | January 24, 2012 | |
| Finding Idle GPU in Multi-GPU System | 2 | 2418 | December 21, 2007 | |
| Device ID query from device thread. | 4 | 3048 | November 8, 2018 | |
| Number of cores in use or current number of threads running | 1 | 574 | September 30, 2018 | |
| Question about cudaSetDevice and multiple host threads | 1 | 3004 | February 1, 2015 | |
| How to check work is done by different GPU in multi GPU environment | 8 | 3148 | June 18, 2009 | |
| cudaSetDevice question | 12 | 33476 | February 3, 2009 | |
| Is it possible for a kernel to know on which GPU device it is running? | 1 | 1152 | June 1, 2021 | |
| problem of cudaGetDevice for MultiGPUs | 2 | 6585 | November 12, 2009 | |
| cudaSetDevice switch to different thread? | 2 | 3305 | April 16, 2008 |