SWDEV-443760 - Enable device kernel args for MI300

- Enable Device kernel args for MI300* for now.
- Fix a perf issue which impacts graph instantiate when dev kernel args
are enabled.

Change-Id: I962e58fd9d8dd1a8db95e601cb03a8e9c7bac97f
This commit is contained in:
Saleel Kudchadker
2024-02-28 23:08:47 +00:00
parent 2c0fa829b4
commit 68f40f78dd
3 changed files with 14 additions and 6 deletions
+5 -4
View File
@@ -3210,12 +3210,13 @@ bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes,
}
const auto pcieKernargs = !dev().isXgmi() && dev().settings().device_kernel_args_;
address argBuffer = hidden_arguments;
bool isGraphCapture = vcmd != nullptr && vcmd->getCapturingState();
// Find all parameters for the current kernel
if (!kernel.parameters().deviceKernelArgs() || gpuKernel.isInternalKernel()) {
// Allocate buffer to hold kernel arguments
if(vcmd != nullptr && vcmd->getCapturingState()) {
if (isGraphCapture) {
argBuffer = vcmd->getKernArgOffset();
} else {
const auto kernargSize = gpuKernel.KernargSegmentByteSize();
@@ -3226,7 +3227,7 @@ bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes,
nontemporalMemcpy(argBuffer, parameters,
std::min(gpuKernel.KernargSegmentByteSize(),
signature.paramsSize()));
if (pcieKernargs) {
if (pcieKernargs && !isGraphCapture) {
*dev().info().hdpMemFlushCntl = 1u;
}
}
@@ -3289,7 +3290,7 @@ bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes,
(HSA_FENCE_SCOPE_SYSTEM << HSA_PACKET_HEADER_RELEASE_FENCE_SCOPE);
aql_packet->setup = sizes.dimensions() << HSA_KERNEL_DISPATCH_PACKET_SETUP_DIMENSIONS;
}
if (pcieKernargs) {
if (pcieKernargs && !isGraphCapture) {
if (*dev().info().hdpMemFlushCntl != UINT32_MAX) {
LogError("Unexpected HDP Register readback value!");
}