From 9e58f63b9ff806d43bf194c3fc553bcebef5c2e1 Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Thu, 5 Sep 2024 09:53:07 -0400 Subject: [PATCH] rocr: Fix backwards compatible host-device copies on target engines If the KFD doesn't support targeting SDMA engines, ensure that ROCr selects the correct downstream queue type by using an invalid engine. Change-Id: Ia6848126f67f3d35ab37248633e8e0e6e2d77fff [ROCm/ROCR-Runtime commit: 24b25003b0d2e57ddf59c2713c4ed902e93902eb] --- .../runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp | 7 +++++++ 1 file changed, 7 insertions(+) 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 cf139b4ca5..b3e708c734 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 @@ -825,6 +825,13 @@ void GpuAgent::InitDma() { *blits_[BlitHostToDev]; } + // Check support for targeted SDMA engines + auto kfd_version = core::Runtime::runtime_singleton_->KfdVersion().version; + if (!(kfd_version.KernelInterfaceMajorVersion > 1 || + (kfd_version.KernelInterfaceMajorVersion == 1 && + kfd_version.KernelInterfaceMinorVersion >= 17))) + rec_eng = -1; + auto ret = CreateBlitSdma(use_xgmi, rec_eng); if (ret != nullptr) return ret; }