From bdfe3a12a8c788a825b72229a1cddf93f8a7bcc6 Mon Sep 17 00:00:00 2001 From: Kent Russell Date: Thu, 8 Jul 2021 15:19:27 -0400 Subject: [PATCH] kfdtest: Ensure devices are peer-accessible for peer mapping If the devices aren't peer-accessible, we shouldn't try to run a test that requires that the devices be peer-accessible. Thus, add a check in MapVramToGPUNodesTest to check for peer accessibility before executing the peer mappings. Signed-off-by: Kent Russell Change-Id: Ib79b141f8c1ac6d85f5ab49d62af62ec10b988b7 --- tests/kfdtest/src/KFDLocalMemoryTest.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/kfdtest/src/KFDLocalMemoryTest.cpp b/tests/kfdtest/src/KFDLocalMemoryTest.cpp index ffc9eb505d..a27b502f97 100644 --- a/tests/kfdtest/src/KFDLocalMemoryTest.cpp +++ b/tests/kfdtest/src/KFDLocalMemoryTest.cpp @@ -516,6 +516,11 @@ TEST_F(KFDLocalMemoryTest, MapVramToGPUNodesTest) { } } + if (!m_NodeInfo.IsPeerAccessibleByNode(dst_node, src_node)) { + LOG() << "Skipping test: GPUs are not peer-accessible" << std::endl; + return; + } + LOG() << "Testing from GPU " << src_node << " to GPU " << dst_node << std::endl; void *shared_addr;