kfdtest: Add log message in KFDEvictTest

Map failures happen in AllocBuffers function when there
isn't enough space to move BO to vram. In such cases, the
function retries allocation/map until successful to continue
testing eviction and restore.

Print a message in KFDEvictTest when this happens to correlate
to the message seen in the kernel log.
amdgpu 0000:c1:00.0: amdgpu: Failed to map peer:0000:c1:00.0 mem_domain:4

Signed-off-by: Divya Shikre <DivyaUday.Shikre@amd.com>
Change-Id: I0475d8d9521a07612182e54fc7cddb9bd44353e6
Este commit está contenido en:
Divya Shikre
2022-04-06 16:32:23 -04:00
cometido por Divya Uday Shikre
padre f62e9b9821
commit 0d07b3477b
+10 -8
Ver fichero
@@ -84,21 +84,23 @@ void KFDEvictTest::AllocBuffers(HSAuint32 defaultGPUNode, HSAuint32 count, HSAui
if (hsaKmtMapMemoryToGPUNodes(m_pBuf, vramBufSize, NULL,
mapFlags, 1, reinterpret_cast<HSAuint32 *>(&defaultGPUNode)) == HSAKMT_STATUS_ERROR) {
EXPECT_SUCCESS(hsaKmtFreeMemory(m_pBuf, vramBufSize));
break;
LOG() << "Map failed for " << i << "/" << count << " buffer. Retrying allocation" << std::endl;
goto retry;
}
}
pBuffers.push_back(m_pBuf);
i++;
retry = 0;
} else {
if (retry++ > ALLOCATE_RETRY_TIMES) {
break;
}
/* Wait for 1 second to try allocate again */
sleep(1);
continue;
}
retry:
if (retry++ > ALLOCATE_RETRY_TIMES) {
break;
}
/* Wait for 1 second to try allocate again */
sleep(1);
}
}