From 75a7da05bed7ee362dc25da0974b66474be23e51 Mon Sep 17 00:00:00 2001 From: Honglei Huang Date: Wed, 25 Jun 2025 13:54:42 +0800 Subject: [PATCH] rocr: use driver interface for memory and cache properties query Replace direct libhsakmt calls with driver interface methods in GpuAgent initialization: - Replace hsaKmtGetNodeMemoryProperties with driver().GetMemoryProperties - Replace hsaKmtGetNodeCacheProperties with driver().GetCacheProperties Signed-off-by: Honglei Huang [ROCm/ROCR-Runtime commit: 046591419f8c06371261d0453c28f5dd38ff8397] --- .../runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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 a00c58193a..e434c19bdd 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 @@ -435,9 +435,7 @@ void GpuAgent::InitRegionList() { const bool is_apu_node = (properties_.NumCPUCores > 0); std::vector mem_props(properties_.NumMemoryBanks); - if (HSAKMT_STATUS_SUCCESS == - HSAKMT_CALL(hsaKmtGetNodeMemoryProperties(node_id(), properties_.NumMemoryBanks, - &mem_props[0]))) { + if (HSA_STATUS_SUCCESS == driver().GetMemoryProperties(node_id(), mem_props)) { for (uint32_t mem_idx = 0; mem_idx < properties_.NumMemoryBanks; ++mem_idx) { // Ignore the one(s) with unknown size. @@ -577,9 +575,8 @@ void GpuAgent::InitCacheList() { // Get GPU cache information. // Similar to getting CPU cache but here we use FComputeIdLo. cache_props_.resize(properties_.NumCaches); - if (HSAKMT_STATUS_SUCCESS != - HSAKMT_CALL(hsaKmtGetNodeCacheProperties(node_id(), properties_.FComputeIdLo, - properties_.NumCaches, &cache_props_[0]))) { + if (HSA_STATUS_SUCCESS != + driver().GetCacheProperties(node_id(), properties_.FComputeIdLo, cache_props_)) { cache_props_.clear(); } else { // Only store GPU D-cache.