diff --git a/shared/source/debug_settings/debug_variables_base.inl b/shared/source/debug_settings/debug_variables_base.inl index 5919c13c75..9a17807ca8 100644 --- a/shared/source/debug_settings/debug_variables_base.inl +++ b/shared/source/debug_settings/debug_variables_base.inl @@ -199,6 +199,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, UseDrmVirtualEnginesForCcs, -1, "-1: default, 0: DECLARE_DEBUG_VARIABLE(int32_t, UseDrmVirtualEnginesForBcs, -1, "-1: default, 0: disable, 1: enable, Combine all BCS nodes to single VE (per context)") DECLARE_DEBUG_VARIABLE(int32_t, LimitEngineCountForVirtualBcs, -1, "-1: default, >0 Only use VirtualEngine with limited amount of engines, not max ") DECLARE_DEBUG_VARIABLE(int32_t, LimitEngineCountForVirtualCcs, -1, "-1: default, >0 Only use VirtualEngine with limited amount of engines, not max ") +DECLARE_DEBUG_VARIABLE(int32_t, KMDSupportForCrossTileMigrationPolicy, -1, "-1: default, 0: no KMD support, 1: KMD support for cross-tile migrations of shared allocations") DECLARE_DEBUG_VARIABLE(int32_t, CreateContextWithAccessCounters, -1, "-1: default, 0: ignore, 1: create context with Access Counter programming") DECLARE_DEBUG_VARIABLE(int32_t, AccessCountersTrigger, -1, "-1: default - disabled, 0: disabled, >= 0: triggering thresholds") DECLARE_DEBUG_VARIABLE(int32_t, AccessCountersGranularity, -1, "-1: default - ACG_2MB, >= 0: granularites - 0: ACG_128K, 1: ACG_2M, 2: ACG_16M, 3: ACG_16M") diff --git a/shared/source/os_interface/linux/drm_allocation.cpp b/shared/source/os_interface/linux/drm_allocation.cpp index 2456e5a55d..6156fda556 100644 --- a/shared/source/os_interface/linux/drm_allocation.cpp +++ b/shared/source/os_interface/linux/drm_allocation.cpp @@ -368,7 +368,7 @@ bool DrmAllocation::setMemPrefetch(Drm *drm, SubDeviceIdsVec &subDeviceIds) { if (storageInfo.memoryBanks.test(handleId)) { auto bo = this->getBOs()[handleId]; auto subDeviceId = handleId; - if (DebugManager.flags.CreateContextWithAccessCounters.get() > 0) { + if (DebugManager.flags.KMDSupportForCrossTileMigrationPolicy.get() > 0) { subDeviceId = subDeviceIds[handleId % subDeviceIds.size()]; } for (auto vmHandleId : subDeviceIds) { diff --git a/shared/source/os_interface/linux/drm_memory_manager.cpp b/shared/source/os_interface/linux/drm_memory_manager.cpp index 828e8c7758..f6e750b592 100644 --- a/shared/source/os_interface/linux/drm_memory_manager.cpp +++ b/shared/source/os_interface/linux/drm_memory_manager.cpp @@ -2153,7 +2153,7 @@ GraphicsAllocation *DrmMemoryManager::createSharedUnifiedMemoryAllocation(const break; } - auto memoryBanks = DebugManager.flags.CreateContextWithAccessCounters.get() > 0 ? allocationData.storageInfo.memoryBanks : DeviceBitfield(1 << handleId); + auto memoryBanks = DebugManager.flags.KMDSupportForCrossTileMigrationPolicy.get() > 0 ? allocationData.storageInfo.memoryBanks : DeviceBitfield(1 << handleId); auto memRegions = createMemoryRegionsForSharedAllocation(*pHwInfo, *memoryInfo, allocationData, memoryBanks); auto ret = memoryInfo->createGemExt(memRegions, currentSize, handle, {}, -1); diff --git a/shared/test/common/test_files/igdrcl.config b/shared/test/common/test_files/igdrcl.config index 95b8382112..4d26646247 100644 --- a/shared/test/common/test_files/igdrcl.config +++ b/shared/test/common/test_files/igdrcl.config @@ -436,6 +436,7 @@ LimitEngineCountForVirtualCcs = -1 ForceRunAloneContext = -1 AppendMemoryPrefetchForKmdMigratedSharedAllocations = 1 ForceMemoryPrefetchForKmdMigratedSharedAllocations = 0 +KMDSupportForCrossTileMigrationPolicy = -1 CreateContextWithAccessCounters = -1 AccessCountersTrigger = -1 AccessCountersGranularity = -1 diff --git a/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_prelim_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_prelim_tests.cpp index 064563d86b..7f713d3c2f 100644 --- a/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_prelim_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_prelim_tests.cpp @@ -367,9 +367,9 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, whenCreateUnifiedMemoryAllocationW memoryManager->freeGraphicsMemory(allocation); } -TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenCreateContextWithAccessCountersWhenCreateUnifiedMemoryAllocationWithMultiMemoryRegionsThenGemCreateExtIsUsedWithAllRegions) { +TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenKMDSupportForCrossTileMigrationPolicyWhenCreateUnifiedMemoryAllocationWithMultiMemoryRegionsThenGemCreateExtIsUsedWithAllRegions) { DebugManagerStateRestore restorer; - DebugManager.flags.CreateContextWithAccessCounters.set(1); + DebugManager.flags.KMDSupportForCrossTileMigrationPolicy.set(1); std::vector regionInfo(4); regionInfo[0].region = {drm_i915_gem_memory_class::I915_MEMORY_CLASS_SYSTEM, 1}; @@ -674,10 +674,10 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenUseKmdMigrationAndUsmInitialP unifiedMemoryManager.freeSVMAlloc(ptr); } -TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenUseKmdMigrationWithAccessCountersAndUsmInitialPlacementSetToGpuWhenCreateSharedUnifiedMemoryAllocationOnMultiTileArchitectureThenKmdMigratedAllocationIsCreatedWithCorrectRegionsOrder) { +TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenKMDSupportForCrossTileMigrationPolicyAndUsmInitialPlacementSetToGpuWhenCreateSharedUnifiedMemoryAllocationOnMultiTileArchitectureThenKmdMigratedAllocationIsCreatedWithCorrectRegionsOrder) { DebugManagerStateRestore restorer; DebugManager.flags.UseKmdMigration.set(1); - DebugManager.flags.CreateContextWithAccessCounters.set(1); + DebugManager.flags.KMDSupportForCrossTileMigrationPolicy.set(1); DebugManager.flags.UsmInitialPlacement.set(1); RootDeviceIndicesContainer rootDeviceIndices = {mockRootDeviceIndex}; std::map deviceBitfields{{mockRootDeviceIndex, mockDeviceBitfield}}; diff --git a/shared/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp index deafcc458b..0bcfbb213d 100644 --- a/shared/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp @@ -4733,9 +4733,9 @@ TEST_F(DrmMemoryManagerTest, givenKmdMigratedSharedAllocationWithMultipleBOsWhen EXPECT_EQ(1u, drmAllocation.subDeviceIdsReceived[1]); } -TEST_F(DrmMemoryManagerTest, givenContextWithAccessCountersAndKmdMigratedSharedAllocationWithMultipleBOsWhenSetMemPrefetchIsCalledWithASubDeviceThenPrefetchBOsToThisSubDevice) { +TEST_F(DrmMemoryManagerTest, givenKMDSupportForCrossTileMigrationPolicyAndKmdMigratedSharedAllocationWithMultipleBOsWhenSetMemPrefetchIsCalledWithASubDeviceThenPrefetchBOsToThisSubDevice) { DebugManagerStateRestore restore; - DebugManager.flags.CreateContextWithAccessCounters.set(1); + DebugManager.flags.KMDSupportForCrossTileMigrationPolicy.set(1); TestedDrmMemoryManager memoryManager(false, false, false, *executionEnvironment); SubDeviceIdsVec subDeviceIds{0}; @@ -4766,9 +4766,9 @@ TEST_F(DrmMemoryManagerTest, givenContextWithAccessCountersAndKmdMigratedSharedA EXPECT_EQ(0u, drmAllocation.subDeviceIdsReceived[1]); } -TEST_F(DrmMemoryManagerTest, givenContextWithAccessCountersAndKmdMigratedSharedAllocationWithMultipleBOsWhenSetMemPrefetchIsCalledWithSubDevicesThenPrefetchBOsToTheseSubDevices) { +TEST_F(DrmMemoryManagerTest, givenKMDSupportForCrossTileMigrationPolicyAndKmdMigratedSharedAllocationWithMultipleBOsWhenSetMemPrefetchIsCalledWithSubDevicesThenPrefetchBOsToTheseSubDevices) { DebugManagerStateRestore restore; - DebugManager.flags.CreateContextWithAccessCounters.set(1); + DebugManager.flags.KMDSupportForCrossTileMigrationPolicy.set(1); TestedDrmMemoryManager memoryManager(false, false, false, *executionEnvironment); SubDeviceIdsVec subDeviceIds{0, 1};