From d5bc650de9eca4b71e7a8c3731bef44ecbf51122 Mon Sep 17 00:00:00 2001 From: German Andryeyev Date: Tue, 26 Apr 2022 20:46:11 -0400 Subject: [PATCH] SWDEV-307184 - Fix a regression from dafc64ea Disable hostcall buffer in OCL for now. COv5 can add hostcallbuffer metadata for unknown reason. OCL may fail the buffer allocation and kernel launch. Change-Id: I34a6a45bac86c57422b764c0d69760c96920d6c5 [ROCm/clr commit: 934149ff0a4a13c8dbca8d63ee9a6eaa3115700b] --- .../clr/rocclr/device/rocm/rocvirtual.cpp | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/projects/clr/rocclr/device/rocm/rocvirtual.cpp b/projects/clr/rocclr/device/rocm/rocvirtual.cpp index 7f36548cc2..37c4f6f011 100644 --- a/projects/clr/rocclr/device/rocm/rocvirtual.cpp +++ b/projects/clr/rocclr/device/rocm/rocvirtual.cpp @@ -2780,19 +2780,21 @@ bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes, const break; } case amd::KernelParameterDescriptor::HiddenHostcallBuffer: { - if (dev().info().pcie_atomics_) { - uintptr_t buffer = reinterpret_cast( - roc_device_.getOrCreateHostcallBuffer(gpu_queue_, coopGroups, cuMask_)); - if (!buffer) { + if (amd::IS_HIP) { + if (dev().info().pcie_atomics_) { + uintptr_t buffer = reinterpret_cast( + roc_device_.getOrCreateHostcallBuffer(gpu_queue_, coopGroups, cuMask_)); + if (!buffer) { + ClPrint(amd::LOG_ERROR, amd::LOG_KERN, + "Kernel expects a hostcall buffer, but none found"); + return false; + } + WriteAqlArgAt(hidden_arguments, buffer, it.size_, it.offset_); + } else { ClPrint(amd::LOG_ERROR, amd::LOG_KERN, - "Kernel expects a hostcall buffer, but none found"); + "Pcie atomics not enabled, hostcall not supported"); return false; } - WriteAqlArgAt(hidden_arguments, buffer, it.size_, it.offset_); - } else { - ClPrint(amd::LOG_ERROR, amd::LOG_KERN, - "Pcie atomics not enabled, printf not supported"); - return false; } break; }