From b0558f264c464d32832753fcbc6c588feb6d2aa7 Mon Sep 17 00:00:00 2001 From: Philip Yang Date: Wed, 23 Oct 2024 23:08:28 -0400 Subject: [PATCH] kfdtest: Update KFDSVMEvictTest.QueueTest for CPX mode Current test has 4 processes, each process allocate and access 512 buffers, this requires 2048 waves to access 2048 buffers at same time to finish the test. For CPX compute partition mode, each compute node has less waves and cause random test failure. Change test to 2 processes to use 1024 waves to access 1024 buffers with the increased buffer size. Add waves_num check to avoid the test failure on new ASICs or simulator, skip test if the available waves is less than 1024. Signed-off-by: Philip Yang Change-Id: I64b5f9172b62cf38f62fbb0b48a801b8a11401c0 [ROCm/ROCR-Runtime commit: e6d4a32c4224ae2c5569dc827f55242cb0602c80] --- .../libhsakmt/tests/kfdtest/src/KFDSVMEvictTest.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/projects/rocr-runtime/libhsakmt/tests/kfdtest/src/KFDSVMEvictTest.cpp b/projects/rocr-runtime/libhsakmt/tests/kfdtest/src/KFDSVMEvictTest.cpp index 63c667f070..dc115e5697 100644 --- a/projects/rocr-runtime/libhsakmt/tests/kfdtest/src/KFDSVMEvictTest.cpp +++ b/projects/rocr-runtime/libhsakmt/tests/kfdtest/src/KFDSVMEvictTest.cpp @@ -31,7 +31,7 @@ #include "SDMAQueue.hpp" #include "Dispatch.hpp" -#define N_PROCESSES (4) /* number of processes running in parallel, at least 2 */ +#define N_PROCESSES (2) /* number of processes running in parallel, at least 2 */ #define ALLOCATE_BUF_SIZE_MB (64) #define ALLOCATE_RETRY_TIMES (3) #define MAX_WAVEFRONTS (512) @@ -320,6 +320,14 @@ TEST_P(KFDSVMEvictTest, QueueTest) { return; } + uint32_t cu_num = pNodeProperties->NumFComputeCores / pNodeProperties->NumSIMDPerCU; + uint32_t wave_num = MIN(cu_num * 40, + (pNodeProperties->NumShaderBanks / pNodeProperties->NumArrays) * 512); + if (wave_num < count * N_PROCESSES) { + LOG() << std::hex << "Test is skipped, wave_num " << wave_num << " not enough" << std::endl; + return; + } + HSAuint32 i; HSAuint64 vramSize = GetVramSize(defaultGPUNode);