Can deviceId be used to separate profiling data from multiple GPUs?

I have a use-case where I run cuda kernels on two gpus from the same process at the same time in parallel. When profiling with CUPTI, can i use say CuptiActivitityKernel4.deviceId and CuptiActivityMemcpy2.deviceId to figure out which GPU the data is coming from?

Is deviceId available on all applicable cupti structs?
If not what should be used?
Also what are something to know if using cupti for profiling two gpus at the same time from the same process?

Thank you,
Sujan

Hi,

Correct, deviceId can be used to differentiate among multiple devices. One or both of the deviceId or contextId are available in all the relevant activity records. Is there any record where you see this information is missing?

In case this helps, CUPTI has APIs to query the contextId and deviceId from the CUcontext handle.
cuptiGetContextId() - Get the ID of the context from CUcontext
cuptiGetDeviceId() - Get the ID of the device from CUcontext

CUPTI supports profiling multiple GPUs at the same time, no special configuration is needed.