From 8baf02e80baae9c844a2df9c859eb44a074de32d Mon Sep 17 00:00:00 2001 From: Felix Kuehling Date: Fri, 26 Feb 2021 22:35:00 -0500 Subject: [PATCH] kfdtest: Allow some CS to fail in EvictTest amdgpu_cs_submit can fail intermittently if another process has too much memory reserved at the time. Allow a small percental of command submissions to fail to make the test more robust. Signed-off-by: Felix Kuehling Change-Id: If9f62b2b6f67be71420016d4e38d4dd6b6bca9a5 --- tests/kfdtest/src/KFDEvictTest.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/kfdtest/src/KFDEvictTest.cpp b/tests/kfdtest/src/KFDEvictTest.cpp index adeb847f73..0fa45d8fa8 100644 --- a/tests/kfdtest/src/KFDEvictTest.cpp +++ b/tests/kfdtest/src/KFDEvictTest.cpp @@ -213,6 +213,7 @@ void KFDEvictTest::AmdgpuCommandSubmissionSdmaNop(int rn, amdgpu_bo_handle handl amdgpu_va_handle vaHandle; uint32_t *ptr; uint32_t expired; + unsigned failCount = 0; ASSERT_EQ(0, amdgpu_cs_ctx_create(m_RenderNodes[rn].device_handle, &contextHandle)); @@ -244,8 +245,14 @@ void KFDEvictTest::AmdgpuCommandSubmissionSdmaNop(int rn, amdgpu_bo_handle handl memset(&fenceStatus, 0, sizeof(struct amdgpu_cs_fence)); for (int i = 0; i < 100; i++) { - ASSERT_EQ(0, amdgpu_cs_submit(contextHandle, 0, &ibsRequest, 1)); + int r = amdgpu_cs_submit(contextHandle, 0, &ibsRequest, 1); + Delay(50); + if (r) { + failCount++; + ASSERT_LE(failCount, 2); + continue; + } fenceStatus.context = contextHandle; fenceStatus.ip_type = AMDGPU_HW_IP_DMA;