From 588a5a2fd319a8f12c7f9b14109eba274cffe5fc Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Tue, 10 Sep 2024 13:57:03 +0000 Subject: [PATCH] rocrtst: Limit pool sizes to 2GB on emulator Individual simple tests such as CPUAccessToGPUMemoryTest are taking several hours on emulators as the total amount of VRAM keeps increasing. Limit the pool sizes to 2GB, only on emulator. Change-Id: I4b33e8549f89413da255731e6748f606ca64a663 --- rocrtst/common/common.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rocrtst/common/common.cc b/rocrtst/common/common.cc index 89b80f025f..b6650e9775 100644 --- a/rocrtst/common/common.cc +++ b/rocrtst/common/common.cc @@ -400,6 +400,12 @@ hsa_status_t AcquirePoolInfo(hsa_amd_memory_pool_t pool, &pool_i->size); RET_IF_HSA_COMMON_ERR(err); +#ifdef ROCRTST_EMULATOR_BUILD + // Limit pool sizes to 2 GB on emulator + const size_t max_pool_size = 2*1024*1024*1024UL; + pool_i->size = std::min(pool_i->size, max_pool_size); +#endif + err = hsa_amd_memory_pool_get_info(pool, HSA_AMD_MEMORY_POOL_INFO_RUNTIME_ALLOC_ALLOWED, &pool_i->alloc_allowed);