Unbind unused resources when running out of memory

Resolves: NEO-5052

Change-Id: I3a07221b800317c79e65396443933d13d334a274
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2020-09-10 12:36:44 +02:00
committed by sys_ocldev
parent d363448515
commit a528908cbd
23 changed files with 160 additions and 38 deletions

View File

@ -404,9 +404,11 @@ GraphicsAllocation *MemoryManager::allocateGraphicsMemoryInPreferredPool(const A
GraphicsAllocation *allocation = allocateGraphicsMemoryInDevicePool(allocationData, status);
if (allocation) {
localMemoryUsageBankSelector[properties.rootDeviceIndex]->reserveOnBanks(allocationData.storageInfo.getMemoryBanks(), allocation->getUnderlyingBufferSize());
this->registerLocalMemAlloc(allocation, properties.rootDeviceIndex);
}
if (!allocation && status == AllocationStatus::RetryInNonDevicePool) {
allocation = allocateGraphicsMemory(allocationData);
this->registerSysMemAlloc(allocation);
}
FileLoggerInstance().logAllocation(allocation);
return allocation;