From 381ea164ba10f88453228073ef978b75f80b8ec6 Mon Sep 17 00:00:00 2001 From: Xiaomeng Hou Date: Fri, 2 Jun 2023 19:10:08 +0800 Subject: [PATCH] Correct the SDMA engine mask reported on apu There is only one SDMA instance on small APUs. Change-Id: I9d4dda511c40fc78f002be720e5f1909dc5b91e4 [ROCm/ROCR-Runtime commit: 557da77c4eadbd11aec58d3a439bff625a2d17f8] --- .../runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 78c114a929..7ac0c0842c 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 @@ -926,7 +926,9 @@ hsa_status_t GpuAgent::DmaCopyStatus(core::Agent& dst_agent, core::Agent& src_ag } if (!!!blits_[BlitDevToHost]->PendingBytes()) { - *engine_ids_mask |= HSA_AMD_SDMA_ENGINE_1; + *engine_ids_mask |= properties_.NumSdmaEngines > 1 ? + HSA_AMD_SDMA_ENGINE_1 : + HSA_AMD_SDMA_ENGINE_0; } // Find a free xGMI SDMA engine for H2D/D2H though it may be lower bandwidth for (int i = 0; i < properties_.NumSdmaXgmiEngines; i++) {