mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 14:02:58 +08:00
fix: Disable 1-tile chunking dev mem
Disable chunking for device memory allocation if only 1Tile Related-To: NEO-8098 Signed-off-by: John Falkowski <john.falkowski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
8eb3fe222e
commit
2166f7cbcc
@@ -1881,9 +1881,11 @@ bool DrmMemoryManager::createDrmAllocation(Drm *drm, DrmAllocation *allocation,
|
||||
uint32_t numOfChunks = DebugManager.flags.NumberOfBOChunks.get();
|
||||
size_t chunkingSize = boTotalChunkSize / numOfChunks;
|
||||
|
||||
// Dont chunk for sizes less than chunkThreshold
|
||||
// Do not chunk for sizes less than chunkThreshold
|
||||
// Do not chunk for single tile device memory
|
||||
if (boTotalChunkSize >= drm->getMinimalSizeForChunking() &&
|
||||
!(chunkingSize & (MemoryConstants::chunkThreshold - 1))) {
|
||||
!(chunkingSize & (MemoryConstants::chunkThreshold - 1)) &&
|
||||
(allocation->storageInfo.subDeviceBitfield.count() > 1)) {
|
||||
|
||||
handles = 1;
|
||||
allocation->resizeBufferObjects(handles);
|
||||
|
||||
@@ -5319,6 +5319,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest,
|
||||
allocData.type = AllocationType::BUFFER;
|
||||
allocData.rootDeviceIndex = rootDeviceIndex;
|
||||
allocData.storageInfo.memoryBanks = 0b11;
|
||||
allocData.storageInfo.subDeviceBitfield = 0b11;
|
||||
|
||||
auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status);
|
||||
EXPECT_NE(nullptr, allocation);
|
||||
@@ -5351,6 +5352,29 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest,
|
||||
memoryManager->freeGraphicsMemory(allocation);
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest,
|
||||
givenDeviceMemoryAllocationWithChunkingModeSetToDeviceAndOnlyOneTileThenChunkingIsNotUsed) {
|
||||
VariableBackup<bool> backupChunkingCallParent{&mock->getChunkingAvailableCall.callParent, false};
|
||||
VariableBackup<bool> backupChunkingReturnValue{&mock->getChunkingAvailableCall.returnValue, true};
|
||||
VariableBackup<bool> backupChunkingModeCallParent{&mock->getChunkingModeCall.callParent, false};
|
||||
VariableBackup<uint32_t> backupChunkingModeReturnValue{&mock->getChunkingModeCall.returnValue, 0x2};
|
||||
|
||||
MemoryManager::AllocationStatus status = MemoryManager::AllocationStatus::Success;
|
||||
AllocationData allocData;
|
||||
allocData.allFlags = 0;
|
||||
allocData.size = MemoryConstants::pageSize2M;
|
||||
allocData.type = AllocationType::BUFFER;
|
||||
allocData.rootDeviceIndex = rootDeviceIndex;
|
||||
allocData.storageInfo.memoryBanks = 0b11;
|
||||
allocData.storageInfo.subDeviceBitfield = 0b01;
|
||||
|
||||
auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status);
|
||||
EXPECT_NE(nullptr, allocation);
|
||||
EXPECT_FALSE(allocation->storageInfo.isChunked);
|
||||
|
||||
memoryManager->freeGraphicsMemory(allocation);
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest,
|
||||
givenDeviceMemoryAllocationWithChunkingModeSetToDeviceThenChunkingIsUsed) {
|
||||
VariableBackup<bool> backupChunkingCallParent{&mock->getChunkingAvailableCall.callParent, false};
|
||||
@@ -5365,6 +5389,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest,
|
||||
allocData.type = AllocationType::BUFFER;
|
||||
allocData.rootDeviceIndex = rootDeviceIndex;
|
||||
allocData.storageInfo.memoryBanks = 0b11;
|
||||
allocData.storageInfo.subDeviceBitfield = 0b11;
|
||||
|
||||
auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status);
|
||||
EXPECT_NE(nullptr, allocation);
|
||||
@@ -5460,6 +5485,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest,
|
||||
allocData.type = AllocationType::BUFFER;
|
||||
allocData.rootDeviceIndex = rootDeviceIndex;
|
||||
allocData.storageInfo.memoryBanks = 0b11;
|
||||
allocData.storageInfo.subDeviceBitfield = 0b11;
|
||||
static_cast<MockedMemoryInfo *>(mock->getMemoryInfo())->failOnCreateGemExtWithMultipleRegions = true;
|
||||
|
||||
auto allocation = memoryManager->allocateGraphicsMemoryInDevicePool(allocData, status);
|
||||
|
||||
Reference in New Issue
Block a user