From 24d10e5c762b581ad94de76be70922d0d14dc6cd Mon Sep 17 00:00:00 2001 From: Ken O'Brien Date: Tue, 24 Jun 2025 16:01:09 +0000 Subject: [PATCH] rocr: Fixes memory allocation issue Fixes a bug in memory allocation in which dmabuf export only works on GPU 0 in a multi-GPU environment. [ROCm/ROCR-Runtime commit: 7b8a6f8ca277dec7f995528d705a0a85ffca0e94] --- .../hsa-runtime/core/runtime/amd_gpu_agent.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp index ec7c9180d5..a00c58193a 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp @@ -648,10 +648,13 @@ hsa_status_t GpuAgent::VisitRegion(bool include_peer, void* data) const { if (include_peer) { // Only expose system, local, and LDS memory of the blit agent. - if (this->node_id() == core::Runtime::runtime_singleton_->region_gpu()->node_id()) { - hsa_status_t stat = VisitRegion(regions_, callback, data); - if (stat != HSA_STATUS_SUCCESS) { - return stat; + const auto& gpu_ids = core::Runtime::runtime_singleton_->gpu_ids(); + for (auto& gpu_id : gpu_ids) { + if (this->node_id() == gpu_id) { + hsa_status_t stat = VisitRegion(regions_, callback, data); + if (stat != HSA_STATUS_SUCCESS) { + return stat; + } } }