fix: disable staging when shares system usm is enabled

Related-To: NEO-14026

Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
Szymon Morek
2025-08-29 11:06:47 +00:00
committed by Compute-Runtime-Automation
parent 25fd35d9df
commit e8b14dee12
2 changed files with 22 additions and 0 deletions

View File

@@ -1921,6 +1921,9 @@ bool CommandListCoreFamilyImmediate<gfxCoreFamily>::isValidForStagingTransfer(co
if (this->useAdditionalBlitProperties) {
return false;
}
if (this->isSharedSystemEnabled()) {
return false;
}
auto driver = this->getDevice()->getDriverHandle();
auto importedAlloc = driver->findHostPointerAllocation(const_cast<void *>(srcptr), size, this->getDevice()->getRootDeviceIndex());
if (importedAlloc != nullptr) {

View File

@@ -1474,6 +1474,25 @@ HWTEST_F(StagingBuffersFixture, givenAppendMemoryCopyWithStagingThenDontImportAl
}
}
HWTEST_F(StagingBuffersFixture, givenSharedSystemUsmThenDontUseStagingBuffers) {
DebugManagerStateRestore restorer;
debugManager.flags.EnableSharedSystemUsmSupport.set(1);
debugManager.flags.TreatNonUsmForTransfersAsSharedSystem.set(1);
debugManager.flags.EmitMemAdvisePriorToCopyForNonUsm.set(1);
MockCommandListImmediateHw<FamilyType::gfxCoreFamily> cmdList;
cmdList.cmdQImmediate = queue.get();
cmdList.initialize(device, NEO::EngineGroupType::compute, 0u);
auto &hwInfo = *device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo();
VariableBackup<uint64_t> sharedSystemMemCapabilities{&hwInfo.capabilityTable.sharedSystemMemCapabilities};
sharedSystemMemCapabilities = 0xf;
size_t src[size] = {};
auto res = cmdList.appendMemoryCopy(usmDevice, &src, size, nullptr, 0, nullptr, copyParams);
ASSERT_EQ(ZE_RESULT_SUCCESS, res);
EXPECT_EQ(1u, cmdList.getMemAdviseOperations().size());
}
HWTEST_F(StagingBuffersFixture, givenStagingBufferManagerDestroyedAndHostSynchronizeCalledThenSuccessReturned) {
driverHandle->stagingBufferManager.reset();
MockCommandListImmediateHw<FamilyType::gfxCoreFamily> cmdList;