From f474cf21cdca29f3c18d7de72d9688b7e50a5e7b Mon Sep 17 00:00:00 2001 From: Felix Kuehling Date: Wed, 29 May 2019 00:15:13 -0400 Subject: [PATCH] kfdtest: Reduce libdrm VRAM usage in eviction tests This reduces thrashing due to graphics submissions only and significantly speeds up the BasicTest when keeping idle compute processes evicted. In the BasicTest compute is always idle, so only one compute eviction and no restore is triggered. Then graphics submissions complete quickly without thrashing each other. Change-Id: Iae6da98903b20424a5097f235e1d09cf13e4b41b Signed-off-by: Felix Kuehling --- tests/kfdtest/src/KFDEvictTest.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/kfdtest/src/KFDEvictTest.cpp b/tests/kfdtest/src/KFDEvictTest.cpp index 2de8b12358..5ad8dea59a 100644 --- a/tests/kfdtest/src/KFDEvictTest.cpp +++ b/tests/kfdtest/src/KFDEvictTest.cpp @@ -334,7 +334,7 @@ TEST_F(KFDEvictTest, BasicTest) { ASSERT_GE(defaultGPUNode, 0) << "failed to get default GPU Node"; HSAuint64 vramBufSize = ALLOCATE_BUF_SIZE_MB * 1024 * 1024; - HSAuint64 vramSize = GetVramSize(defaultGPUNode); + HSAuint64 vramSize = GetVramSize(defaultGPUNode) * 7 / 8; if (!vramSize) { LOG() << "Skipping test: No VRAM found." << std::endl; @@ -344,7 +344,7 @@ TEST_F(KFDEvictTest, BasicTest) { } // Use 7/8 of VRAM between all processes - HSAuint32 count = vramSize * 7 / (8* vramBufSize * N_PROCESSES); + HSAuint32 count = vramSize / (vramBufSize * N_PROCESSES); LOG() << "Found System RAM of " << std::dec << (GetSysMemSize() >> 20) << "MB" << std::endl; @@ -537,7 +537,7 @@ TEST_F(KFDEvictTest, QueueTest) { } HSAuint32 i; - HSAuint64 vramSize = GetVramSize(defaultGPUNode); + HSAuint64 vramSize = GetVramSize(defaultGPUNode) * 7 / 8; if (!vramSize) { LOG() << "Skipping test: No VRAM found." << std::endl; @@ -547,7 +547,7 @@ TEST_F(KFDEvictTest, QueueTest) { } // Use 7/8 of VRAM between all processes - HSAuint32 count = vramSize * 7 / (8 * vramBufSize * N_PROCESSES); + HSAuint32 count = vramSize / (vramBufSize * N_PROCESSES); LOG() << "Found System RAM of " << std::dec << (GetSysMemSize() >> 20) << "MB" << std::endl; @@ -646,7 +646,7 @@ TEST_F(KFDEvictTest, BurstyTest) { ASSERT_GE(defaultGPUNode, 0) << "failed to get default GPU Node"; HSAuint64 vramBufSize = ALLOCATE_BUF_SIZE_MB * 1024 * 1024; - HSAuint64 vramSize = GetVramSize(defaultGPUNode); + HSAuint64 vramSize = GetVramSize(defaultGPUNode) * 7 / 8; if (!vramSize) { LOG() << "Skipping test: No VRAM found." << std::endl; @@ -656,7 +656,7 @@ TEST_F(KFDEvictTest, BurstyTest) { } // Use 7/8 of VRAM between all processes - HSAuint32 count = vramSize * 7 / (8* vramBufSize * N_PROCESSES); + HSAuint32 count = vramSize / (vramBufSize * N_PROCESSES); LOG() << "Found System RAM of " << std::dec << (GetSysMemSize() >> 20) << "MB" << std::endl;