From 642165b1bc8d7c0087c0883fdd86e4cc81432119 Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Tue, 7 Nov 2023 23:05:03 +0000 Subject: [PATCH] Increase scratch aperture size to 4GB per XCC Change-Id: Ia02cea45ce8b782527f44fec539b0ab7cc453200 --- runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp b/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp index ec1875c0a6..b8170a5803 100644 --- a/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp +++ b/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp @@ -496,9 +496,10 @@ void GpuAgent::InitScratchPool() { size_t max_scratch_len = queue_scratch_len_ * max_queues_; #if defined(HSA_LARGE_MODEL) && defined(__linux__) + const size_t max_scratch_device = properties_.NumXcc * 4294967296; // For 64-bit linux use max queues unless otherwise specified - if ((max_scratch_len == 0) || (max_scratch_len > 4294967296)) { - max_scratch_len = 4294967296; // 4GB apeture max + if ((max_scratch_len == 0) || (max_scratch_len > max_scratch_device)) { + max_scratch_len = max_scratch_device; // 4GB per XCC apeture max } #endif