From 2b746de6de145ee523081d4b20c5e7cfd4bbfed4 Mon Sep 17 00:00:00 2001 From: Ioannis Assiouras Date: Wed, 8 May 2024 01:23:25 +0100 Subject: [PATCH] SWDEV-451594 - Fallback to host kernel args on older devices On gfx8, gfx9 devices before MI100 and gfx10.0 or gfx10.1 none of the memory ordering workarounds for device kernel arguments can be applied. Use host kernel arguments on these devices. Change-Id: I9be6fbfe4b3986eb7d9f83998334df5f03fd4124 --- rocclr/device/rocm/rocsettings.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/rocclr/device/rocm/rocsettings.cpp b/rocclr/device/rocm/rocsettings.cpp index c3c5566337..4a447329b9 100644 --- a/rocclr/device/rocm/rocsettings.cpp +++ b/rocclr/device/rocm/rocsettings.cpp @@ -250,6 +250,10 @@ void Settings::setKernelArgImpl(const amd::Isa& isa, bool isXgmi, bool hasValidH const bool isMI300 = gfxipMajor == 9 && gfxipMinor == 4 && (gfxStepping == 0 || gfxStepping == 1 || gfxStepping == 2); const bool isMI200 = (gfxipMajor == 9 && gfxipMinor == 0 && gfxStepping == 10); + const bool isPreMI100 = + (gfxipMajor < 9) || ((gfxipMajor == 9) && (gfxStepping < 8)); + const bool isNavi10 = + (gfxipMajor == 10) && ((gfxipMinor == 0) || (gfxipMinor == 1)); auto kernelArgImpl = KernelArgImpl::HostKernelArgs; @@ -259,7 +263,11 @@ void Settings::setKernelArgImpl(const amd::Isa& isa, bool isXgmi, bool hasValidH kernelArgImpl = KernelArgImpl::DeviceKernelArgs; } else if (hasValidHDPFlush) { // If the HDP flush register is valid implement the HDP flush to MMIO - kernelArgImpl = KernelArgImpl::DeviceKernelArgsHDP; + // workaround. This does not work on gfx9 devices before MI100 or Navi10 + // devices + if (!(isPreMI100 || isNavi10)) { + kernelArgImpl = KernelArgImpl::DeviceKernelArgsHDP; + } } else if (isMI300 || isMI200) { // Implement the kernel argument readback workaround // (write all args -> sfence -> write last byte -> mfence -> read last byte)