From 65d174c3e35423bf25c9c369513780c9d9ca760c 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 | 2 ++ 2 files changed, 6 insertions(+) diff --git a/rocclr/device/rocm/rocsettings.cpp b/rocclr/device/rocm/rocsettings.cpp index e1de3a142..9982b2eb8 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 @@ -284,6 +286,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 30d286d73..72c643bf4 100644 --- a/rocclr/utils/flags.hpp +++ b/rocclr/utils/flags.hpp @@ -251,6 +251,8 @@ release(bool, DEBUG_HIP_GRAPH_DOT_PRINT, false, \ "Enable/Disable graph debug dot print dump") \ release(bool, HIP_ALWAYS_USE_NEW_COMGR_UNBUNDLING_ACTION, false, \ "Force to always use new comgr unbundling action") \ +release(bool, DEBUG_CLR_KERNARG_HDP_FLUSH_WA, false, \ + "Toggle kernel arg copy workaround") \ namespace amd {