kfdtest: add xgmi path for p2p tests

When large bar is not available, we can use
xgmi to do p2p tests.

Change-Id: Ib7b59fb8a4d41f605739a0428973f6b2f1a3450f
Signed-off-by: Eric Huang <JinhuiEric.Huang@amd.com>
This commit is contained in:
Eric Huang
2019-10-04 16:49:38 -04:00
committed by JinHuiEric Huang
parent 6933540c81
commit 0174377351
5 changed files with 75 additions and 29 deletions
+7 -6
View File
@@ -23,6 +23,7 @@
#include <sys/time.h>
#include <vector>
#include <utility>
#include "KFDQMTest.hpp"
#include "PM4Queue.hpp"
#include "PM4Packet.hpp"
@@ -1459,8 +1460,10 @@ TEST_F(KFDQMTest, P2PTest) {
if (g_TestDstNodeId != -1 && g_TestNodeId != -1) {
nodes.push_back(g_TestNodeId);
nodes.push_back(g_TestDstNodeId);
if (!m_NodeInfo.IsGPUNodeLargeBar(nodes[1])) {
LOG() << "Skipping test: Dst GPU is not a large bar GPU." << std::endl;
if (!m_NodeInfo.IsGPUNodeLargeBar(g_TestDstNodeId) &&
!m_NodeInfo.AreGPUNodesXGMI(g_TestNodeId, g_TestDstNodeId)) {
LOG() << "Skipping test: Dst GPU specified is not peer-accessible." << std::endl;
return;
}
if (nodes[0] == nodes[1]) {
@@ -1469,12 +1472,10 @@ TEST_F(KFDQMTest, P2PTest) {
}
} else {
HSAint32 defaultGPU = m_NodeInfo.HsaDefaultGPUNode();
nodes.push_back(defaultGPU);
for (unsigned i = 0; i < gpuNodes.size(); i++)
if (m_NodeInfo.IsGPUNodeLargeBar(gpuNodes.at(i)) && gpuNodes.at(i) != defaultGPU)
nodes.push_back(gpuNodes.at(i));
m_NodeInfo.FindAccessiblePeers(&nodes, defaultGPU, true);
if (nodes.size() < 2) {
LOG() << "Skipping test: Test requires at least one large bar GPU." << std::endl;
LOG() << " or two GPUs are XGMI connected." << std::endl;
return;
}
}