From 88f727ab6ebc8d4faa426252752393414e391d91 Mon Sep 17 00:00:00 2001 From: Philip Yang Date: Fri, 13 Sep 2019 16:18:00 -0400 Subject: [PATCH] kfdtest: use flag NoNUMABind to allocate system memory Allocate system memory from node id 0 will fail on NUMA system which has no memory on node 0. Change to use new flag NoNUMABind to allocate system memory from NUMA nodes which have free memory. Change-Id: I8ef9ca28fc2ab5dd31d07a2d3eaf1d5886e798a0 Signed-off-by: Philip Yang [ROCm/ROCR-Runtime commit: 69d8f2d734052937776eff4199919e0bed24334f] --- projects/rocr-runtime/tests/kfdtest/src/KFDMemoryTest.cpp | 3 +++ projects/rocr-runtime/tests/kfdtest/src/KFDQMTest.cpp | 1 + 2 files changed, 4 insertions(+) diff --git a/projects/rocr-runtime/tests/kfdtest/src/KFDMemoryTest.cpp b/projects/rocr-runtime/tests/kfdtest/src/KFDMemoryTest.cpp index cd73a0f073..c261accca0 100644 --- a/projects/rocr-runtime/tests/kfdtest/src/KFDMemoryTest.cpp +++ b/projects/rocr-runtime/tests/kfdtest/src/KFDMemoryTest.cpp @@ -364,6 +364,7 @@ TEST_F(KFDMemoryTest , MapMemoryToGPU) { TEST_F(KFDMemoryTest, InvalidMemoryPointerAlloc) { TEST_START(TESTPROFILE_RUNALL) + m_MemoryFlags.ui32.NoNUMABind = 1; EXPECT_EQ(HSAKMT_STATUS_INVALID_PARAMETER, hsaKmtAllocMemory(0 /* system */, PAGE_SIZE, m_MemoryFlags, NULL)); TEST_END @@ -1685,6 +1686,8 @@ TEST_F(KFDMemoryTest, CheckZeroInitializationSysMem) { unsigned int offset = 257; // a constant offset, should be smaller than 512. unsigned int size = sysBufSize / sizeof(*pDb); + m_MemoryFlags.ui32.NoNUMABind = 1; + while (count--) { ret = hsaKmtAllocMemory(0 /* system */, sysBufSize, m_MemoryFlags, reinterpret_cast(&pDb)); diff --git a/projects/rocr-runtime/tests/kfdtest/src/KFDQMTest.cpp b/projects/rocr-runtime/tests/kfdtest/src/KFDQMTest.cpp index 9b036193d0..20dbf598e0 100644 --- a/projects/rocr-runtime/tests/kfdtest/src/KFDQMTest.cpp +++ b/projects/rocr-runtime/tests/kfdtest/src/KFDQMTest.cpp @@ -1486,6 +1486,7 @@ TEST_F(KFDQMTest, P2PTest) { memFlags.ui32.PageSize = HSA_PAGE_SIZE_4KB; memFlags.ui32.HostAccess = 1; memFlags.ui32.NonPaged = 1; + memFlags.ui32.NoNUMABind = 1; unsigned int end = size / sizeof(HSAuint32) - 1; /* 1. Allocate a system buffer and allow the access to GPUs */