From 82a88f2e2bb169bf1d79b1778576ef8a8f7a98d9 Mon Sep 17 00:00:00 2001 From: Shane Xiao Date: Thu, 8 May 2025 18:19:59 +0800 Subject: [PATCH] rocr: Set rec_sdma_eng_override_ for all gpus Set the rec_sdma_eng_override_ for other gpus, or DmaCopyOnEngine will use sdma for D<->D copy, which will trigger invalid argument. --- runtime/hsa-runtime/core/runtime/amd_topology.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/runtime/hsa-runtime/core/runtime/amd_topology.cpp b/runtime/hsa-runtime/core/runtime/amd_topology.cpp index d30e11b0ae..58a882370f 100644 --- a/runtime/hsa-runtime/core/runtime/amd_topology.cpp +++ b/runtime/hsa-runtime/core/runtime/amd_topology.cpp @@ -386,6 +386,12 @@ bool BuildTopology() { for (auto& src_gpu : rt->gpu_agents()) { uint32_t src_id = src_gpu->node_id(); + // Set RecSdmaEngOverride to true for all gpus + if (rec_sdma_engine_override) { + ((AMD::GpuAgent*)src_gpu)->SetRecSdmaEngOverride(rec_sdma_engine_override); + continue; + } + // skip the pre-loop if NumSdmaXgmiEngines != 6 if (((AMD::GpuAgent*)src_gpu)->properties().NumSdmaXgmiEngines != 6) break; @@ -401,10 +407,6 @@ bool BuildTopology() { } } } - - // skip the pre-loop if RecSdmaEngOverride is true - if (rec_sdma_engine_override) - break; } // Register destination agents that can SDMA gang copy for source agents