diff --git a/projects/clr/rocclr/runtime/device/pal/paldevice.cpp b/projects/clr/rocclr/runtime/device/pal/paldevice.cpp index 59721a9923..19dc753f58 100644 --- a/projects/clr/rocclr/runtime/device/pal/paldevice.cpp +++ b/projects/clr/rocclr/runtime/device/pal/paldevice.cpp @@ -2003,7 +2003,7 @@ bool Device::allocScratch(uint regNum, const VirtualGPU* vgpu) { if (scratchBuf->regNum_ > 0) { scratchBuf->destroyMemory(); // Calculate the size of the scratch buffer for a queue - uint32_t numTotalCUs = info().maxComputeUnits_; + uint32_t numTotalCUs = properties().gfxipProperties.shaderCore.numAvailableCus; uint32_t numMaxWaves = settings().numScratchWavesPerCu_ * numTotalCUs; scratchBuf->size_ = static_cast(info().wavefrontWidth_) * scratchBuf->regNum_ * numMaxWaves * sizeof(uint32_t); diff --git a/projects/clr/rocclr/runtime/device/pal/palsettings.cpp b/projects/clr/rocclr/runtime/device/pal/palsettings.cpp index 0cbe3a17a8..0f1949aac2 100644 --- a/projects/clr/rocclr/runtime/device/pal/palsettings.cpp +++ b/projects/clr/rocclr/runtime/device/pal/palsettings.cpp @@ -211,6 +211,9 @@ bool Settings::create(const Pal::DeviceProperties& palProp, enableWave32Mode_ = GPU_ENABLE_WAVE32_MODE; } lcWavefrontSize64_ = !enableWave32Mode_; + if (enableWave32Mode_) { + numScratchWavesPerCu_ *= 2; + } // Fall through to AI (gfx9) ... case Pal::AsicRevision::Vega20: // Enable HW P2P path for Vega20+. Runtime still relies on KMD/PAL for support