From dcf8b5fd6cd2f8906200a0e28c9ccecbe3e53cc3 Mon Sep 17 00:00:00 2001 From: gaba Date: Wed, 6 Dec 2023 12:54:46 -0500 Subject: [PATCH] libhsakmt: Fix CPU cache issue For "Intel Meteor lake Mobile", the cache info is not in sysfs, That means /sys/devices/system/node/node%d/%s/cache is not exist, but system working fine. Change-Id: Ie7c04426791a84c2288ff21df093226828a5f629 Signed-off-by: Gang Ba [ROCm/ROCR-Runtime commit: 4bf73f521b27f4f7bfc7b4ad782fd6f1a78f98ea] --- projects/rocr-runtime/src/topology.c | 7 +++++-- .../rocr-runtime/tests/kfdtest/src/KFDTopologyTest.cpp | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/projects/rocr-runtime/src/topology.c b/projects/rocr-runtime/src/topology.c index d2c81a98d9..2cf89f6b8d 100644 --- a/projects/rocr-runtime/src/topology.c +++ b/projects/rocr-runtime/src/topology.c @@ -1466,8 +1466,11 @@ static HSAKMT_STATUS topology_get_cpu_cache_props(int node, tbl->node.NumCaches = topology_create_temp_cpu_cache_list( node, cpuinfo, &cpu_ci_list); if (!tbl->node.NumCaches) { - pr_err("Fail to get cache info for node %d\n", node); - ret = HSAKMT_STATUS_ERROR; + /* For "Intel Meteor lake Mobile", the cache info is not in sysfs, + * That means /sys/devices/system/node/node%d/%s/cache is not exist. + * here AMD will not black this issue. + */ + pr_debug("CPU cache info is not available for node %d \n", node); goto exit; } diff --git a/projects/rocr-runtime/tests/kfdtest/src/KFDTopologyTest.cpp b/projects/rocr-runtime/tests/kfdtest/src/KFDTopologyTest.cpp index b4c2ebfca6..7910aa21c4 100644 --- a/projects/rocr-runtime/tests/kfdtest/src/KFDTopologyTest.cpp +++ b/projects/rocr-runtime/tests/kfdtest/src/KFDTopologyTest.cpp @@ -64,7 +64,11 @@ TEST_F(KFDTopologyTest , BasicTest) { " SGPR Size is " << pNodeProperties->SGPRSizePerCU << std::endl; } EXPECT_GT(pNodeProperties->NumMemoryBanks, HSAuint32(0)) << "Node index: " << node << "No MemoryBanks."; - EXPECT_GT(pNodeProperties->NumCaches, HSAuint32(0)) << "Node index: " << node << "No Caches."; + if (pNodeProperties->NumCaches ==0) + // SWDEV-420270 + // For "Intel Meteor lake Mobile", the cache info is not in sysfs, + // That means /sys/devices/system/node/node%d/%s/cache is not exist. + LOG() << "Node index: " << node << " No Caches or not available to read ." << std::endl; } }