From 13cdca7fb388661f78098099a9dfceac22d4a619 Mon Sep 17 00:00:00 2001 From: Eric Huang Date: Tue, 25 Mar 2025 15:01:26 -0400 Subject: [PATCH] kfdtest: fix max queues on multi-gpu mode The max queues per process is 1024 in KFD, KFDQMTest.OverSubscribeCpQueues fails with multi-gpu mode on more than 15 gpus, because 65x16=1040 exceeds 1024, so changing MAX_CP_QUEUES to adapt it will fix the issue. Signed-off-by: Eric Huang [ROCm/ROCR-Runtime commit: df6048429c0d401893bd4a36f6dee04c9e1fc51c] --- .../libhsakmt/tests/kfdtest/src/KFDQMTest.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/projects/rocr-runtime/libhsakmt/tests/kfdtest/src/KFDQMTest.cpp b/projects/rocr-runtime/libhsakmt/tests/kfdtest/src/KFDQMTest.cpp index 23dddf26ab..7ef4e30b92 100644 --- a/projects/rocr-runtime/libhsakmt/tests/kfdtest/src/KFDQMTest.cpp +++ b/projects/rocr-runtime/libhsakmt/tests/kfdtest/src/KFDQMTest.cpp @@ -36,6 +36,8 @@ #include "Dispatch.hpp" +extern unsigned int g_TestGPUsNum; + void KFDQMTest::SetUp() { ROUTINE_START @@ -740,7 +742,13 @@ static void OverSubscribeCpQueues(KFDTEST_PARAMETERS* pTestParamters) { return; } - static const unsigned int MAX_CP_QUEUES = 65; + /* The max queues per process is 1024 limited by + * KFD, so MAX_CP_QUEUES is needed to adapt it + * when total queues exceed it. + */ + static const unsigned int MAX_CP_QUEUES = g_TestGPUsNum > 15 ? + 1024 / g_TestGPUsNum : + 65; static const unsigned int MAX_PACKETS = 100; HsaMemoryBuffer destBuf(PAGE_SIZE, gpuNode, false);