From 42799c9f213abe82d96b9d76c5af3ecb9c9943a9 Mon Sep 17 00:00:00 2001 From: Julia Jiang Date: Wed, 13 Sep 2023 14:53:20 -0400 Subject: [PATCH] SWDEV-401314 - Fix failure on MI300 for progvar_prog_scope_misc basic test Change-Id: I56701b050023199a3e56dc5a78553c0c330b8537 --- rocclr/device/rocm/rocdevice.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/rocclr/device/rocm/rocdevice.cpp b/rocclr/device/rocm/rocdevice.cpp index c1f3a94b3f..0248d234ce 100644 --- a/rocclr/device/rocm/rocdevice.cpp +++ b/rocclr/device/rocm/rocdevice.cpp @@ -1293,7 +1293,16 @@ bool Device::populateOCLDeviceConstants() { GPU_SINGLE_ALLOC_PERCENT = 75; } } - + // Limit gpu single allocation percentage on MI300 1P which has one gpu. + if ((isa().versionMajor() == 9) && (isa().versionMinor() == 4) && + (isa().versionStepping() == 0)) { + if (gpu_agents_.size() == 1 || p2p_agents_.size() == 0) { + if (flagIsDefault(GPU_SINGLE_ALLOC_PERCENT)) { + GPU_SINGLE_ALLOC_PERCENT = 60; + } + } + } + gpuvm_segment_max_alloc_ = uint64_t(info_.globalMemSize_ * std::min(GPU_SINGLE_ALLOC_PERCENT, 100u) / 100u); assert(gpuvm_segment_max_alloc_ > 0);