From 58116d74dc2203513a39dac76cd85bbef4195db7 Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Fri, 15 Jul 2022 13:02:31 -0400 Subject: [PATCH] Report no cooperative launch support with CU masking The allocation logic of the SPI does not take into account compute user thread management settings for masking CUs with the exception of skipping fully disabled SEs. This means that occupancy limited dispatches such as cooperative launch may over allocate onto hardware resources that are not immediately available, resulting in a potential barrier logic hang as occupying work groups are waiting on enqueued work groups to reach the barrier. Further work will have to be done to get the per-SA CU enablement count from the KFD in order to correctly clip the cooperative CU limit based on the CU mask, which will require breaking the current ABI. For now, report that cooperative launch is not supported while a CU mask has been applied to prevent potential shader hangs. Change-Id: I8be4bb47d65ceb62d805f36ef6ef3996d756021f [ROCm/ROCR-Runtime commit: 2b75a73ce7872f7e63a1902ba20a2b76b2bbd20c] --- .../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 50a319e480..15c038e40a 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 @@ -1067,6 +1067,13 @@ hsa_status_t GpuAgent::GetInfo(hsa_agent_info_t attribute, void* value) const { *((bool*)value) = properties_.Capability.ui32.CoherentHostAccess == 1; break; case HSA_AMD_AGENT_INFO_COOPERATIVE_COMPUTE_UNIT_COUNT: + if (core::Runtime::runtime_singleton_->flag().coop_cu_count() && + !(core::Runtime::runtime_singleton_->flag().cu_mask(enum_index_).empty())) { + debug_warning("Cooperative launch and CU masking are currently incompatible!"); + *((uint32_t*)value) = 0; + break; + } + if (core::Runtime::runtime_singleton_->flag().coop_cu_count() && (isa_->GetMajorVersion() == 9) && (isa_->GetMinorVersion() == 0) && (isa_->GetStepping() == 10)) {