diff --git a/projects/clr/rocclr/device/device.hpp b/projects/clr/rocclr/device/device.hpp index 8d20b3ad17..1d03f90afb 100644 --- a/projects/clr/rocclr/device/device.hpp +++ b/projects/clr/rocclr/device/device.hpp @@ -613,6 +613,8 @@ struct Info : public amd::EmbeddedObject { bool virtualMemoryManagement_; //!< Virtual memory management support size_t virtualMemAllocGranularity_; //!< virtual memory allocation size/addr granularity + + uint32_t driverNodeId_; }; //! Device settings diff --git a/projects/clr/rocclr/device/rocm/rocdevice.cpp b/projects/clr/rocclr/device/rocm/rocdevice.cpp index 9dea3d444d..49616b8523 100644 --- a/projects/clr/rocclr/device/rocm/rocdevice.cpp +++ b/projects/clr/rocclr/device/rocm/rocdevice.cpp @@ -1179,6 +1179,13 @@ bool Device::populateOCLDeviceConstants() { } assert(info_.globalMemChannels_ > 0); + if (HSA_STATUS_SUCCESS != + hsa_agent_get_info(bkendDevice_, + static_cast(HSA_AMD_AGENT_INFO_DRIVER_NODE_ID), + &info_.driverNodeId_)) { + return false; + } + setupCpuAgent(); checkAtomicSupport(); diff --git a/projects/clr/rocclr/platform/activity.cpp b/projects/clr/rocclr/platform/activity.cpp index d5678b4fce..2e6d61962e 100644 --- a/projects/clr/rocclr/platform/activity.cpp +++ b/projects/clr/rocclr/platform/activity.cpp @@ -73,8 +73,8 @@ void ReportActivity(const amd::Command& command) { command.profilingInfo().start_, // begin timestamp, ns command.profilingInfo().end_, // end timestamp, ns {{ - static_cast(queue->device().index()), // device id - queue->vdev()->index() // queue id + static_cast(queue->device().info().driverNodeId_), // device id + queue->vdev()->index() // queue id }}, {} // copied data size for memcpy, or kernel name for dispatch };