kfdtest: Adjust KFDEvictTest memory size

We were hitting memory map errors and segfaults when trying to use 7/8
VRAM on certain cards (dmesg showing "Failed to map to gpu 0/1"), as the
original check didn't see if this would exceed the GTT size.
Allocate the smaller of 1/3 of SRAM or 7/16 of VRAM (7/8 / 2) for the
tests

Signed-off-by: Kent Russell <kent.russell@amd.com>
Change-Id: Ic11a5cee058535418eef903a28846e00e1839969
이 커밋은 다음에 포함됨:
Kent Russell
2021-07-20 14:36:15 -04:00
부모 04b149b7fd
커밋 d5d8c022f1
+3 -3
파일 보기
@@ -478,7 +478,7 @@ TEST_F(KFDEvictTest, BasicTest) {
AllocBuffers(defaultGPUNode, count, vramBufSize, pBuffers);
/* Allocate gfx vram size of at most one third system memory */
HSAuint64 size = sysMemSize / 3 < testSize ? sysMemSize / 3 : testSize;
HSAuint64 size = sysMemSize / 3 < testSize / 2 ? sysMemSize / 3 : testSize / 2;
amdgpu_bo_handle handle;
AllocAmdgpuBo(rn, size, handle);
@@ -576,7 +576,7 @@ TEST_F(KFDEvictTest, QueueTest) {
AllocBuffers(defaultGPUNode, count, vramBufSize, pBuffers);
/* Allocate gfx vram size of at most one third system memory */
HSAuint64 size = sysMemSize / 3 < testSize ? sysMemSize / 3 : testSize;
HSAuint64 size = sysMemSize / 3 < testSize / 2 ? sysMemSize / 3 : testSize / 2;
amdgpu_bo_handle handle;
AllocAmdgpuBo(rn, size, handle);
@@ -675,7 +675,7 @@ TEST_F(KFDEvictTest, BurstyTest) {
AllocBuffers(defaultGPUNode, count, vramBufSize, pBuffers);
/* Allocate gfx vram size of at most one third system memory */
HSAuint64 size = sysMemSize / 3 < testSize ? sysMemSize / 3 : testSize;
HSAuint64 size = sysMemSize / 3 < testSize / 2 ? sysMemSize / 3 : testSize / 2;
amdgpu_bo_handle handle;
AllocAmdgpuBo(rn, size, handle);