SWDEV-362046 - Report HIP_OPS activities using the ROCr driver_node_id instead of the device's index

The ROCclr assigns zero-based IDs to GPUs in the order they are
discovered. That zero-based ID is what is used to identify the GPU
on which the HIP_OPS activity took place.

When multiple ranks are used, each rank's first logical device always
has GPU ID 0, regardless of which physical device is selected with
CUDA_VISIBLE_DEVICES. Because of this, when merging trace files from
multiple ranks, GPU IDs from different processes may overlap.

The long term solution is to use the KFD's gpu_id which is stable
across APIs and processes. Unfortunately the gpu_id is not yet exposed
by the ROCr, so for now use the driver's node id.

Change-Id: Ib78854527d600d175bb76e2df0747c33f898c615
이 커밋은 다음에 포함됨:
Laurent Morichetti 작성하고 Laurent Morichetti가 2022-10-20 12:31:30 -04:00를 커밋함
1 부모 dacd55f3d7
커밋 9a82118c85
3 파일이 변경됨
+11 -2

검색과 일치하는 파일 없음

+2 -2
파일 보기
@@ -73,8 +73,8 @@ void ReportActivity(const amd::Command& command) {
command.profilingInfo().start_, // begin timestamp, ns
command.profilingInfo().end_, // end timestamp, ns
{{
static_cast<int>(queue->device().index()), // device id
queue->vdev()->index() // queue id
static_cast<int>(queue->device().info().driverNodeId_), // device id
queue->vdev()->index() // queue id
}},
{} // copied data size for memcpy, or kernel name for dispatch
};