fix: submit dummy exec to pin memory during zeContextMakeMemoryResident call

Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>

Related-To: NEO-11879
This commit is contained in:
Maciej Plewka
2024-08-30 13:20:57 +02:00
committed by Compute-Runtime-Automation
parent 32fb476f6d
commit f9b87d53e6
35 changed files with 244 additions and 106 deletions

View File

@@ -533,6 +533,10 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily>, publ
drainPagingFenceQueueCalled++;
BaseClass::drainPagingFenceQueue();
}
SubmissionStatus flushHandler(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) override {
flushHandlerCalled++;
return BaseClass::flushHandler(batchBuffer, allocationsForResidency);
}
std::vector<std::string> aubCommentMessages;
@@ -562,6 +566,7 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily>, publ
uint32_t pollForCompletionCalled = 0;
uint32_t initializeDeviceWithFirstSubmissionCalled = 0;
uint32_t drainPagingFenceQueueCalled = 0;
uint32_t flushHandlerCalled = 0;
mutable uint32_t checkGpuHangDetectedCalled = 0;
int ensureCommandBufferAllocationCalled = 0;
DispatchFlags recordedDispatchFlags;

View File

@@ -199,10 +199,12 @@ struct MockDrmGemCloseWorker : DrmGemCloseWorker {
};
struct MockDrmMemoryManager : DrmMemoryManager {
using BaseClass = DrmMemoryManager;
using DrmMemoryManager::DrmMemoryManager;
using DrmMemoryManager::gemCloseWorker;
using DrmMemoryManager::mmapFunction;
using DrmMemoryManager::munmapFunction;
ADDMETHOD_CONST(emitPinningRequestForBoContainer, SubmissionStatus, true, SubmissionStatus::success, (BufferObject * *bo, uint32_t boCount, uint32_t rootDeviceIndex), (bo, boCount, rootDeviceIndex));
};
} // namespace NEO

View File

@@ -21,9 +21,9 @@ struct MockAubMemoryOperationsHandler : public AubMemoryOperationsHandler {
using AubMemoryOperationsHandler::getMemoryBanksBitfield;
using AubMemoryOperationsHandler::residentAllocations;
MemoryOperationsStatus makeResident(Device *device, ArrayRef<GraphicsAllocation *> gfxAllocations) override {
MemoryOperationsStatus makeResident(Device *device, ArrayRef<GraphicsAllocation *> gfxAllocations, bool isDummyExecNeeded) override {
makeResidentCalled = true;
return AubMemoryOperationsHandler::makeResident(device, gfxAllocations);
return AubMemoryOperationsHandler::makeResident(device, gfxAllocations, isDummyExecNeeded);
}
MemoryOperationsStatus evict(Device *device, GraphicsAllocation &gfxAllocation) override {

View File

@@ -19,6 +19,7 @@
#include "shared/source/memory_manager/surface.h"
#include "shared/source/utilities/tag_allocator.h"
#include "shared/test/common/helpers/dispatch_flags_helper.h"
#include "shared/test/common/test_macros/mock_method_macros.h"
#include <optional>
#include <vector>
@@ -31,6 +32,7 @@ using namespace NEO;
class MockCommandStreamReceiver : public CommandStreamReceiver {
public:
using BaseClass = CommandStreamReceiver;
using CommandStreamReceiver::activePartitions;
using CommandStreamReceiver::baseWaitFunction;
using CommandStreamReceiver::checkForNewResources;

View File

@@ -20,7 +20,7 @@ class GraphicsAllocation;
class MockMemoryOperationsHandler : public MemoryOperationsHandler {
public:
MockMemoryOperationsHandler() {}
MemoryOperationsStatus makeResident(Device *device, ArrayRef<GraphicsAllocation *> gfxAllocations) override { return MemoryOperationsStatus::unsupported; }
MemoryOperationsStatus makeResident(Device *device, ArrayRef<GraphicsAllocation *> gfxAllocations, bool isDummyExecNeeded) override { return MemoryOperationsStatus::unsupported; }
MemoryOperationsStatus lock(Device *device, ArrayRef<GraphicsAllocation *> gfxAllocations) override { return MemoryOperationsStatus::unsupported; }
MemoryOperationsStatus evict(Device *device, GraphicsAllocation &gfxAllocation) override { return MemoryOperationsStatus::unsupported; }
MemoryOperationsStatus isResident(Device *device, GraphicsAllocation &gfxAllocation) override { return MemoryOperationsStatus::unsupported; }
@@ -31,7 +31,7 @@ class MockMemoryOperationsHandler : public MemoryOperationsHandler {
class MockMemoryOperationsHandlerTests : public MemoryOperationsHandler {
public:
MockMemoryOperationsHandlerTests() {}
ADDMETHOD_NOBASE(makeResident, MemoryOperationsStatus, MemoryOperationsStatus::unsupported, (Device * device, ArrayRef<GraphicsAllocation *> gfxAllocations));
ADDMETHOD_NOBASE(makeResident, MemoryOperationsStatus, MemoryOperationsStatus::unsupported, (Device * device, ArrayRef<GraphicsAllocation *> gfxAllocations, bool isDummyExecNeeded));
ADDMETHOD_NOBASE(lock, MemoryOperationsStatus, MemoryOperationsStatus::unsupported, (Device * device, ArrayRef<GraphicsAllocation *> gfxAllocations));
ADDMETHOD_NOBASE(evict, MemoryOperationsStatus, MemoryOperationsStatus::unsupported, (Device * device, GraphicsAllocation &gfxAllocation));
ADDMETHOD_NOBASE(isResident, MemoryOperationsStatus, MemoryOperationsStatus::unsupported, (Device * device, GraphicsAllocation &gfxAllocation));
@@ -43,7 +43,7 @@ class MockMemoryOperations : public MemoryOperationsHandler {
public:
MockMemoryOperations() {}
MemoryOperationsStatus makeResident(Device *device, ArrayRef<GraphicsAllocation *> gfxAllocations) override {
MemoryOperationsStatus makeResident(Device *device, ArrayRef<GraphicsAllocation *> gfxAllocations, bool isDummyExecNeeded) override {
makeResidentCalledCount++;
if (captureGfxAllocationsForMakeResident) {
for (auto &gfxAllocation : gfxAllocations) {