From b6e18ceeae4cd14fb506fef90ffdc2cc8a98a2b7 Mon Sep 17 00:00:00 2001 From: Philip Yang Date: Mon, 17 Jun 2024 13:30:19 -0400 Subject: [PATCH] kfdtest: Skip ContiguousVRAMAllocation if no enough VRAM RDMATest.ContiguousVRAMAllocation test uses 4GB buffer, skip the test if total VRAM size is less than 5GB, considering page table and other reserved VRAM usage. Change-Id: I0342417501cdd3477c2bf1b2f7d1e6bef61d1871 Signed-off-by: Philip Yang Signed-off-by: Chris Freehill [ROCm/ROCR-Runtime commit: 42df8b2b34361535d934f7198e377efb72b6d673] --- .../rocr-runtime/libhsakmt/tests/kfdtest/src/RDMATest.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/projects/rocr-runtime/libhsakmt/tests/kfdtest/src/RDMATest.cpp b/projects/rocr-runtime/libhsakmt/tests/kfdtest/src/RDMATest.cpp index 1931ea1741..fd7cefa195 100644 --- a/projects/rocr-runtime/libhsakmt/tests/kfdtest/src/RDMATest.cpp +++ b/projects/rocr-runtime/libhsakmt/tests/kfdtest/src/RDMATest.cpp @@ -125,6 +125,11 @@ TEST_F(RDMATest, ContiguousVRAMAllocation) { int defaultGPUNode = m_NodeInfo.HsaDefaultGPUNode(); ASSERT_GE(defaultGPUNode, 0) << "failed to get default GPU Node"; + if (GetVramSize(defaultGPUNode) < BufferSize + (1UL << 30)) { + LOG() << "no enough VRAM, skipping the test" << std::endl; + return; + } + HsaMemoryBuffer isaBuffer(PAGE_SIZE, defaultGPUNode); HsaMemoryBuffer srcSysBuffer(PAGE_SIZE, defaultGPUNode, false); void *LocalBuffer;