kfdtest: Update KFDMultiProcessTest class to support kfdtest run on multiple gpu

Update KFDMultiProcessTest class to fork process on gpu wise.

Signed-off-by: Xiaogang Chen <Xiaogang.Chen@amd.com>
Change-Id: Ibb12d64b4cbc5f082d737fd8d8a74233b75be13e
This commit is contained in:
Xiaogang Chen
2024-12-12 17:31:06 -06:00
committed by Xiaogang Chen
parent b4943d718b
commit c69e660e7a
6 changed files with 98 additions and 58 deletions
@@ -267,20 +267,23 @@ TEST_F(KFDPCSamplingTest, MultiProcPcSamplingTest) {
samples[0].value = 0x100000; /* 1,048,576 usec */
/* Fork the child processes */
ForkChildProcesses(N_PROCESSES);
ForkChildProcesses(defaultGPUNode, N_PROCESSES);
int rn = FindDRMRenderNode(defaultGPUNode);
if (rn < 0) {
LOG() << "Skipping test: Could not find render node for default GPU." << std::endl;
WaitChildProcesses();
WaitChildProcesses(defaultGPUNode);
return;
}
params.samples = samples;
params.test_name = m_psName;
int gpuIndex = m_NodeInfo.HsaGPUindexFromGpuNode(defaultGPUNode);
params.test_name = m_psName[gpuIndex];
PCSamplingProcRun(&params);
WaitChildProcesses();
WaitChildProcesses(defaultGPUNode);
if (info_buf)
free(info_buf);