fix: disable copy offload for dcFlush platforms

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2025-02-20 18:06:50 +00:00
committed by Compute-Runtime-Automation
parent 24ed89ed24
commit 0b34ed6793
2 changed files with 45 additions and 19 deletions

View File

@@ -209,8 +209,9 @@ CommandList *CommandList::createImmediate(uint32_t productFamily, Device *device
commandList->isSyncModeQueue |= true;
}
auto &productHelper = device->getProductHelper();
if (!internalUsage) {
auto &productHelper = device->getProductHelper();
commandList->isFlushTaskSubmissionEnabled = gfxCoreHelper.isPlatformFlushTaskEnabled(productHelper);
if (NEO::debugManager.flags.EnableFlushTaskSubmission.get() != -1) {
commandList->isFlushTaskSubmissionEnabled = !!NEO::debugManager.flags.EnableFlushTaskSubmission.get();
@@ -258,9 +259,11 @@ CommandList *CommandList::createImmediate(uint32_t productFamily, Device *device
commandList->isBcsSplitNeeded = deviceImp->bcsSplit.setupDevice(productFamily, internalUsage, &cmdQdesc, csr);
commandList->copyThroughLockedPtrEnabled = gfxCoreHelper.copyThroughLockedPtrEnabled(hwInfo, device->getProductHelper());
commandList->copyThroughLockedPtrEnabled = gfxCoreHelper.copyThroughLockedPtrEnabled(hwInfo, productHelper);
if ((NEO::debugManager.flags.ForceCopyOperationOffloadForComputeCmdList.get() == 1 || queueProperties.copyOffloadHint) && !commandList->isCopyOnly(false) && commandList->isInOrderExecutionEnabled()) {
const bool cmdListSupportsCopyOffload = !commandList->isCopyOnly(false) && commandList->isInOrderExecutionEnabled() && !productHelper.isDcFlushAllowed();
if ((NEO::debugManager.flags.ForceCopyOperationOffloadForComputeCmdList.get() == 1 || queueProperties.copyOffloadHint) && cmdListSupportsCopyOffload) {
commandList->enableCopyOperationOffload(productFamily, device, desc);
}

View File

@@ -56,17 +56,26 @@ HWTEST2_F(CopyOffloadInOrderTests, givenDebugFlagSetWhenCreatingCmdListThenEnabl
cmdQueueDesc.flags = ZE_COMMAND_QUEUE_FLAG_IN_ORDER;
cmdQueueDesc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS;
auto dcFlushRequired = device->getProductHelper().isDcFlushAllowed();
{
EXPECT_EQ(ZE_RESULT_SUCCESS, zeCommandListCreateImmediate(context, device, &cmdQueueDesc, &cmdListHandle));
auto cmdList = static_cast<WhiteBox<L0::CommandListCoreFamilyImmediate<gfxCoreFamily>> *>(CommandList::fromHandle(cmdListHandle));
EXPECT_TRUE(cmdList->copyOperationOffloadEnabled);
EXPECT_NE(nullptr, cmdList->cmdQImmediateCopyOffload);
auto queue = static_cast<WhiteBox<L0::CommandQueue> *>(cmdList->cmdQImmediateCopyOffload);
EXPECT_EQ(cmdQueueDesc.priority, queue->desc.priority);
EXPECT_EQ(cmdQueueDesc.mode, queue->desc.mode);
EXPECT_TRUE(queue->peekIsCopyOnlyCommandQueue());
EXPECT_TRUE(NEO::EngineHelpers::isBcs(queue->getCsr()->getOsContext().getEngineType()));
if (dcFlushRequired) {
EXPECT_FALSE(cmdList->copyOperationOffloadEnabled);
EXPECT_EQ(nullptr, cmdList->cmdQImmediateCopyOffload);
} else {
EXPECT_TRUE(cmdList->copyOperationOffloadEnabled);
EXPECT_NE(nullptr, cmdList->cmdQImmediateCopyOffload);
auto queue = static_cast<WhiteBox<L0::CommandQueue> *>(cmdList->cmdQImmediateCopyOffload);
EXPECT_EQ(cmdQueueDesc.priority, queue->desc.priority);
EXPECT_EQ(cmdQueueDesc.mode, queue->desc.mode);
EXPECT_TRUE(queue->peekIsCopyOnlyCommandQueue());
EXPECT_TRUE(NEO::EngineHelpers::isBcs(queue->getCsr()->getOsContext().getEngineType()));
}
zeCommandListDestroy(cmdListHandle);
}
@@ -77,14 +86,20 @@ HWTEST2_F(CopyOffloadInOrderTests, givenDebugFlagSetWhenCreatingCmdListThenEnabl
EXPECT_EQ(ZE_RESULT_SUCCESS, zeCommandListCreateImmediate(context, device, &cmdQueueDesc, &cmdListHandle));
auto cmdList = static_cast<WhiteBox<L0::CommandListCoreFamilyImmediate<gfxCoreFamily>> *>(CommandList::fromHandle(cmdListHandle));
EXPECT_TRUE(cmdList->copyOperationOffloadEnabled);
EXPECT_NE(nullptr, cmdList->cmdQImmediateCopyOffload);
auto queue = static_cast<WhiteBox<L0::CommandQueue> *>(cmdList->cmdQImmediateCopyOffload);
EXPECT_EQ(cmdQueueDesc.priority, queue->desc.priority);
EXPECT_EQ(cmdQueueDesc.mode, queue->desc.mode);
EXPECT_TRUE(queue->peekIsCopyOnlyCommandQueue());
EXPECT_TRUE(NEO::EngineHelpers::isBcs(queue->getCsr()->getOsContext().getEngineType()));
if (dcFlushRequired) {
EXPECT_FALSE(cmdList->copyOperationOffloadEnabled);
EXPECT_EQ(nullptr, cmdList->cmdQImmediateCopyOffload);
} else {
EXPECT_TRUE(cmdList->copyOperationOffloadEnabled);
EXPECT_NE(nullptr, cmdList->cmdQImmediateCopyOffload);
auto queue = static_cast<WhiteBox<L0::CommandQueue> *>(cmdList->cmdQImmediateCopyOffload);
EXPECT_EQ(cmdQueueDesc.priority, queue->desc.priority);
EXPECT_EQ(cmdQueueDesc.mode, queue->desc.mode);
EXPECT_TRUE(queue->peekIsCopyOnlyCommandQueue());
EXPECT_TRUE(NEO::EngineHelpers::isBcs(queue->getCsr()->getOsContext().getEngineType()));
}
zeCommandListDestroy(cmdListHandle);
@@ -145,11 +160,19 @@ HWTEST2_F(CopyOffloadInOrderTests, givenQueueDescriptorWhenCreatingCmdListThenEn
cmdQueueDesc.pNext = &copyOffloadDesc;
auto dcFlushRequired = device->getProductHelper().isDcFlushAllowed();
{
EXPECT_EQ(ZE_RESULT_SUCCESS, zeCommandListCreateImmediate(context, device, &cmdQueueDesc, &cmdListHandle));
auto cmdList = static_cast<WhiteBox<L0::CommandListCoreFamilyImmediate<gfxCoreFamily>> *>(CommandList::fromHandle(cmdListHandle));
EXPECT_TRUE(cmdList->copyOperationOffloadEnabled);
EXPECT_NE(nullptr, cmdList->cmdQImmediateCopyOffload);
if (dcFlushRequired) {
EXPECT_FALSE(cmdList->copyOperationOffloadEnabled);
EXPECT_EQ(nullptr, cmdList->cmdQImmediateCopyOffload);
} else {
EXPECT_TRUE(cmdList->copyOperationOffloadEnabled);
EXPECT_NE(nullptr, cmdList->cmdQImmediateCopyOffload);
}
zeCommandListDestroy(cmdListHandle);
}