From 9de6d4d46c2ad7e36e42be8b350e490bf89fde8d Mon Sep 17 00:00:00 2001 From: Saleel Kudchadker Date: Tue, 10 Sep 2024 23:52:48 +0000 Subject: [PATCH] SWDEV-478624 - Use readback workaround to ensure kernel arg coherence Use env var DEBUG_CLR_KERNARG_HDP_FLUSH_WA=1 to fall back to HDP flush workaround. The default is 0 Change-Id: I7bdb9be61da60c30d15ac9991b7cd27351e1831c --- rocclr/device/rocm/rocsettings.cpp | 4 ++++ rocclr/utils/flags.hpp | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/rocclr/device/rocm/rocsettings.cpp b/rocclr/device/rocm/rocsettings.cpp index 92b67fc86c..593992cccc 100644 --- a/rocclr/device/rocm/rocsettings.cpp +++ b/rocclr/device/rocm/rocsettings.cpp @@ -256,6 +256,8 @@ void Settings::setKernelArgImpl(const amd::Isa& isa, bool isXgmi, bool hasValidH auto kernelArgImpl = KernelArgImpl::HostKernelArgs; + hasValidHDPFlush &= DEBUG_CLR_KERNARG_HDP_FLUSH_WA; + if (isXgmi) { // The XGMI-connected path does not require the manual memory ordering // workarounds that the PCIe connected path requires @@ -281,6 +283,8 @@ void Settings::setKernelArgImpl(const amd::Isa& isa, bool isXgmi, bool hasValidH if (!flagIsDefault(HIP_FORCE_DEV_KERNARG)) { kernel_arg_impl_ = kernelArgImpl & (HIP_FORCE_DEV_KERNARG ? 0xF : 0x0); } + + ClPrint(amd::LOG_INFO, amd::LOG_INIT, "Using dev kernel arg wa = %d", kernel_arg_impl_); } } // namespace amd::roc diff --git a/rocclr/utils/flags.hpp b/rocclr/utils/flags.hpp index 4e781d55b3..ea1ff2b7ed 100644 --- a/rocclr/utils/flags.hpp +++ b/rocclr/utils/flags.hpp @@ -258,7 +258,9 @@ release(bool, HIP_ALWAYS_USE_NEW_COMGR_UNBUNDLING_ACTION, false, \ release(bool, DEBUG_HIP_KERNARG_COPY_OPT, true, \ "Enable/Disable multiple kern arg copies") \ release(bool, DEBUG_CLR_USE_STDMUTEX_IN_AMD_MONITOR, false, \ - "Use std::mutext in amd::monotor") \ + "Use std::mutex in amd::monotor") \ +release(bool, DEBUG_CLR_KERNARG_HDP_FLUSH_WA, false, \ + "Toggle kernel arg copy workaround") \ namespace amd {