Disable gem close worker in CSR constructor

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2021-06-28 13:10:21 +00:00
committed by Compute-Runtime-Automation
parent 8156d5c16e
commit 73b0df3211
8 changed files with 33 additions and 71 deletions

View File

@@ -210,7 +210,6 @@ class MemoryManager {
virtual void registerSysMemAlloc(GraphicsAllocation *allocation){};
virtual void registerLocalMemAlloc(GraphicsAllocation *allocation, uint32_t rootDeviceIndex){};
virtual void disableGemCloseWorkerForNewResidencyModel(){};
bool isLocalMemoryUsedForIsa(uint32_t rootDeviceIndex);
protected:

View File

@@ -155,8 +155,6 @@ std::vector<std::unique_ptr<Device>> DeviceFactory::createDevices(ExecutionEnvir
}
}
executionEnvironment.memoryManager->disableGemCloseWorkerForNewResidencyModel();
return devices;
}

View File

@@ -53,6 +53,8 @@ DrmMemoryManager::DrmMemoryManager(gemCloseWorkerMode mode,
}
void DrmMemoryManager::initialize(gemCloseWorkerMode mode) {
bool disableGemCloseWorker = true;
for (uint32_t rootDeviceIndex = 0; rootDeviceIndex < gfxPartitions.size(); ++rootDeviceIndex) {
auto gpuAddressSpace = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo()->capabilityTable.gpuAddressSpace;
if (!getGfxPartition(rootDeviceIndex)->init(gpuAddressSpace, getSizeToReserve(), rootDeviceIndex, gfxPartitions.size(), heapAssigner.apiAllowExternalHeapForSshAndDsh)) {
@@ -60,10 +62,11 @@ void DrmMemoryManager::initialize(gemCloseWorkerMode mode) {
return;
}
localMemAllocs.emplace_back();
disableGemCloseWorker &= getDrm(rootDeviceIndex).isVmBindAvailable();
}
MemoryManager::virtualPaddingAvailable = true;
if (DebugManager.flags.EnableDirectSubmission.get() == 1) {
if (disableGemCloseWorker) {
mode = gemCloseWorkerMode::gemCloseWorkerInactive;
}
@@ -1008,17 +1011,6 @@ void DrmMemoryManager::unregisterAllocation(GraphicsAllocation *allocation) {
localMemAllocs[allocation->getRootDeviceIndex()].end());
}
void DrmMemoryManager::disableGemCloseWorkerForNewResidencyModel() {
for (auto &engine : this->registeredEngines) {
auto rootDeviceIndex = engine.commandStreamReceiver->getRootDeviceIndex();
auto &drm = this->getDrm(rootDeviceIndex);
if (drm.isVmBindAvailable()) {
engine.commandStreamReceiver->initializeDefaultsForInternalEngine();
}
}
}
void DrmMemoryManager::registerAllocationInOs(GraphicsAllocation *allocation) {
if (allocation && getDrm(allocation->getRootDeviceIndex()).resourceRegistrationEnabled()) {
auto drmAllocation = static_cast<DrmAllocation *>(allocation);

View File

@@ -71,8 +71,6 @@ class DrmMemoryManager : public MemoryManager {
void registerLocalMemAlloc(GraphicsAllocation *allocation, uint32_t rootDeviceIndex) override;
void unregisterAllocation(GraphicsAllocation *allocation);
void disableGemCloseWorkerForNewResidencyModel() override;
static std::unique_ptr<MemoryManager> create(ExecutionEnvironment &executionEnvironment);
DrmAllocation *createUSMHostAllocationFromSharedHandle(osHandle handle, const AllocationProperties &properties, bool hasMappedPtr);