From ebea65430880fa90afaf93f7e7815daa34a806b7 Mon Sep 17 00:00:00 2001 From: Philip Yang Date: Wed, 27 Apr 2022 11:10:01 -0400 Subject: [PATCH] kfdtest: SVM mGPU tests skip GPUs prior to gfx9 Otherwise the test failed because KFD returns failure to map or prefetch the SVM range to those GPUs which don't support SVM. Change-Id: Ideaec2a686bfabb2fd6ae41b1a690da144121a89 Signed-off-by: Philip Yang [ROCm/ROCR-Runtime commit: c05c66e75662e0ee292c1f2673db3a7300a2ac8d] --- .../tests/kfdtest/src/KFDSVMRangeTest.cpp | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/projects/rocr-runtime/tests/kfdtest/src/KFDSVMRangeTest.cpp b/projects/rocr-runtime/tests/kfdtest/src/KFDSVMRangeTest.cpp index 283a567ff4..5bdcf5b80f 100644 --- a/projects/rocr-runtime/tests/kfdtest/src/KFDSVMRangeTest.cpp +++ b/projects/rocr-runtime/tests/kfdtest/src/KFDSVMRangeTest.cpp @@ -997,9 +997,18 @@ TEST_F(KFDSVMRangeTest, MultiGPUMigrationTest) { return; } - const std::vector gpuNodes = m_NodeInfo.GetNodesWithGPU(); + const std::vector gpuNodesAll = m_NodeInfo.GetNodesWithGPU(); + std::vector gpuNodes; + + for (int i : gpuNodesAll) { + const HsaNodeProperties *pNodeProperties; + + pNodeProperties = m_NodeInfo.GetNodeProperties(gpuNodesAll.at(i)); + if (pNodeProperties->Capability.ui32.SVMAPISupported) + gpuNodes.push_back(gpuNodesAll.at(i)); + } if (gpuNodes.size() < 2) { - LOG() << "Skipping test: at least two GPUs needed." << std::endl; + LOG() << "Skipping test: at least two SVM supported GPUs needed." << std::endl; return; } @@ -1072,9 +1081,18 @@ TEST_F(KFDSVMRangeTest, MultiGPUAccessInPlaceTest) { return; } - const std::vector gpuNodes = m_NodeInfo.GetNodesWithGPU(); + const std::vector gpuNodesAll = m_NodeInfo.GetNodesWithGPU(); + std::vector gpuNodes; + + for (int i : gpuNodesAll) { + const HsaNodeProperties *pNodeProperties; + + pNodeProperties = m_NodeInfo.GetNodeProperties(gpuNodesAll.at(i)); + if (pNodeProperties->Capability.ui32.SVMAPISupported) + gpuNodes.push_back(gpuNodesAll.at(i)); + } if (gpuNodes.size() < 2) { - LOG() << "Skipping test: at least two GPUs needed." << std::endl; + LOG() << "Skipping test: at least two SVM supported GPUs needed." << std::endl; return; }