From ee8b1b64ad0d1d27e306de25b1b57af3869422a2 Mon Sep 17 00:00:00 2001 From: Sean Keely Date: Wed, 21 Apr 2021 21:44:42 -0500 Subject: [PATCH] Report HMM driver support status. Implements HSA_AMD_SYSTEM_INFO_SVM_SUPPORTED. Change-Id: If5182edcc1fa067fa514aa2c1bd326c4c42d1b64 --- runtime/hsa-runtime/core/runtime/amd_topology.cpp | 2 +- runtime/hsa-runtime/core/runtime/runtime.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/runtime/hsa-runtime/core/runtime/amd_topology.cpp b/runtime/hsa-runtime/core/runtime/amd_topology.cpp index 6b6a308583..71bc738215 100644 --- a/runtime/hsa-runtime/core/runtime/amd_topology.cpp +++ b/runtime/hsa-runtime/core/runtime/amd_topology.cpp @@ -143,7 +143,7 @@ GpuAgent* DiscoverGpu(HSAuint32 node_id, HsaNodeProperties& node_prop, bool xnac if (gpu->isa()->GetProcessorName() == "gfx908") { node_prop.Capability.ui32.SRAM_EDCSupport = 1; delete gpu; - gpu = new GpuAgent(node_id, node_prop); + gpu = new GpuAgent(node_id, node_prop, xnack_mode); } } } catch (const hsa_exception& e) { diff --git a/runtime/hsa-runtime/core/runtime/runtime.cpp b/runtime/hsa-runtime/core/runtime/runtime.cpp index aba70cb5e3..7ce4e58b25 100644 --- a/runtime/hsa-runtime/core/runtime/runtime.cpp +++ b/runtime/hsa-runtime/core/runtime/runtime.cpp @@ -645,8 +645,12 @@ hsa_status_t Runtime::GetSystemInfo(hsa_system_info_t attribute, void* value) { break; } case HSA_AMD_SYSTEM_INFO_SVM_SUPPORTED: { - // todo: Get HMM kernel support info. - *(bool*)value = true; + bool ret = true; + for (auto agent : gpu_agents_) { + AMD::GpuAgent* gpu = (AMD::GpuAgent*)agent; + ret &= (gpu->properties().Capability.ui32.SVMAPISupported == 1); + } + *(bool*)value = ret; break; } case HSA_AMD_SYSTEM_INFO_SVM_ACCESSIBLE_BY_DEFAULT: {