Closed gggh000 closed 2 months 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?
Hi @gggh000, are you still encountering this issue when profiling with two GPUs? I was unable to reproduce this issue using your example program. Please see the output of egrep -irn gpu results.json
below:
4:,{"args":{"name":"GPU0"},"ph":"M","pid":6,"name":"process_name","sort_index":2}
5:,{"args":{"name":"GPU Barriers0"},"ph":"M","pid":518,"name":"process_name","sort_index":3}
6:,{"args":{"name":"GPU1"},"ph":"M","pid":7,"name":"process_name","sort_index":4}
7:,{"args":{"name":"GPU Barriers1"},"ph":"M","pid":519,"name":"process_name","sort_index":5}
278: "Agent2.Uuid": "GPU-XXX",
289: "Agent2.DeviceType": "GPU",
361: "Agent3.Uuid": "GPU-XXX",
372: "Agent3.DeviceType": "GPU",
If you do still see this issue, could you please confirm if you are using a virtual machine and if you can reproduce the issue on baremetal as well.
Please also note that MI25 is no longer supported for ROCm. You can find the updated list of supported GPUs at the System requirements page.
use following to compile and create trace:
there is a result.json created and when opened in chrome tracer, only gpu0 is seen.