Open gggh000 opened 2 years ago
I suspect that the first kernel doesn't finish when the program exits.
hipSetDevice(0);
hipLaunchKernelGGL(add, blocks, threadsPerBlock, 0, 0, dev_a, dev_b, dev_c); // launch on gpu 0
hipSetDevice(1);
hipLaunchKernelGGL(add, blocks, threadsPerBlock, 0, 0, dev_a, dev_b, dev_c); // launch on gpu 1
hipDeviceSynchronize(); // wait for gpu 1
hipSetDevice(0); // new code
hipDeviceSynchronize(); // new code: wait for gpu 0
I haven't checked it, it's just a thought.
(By the way, recent HIP versions support CUDA's syntax kernel<<<...>>>(...)
)
then should not it show that exactly?? It shlould not be the reason for ignoring 2nd gpu?
use following to compile and create trace:
there is a result.json created and when opened in chrome tracer, only gpu0 is seen.