fix: Make debug area resident for subdevices

Resolves: NEO-9455

Signed-off-by: Jemale Lockett <jemale.lockett@intel.com>
This commit is contained in:
Jemale Lockett 2024-06-28 21:29:44 +00:00 committed by Compute-Runtime-Automation
parent acdd4f99c8
commit 7c42c255b9
2 changed files with 21 additions and 0 deletions

View File

@ -95,6 +95,11 @@ void DebuggerL0::initialize() {
NEO::MemoryOperationsHandler *memoryOperationsIface = rootDeviceEnvironment.memoryOperationsInterface.get();
if (memoryOperationsIface) {
memoryOperationsIface->makeResident(device, ArrayRef<NEO::GraphicsAllocation *>(&moduleDebugArea, 1));
auto numSubDevices = device->getNumSubDevices();
for (uint32_t i = 0; i < numSubDevices; i++) {
auto subDevice = device->getSubDevice(i);
memoryOperationsIface->makeResident(subDevice, ArrayRef<NEO::GraphicsAllocation *>(&moduleDebugArea, 1));
}
}
const auto &productHelper = device->getProductHelper();

View File

@ -216,6 +216,22 @@ HWTEST_F(L0DebuggerTest, givenDebuggerWhenCreatedThenModuleHeapDebugAreaIsCreate
neoDevice->getMemoryManager()->freeGraphicsMemory(allocation);
}
HWTEST_F(L0DebuggerTest, givenDebuggerCreatedWhenSubdevicesExistThenModuleHeapDebugAreaIsResidentForSubDevices) {
DebugManagerStateRestore restorer;
constexpr auto numSubDevices = 2;
debugManager.flags.CreateMultipleSubDevices.set(numSubDevices);
auto executionEnvironment = new NEO::ExecutionEnvironment;
auto devices = NEO::DeviceFactory::createDevices(*executionEnvironment);
auto neoDevice = devices[0].get();
auto memoryOperationsHandler = new NEO::MockMemoryOperations();
memoryOperationsHandler->makeResidentCalledCount = 0;
neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->memoryOperationsInterface.reset(memoryOperationsHandler);
auto debugger = std::make_unique<MockDebuggerL0Hw<FamilyType>>(neoDevice);
EXPECT_EQ((1 + numSubDevices), memoryOperationsHandler->makeResidentCalledCount);
}
HWTEST_F(L0DebuggerTest, givenBindlessSipWhenModuleHeapDebugAreaIsCreatedThenReservedFieldIsSet) {
DebugManagerStateRestore restorer;
NEO::debugManager.flags.UseBindlessDebugSip.set(1);