Create KMD-migrated unified shared memory with multiple local memory regions

Remove the restriction on USM allocation created in a single local memory region
with latest KMD fix for cross tile migration thrashing b/t lmem (dii-3516)

Related-To: NEO-6909

Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
This commit is contained in:
Milczarek, Slawomir
2022-06-20 12:59:05 +00:00
committed by Compute-Runtime-Automation
parent ed9c2d074a
commit 6a9fcd38b1
4 changed files with 8 additions and 15 deletions

View File

@@ -488,10 +488,11 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenSetVmAdviseAtomicAttributeWhe
}
}
TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenUseKmdMigrationAndUsmInitialPlacementSetWhenCreateSharedUnifiedMemoryAllocationThenKmdMigratedAllocationIsCreatedWithCorrectRegionsOrder) {
TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenUseKmdMigrationAndUsmInitialPlacementSetToGpuWhenCreateUnifiedSharedMemoryWithOverridenMultiStoragePlacementThenKmdMigratedAllocationIsCreatedWithCorrectRegionsOrder) {
DebugManagerStateRestore restorer;
DebugManager.flags.UseKmdMigration.set(1);
DebugManager.flags.UsmInitialPlacement.set(1);
DebugManager.flags.OverrideMultiStoragePlacement.set(0x1);
RootDeviceIndicesContainer rootDeviceIndices = {mockRootDeviceIndex};
std::map<uint32_t, DeviceBitfield> deviceBitfields{{mockRootDeviceIndex, mockDeviceBitfield}};
@@ -530,11 +531,10 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenUseKmdMigrationAndUsmInitialP
unifiedMemoryManager.freeSVMAlloc(ptr);
}
TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenUseKmdMigrationAndUsmInitialPlacementSetWhenCreateSharedUnifiedMemoryAllocationWithMultiStoragePlacementThenKmdMigratedAllocationIsCreatedWithCorrectRegionsOrder) {
TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenUseKmdMigrationAndUsmInitialPlacementSetToGpuWhenCreateSharedUnifiedMemoryAllocationOnMultiTileArchitectureThenKmdMigratedAllocationIsCreatedWithCorrectRegionsOrder) {
DebugManagerStateRestore restorer;
DebugManager.flags.UseKmdMigration.set(1);
DebugManager.flags.UsmInitialPlacement.set(1);
DebugManager.flags.OverrideMultiStoragePlacement.set(0xF);
RootDeviceIndicesContainer rootDeviceIndices = {mockRootDeviceIndex};
std::map<uint32_t, DeviceBitfield> deviceBitfields{{mockRootDeviceIndex, mockDeviceBitfield}};

View File

@@ -4070,13 +4070,13 @@ TEST_F(DrmMemoryManagerTest, givenPageFaultIsSupportedAndKmdMigrationEnabledForB
MockDrmAllocation allocation(AllocationType::BUFFER, MemoryPool::LocalMemory);
allocation.bufferObjects[0] = &bo;
for (auto useKmdMigrationForBuffer : {-1, 0, 1}) {
DebugManager.flags.UseKmdMigrationForBuffers.set(useKmdMigrationForBuffer);
for (auto useKmdMigrationForBuffers : {-1, 0, 1}) {
DebugManager.flags.UseKmdMigrationForBuffers.set(useKmdMigrationForBuffers);
std::vector<BufferObject *> bufferObjects;
allocation.bindBO(&bo, &osContext, vmHandleId, &bufferObjects, true);
if (useKmdMigrationForBuffer > 0) {
if (useKmdMigrationForBuffers > 0) {
EXPECT_TRUE(allocation.shouldAllocationPageFault(&drm));
EXPECT_FALSE(bo.isExplicitResidencyRequired());
} else {