From 60d9a4ebababf9a34ab115a38b8836bcaec4357a Mon Sep 17 00:00:00 2001 From: Saleel Kudchadker Date: Thu, 18 May 2023 11:39:36 -0700 Subject: [PATCH] SWDEV-384557 - Do not fall back to compute - Use regular copy API if we exhaust free SDMA engines and not fall back to compute copy. Falling to compute is affecting performance for numerous apps that are GPU bound Change-Id: I75c767eff0b9f5ada324301c5c327fe2c23a9806 --- rocclr/device/rocm/rocblit.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rocclr/device/rocm/rocblit.cpp b/rocclr/device/rocm/rocblit.cpp index 7284ad1b09..871319cfc8 100644 --- a/rocclr/device/rocm/rocblit.cpp +++ b/rocclr/device/rocm/rocblit.cpp @@ -679,6 +679,7 @@ bool DmaBlitManager::hsaCopy(const Memory& srcMemory, const Memory& dstMemory, uint32_t copyMask = 0; uint32_t freeEngineMask = 0; + bool useRegularCopyApi = false; HwQueueEngine engine = HwQueueEngine::Unknown; if ((srcAgent.handle == dev().getCpuAgent().handle) && @@ -719,8 +720,12 @@ bool DmaBlitManager::hsaCopy(const Memory& srcMemory, const Memory& dstMemory, if (status != HSA_STATUS_SUCCESS) { gpu().Barriers().ResetCurrentSignal(); } + } else { + useRegularCopyApi = true; } - } else { + } + + if (engine == HwQueueEngine::Unknown || useRegularCopyApi) { auto wait_events = gpu().Barriers().WaitingSignal(engine); hsa_signal_t active = gpu().Barriers().ActiveSignal(kInitSignalValueOne, gpu().timestamp()); ClPrint(amd::LOG_DEBUG, amd::LOG_COPY,