mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-10 15:12:56 +08:00
Return error when there is no memory to evict
We want to return error code to the application instead of aborting when we are not able to make more memory resident. Related-To: NEO-7289 Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
501873d0e0
commit
645600d141
@@ -306,6 +306,22 @@ TEST_F(WddmCommandStreamTest, givenWdmmWhenSubmitIsCalledThenCoherencyRequiredFl
|
||||
memoryManager->freeGraphicsMemory(commandBuffer);
|
||||
}
|
||||
|
||||
TEST_F(WddmCommandStreamTest, givenFailureFromMakeResidentWhenFlushingThenOutOfMemoryIsReturned) {
|
||||
GraphicsAllocation *commandBuffer = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{csr->getRootDeviceIndex(), MemoryConstants::pageSize});
|
||||
ASSERT_NE(nullptr, commandBuffer);
|
||||
LinearStream cs(commandBuffer);
|
||||
|
||||
wddm->makeResidentNumberOfBytesToTrim = 4 * 4096;
|
||||
wddm->makeResidentStatus = false;
|
||||
|
||||
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, QueueSliceCount::defaultSliceCount, cs.getUsed(), &cs, nullptr, false};
|
||||
SubmissionStatus retVal = csr->flush(batchBuffer, csr->getResidencyAllocations());
|
||||
|
||||
EXPECT_EQ(SubmissionStatus::OUT_OF_MEMORY, retVal);
|
||||
|
||||
memoryManager->freeGraphicsMemory(commandBuffer);
|
||||
}
|
||||
|
||||
struct WddmPreemptionHeaderFixture {
|
||||
void setUp() {
|
||||
executionEnvironment = getExecutionEnvironmentImpl(hwInfo, 1);
|
||||
|
||||
Reference in New Issue
Block a user