mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
feature(sysman): reinitialize gfxPartition on reset
Related-To: NEO-13203 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
084ea8b687
commit
0589a70dc7
@@ -249,6 +249,7 @@ std::unique_ptr<Device> DeviceFactory::createDevice(ExecutionEnvironment &execut
|
||||
return device;
|
||||
}
|
||||
|
||||
executionEnvironment.memoryManager->reInitDeviceSpecificGfxPartition(rootDeviceIndex);
|
||||
executionEnvironment.memoryManager->createDeviceSpecificMemResources(rootDeviceIndex);
|
||||
executionEnvironment.memoryManager->reInitLatestContextId();
|
||||
device = createRootDeviceFunc(executionEnvironment, rootDeviceIndex);
|
||||
|
||||
@@ -2948,4 +2948,23 @@ void DrmMemoryManager::getExtraDeviceProperties(uint32_t rootDeviceIndex, uint32
|
||||
getDrm(rootDeviceIndex).getIoctlHelper()->queryDeviceParams(moduleId, serverType);
|
||||
}
|
||||
|
||||
bool DrmMemoryManager::reInitDeviceSpecificGfxPartition(uint32_t rootDeviceIndex) {
|
||||
if (gfxPartitions.at(rootDeviceIndex) == nullptr) {
|
||||
auto gpuAddressSpace = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo()->capabilityTable.gpuAddressSpace;
|
||||
|
||||
gfxPartitions.at(rootDeviceIndex) = std::make_unique<GfxPartition>(reservedCpuAddressRange);
|
||||
|
||||
uint64_t gfxTop{};
|
||||
getDrm(rootDeviceIndex).queryGttSize(gfxTop, false);
|
||||
|
||||
if (getGfxPartition(rootDeviceIndex)->init(gpuAddressSpace, getSizeToReserve(), rootDeviceIndex, gfxPartitions.size(), heapAssigners[rootDeviceIndex]->apiAllowExternalHeapForSshAndDsh, DrmMemoryManager::getSystemSharedMemory(rootDeviceIndex), gfxTop)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void DrmMemoryManager::releaseDeviceSpecificGfxPartition(uint32_t rootDeviceIndex) {
|
||||
gfxPartitions.at(rootDeviceIndex).reset();
|
||||
}
|
||||
} // namespace NEO
|
||||
|
||||
@@ -100,6 +100,8 @@ class DrmMemoryManager : public MemoryManager {
|
||||
DrmAllocation *createUSMHostAllocationFromSharedHandle(osHandle handle, const AllocationProperties &properties, void *mappedPtr, bool reuseSharedAllocation);
|
||||
void releaseDeviceSpecificMemResources(uint32_t rootDeviceIndex) override;
|
||||
void createDeviceSpecificMemResources(uint32_t rootDeviceIndex) override;
|
||||
void releaseDeviceSpecificGfxPartition(uint32_t rootDeviceIndex) override;
|
||||
bool reInitDeviceSpecificGfxPartition(uint32_t rootDeviceIndex) override;
|
||||
bool allowIndirectAllocationsAsPack(uint32_t rootDeviceIndex) override;
|
||||
Drm &getDrm(uint32_t rootDeviceIndex) const;
|
||||
size_t getSizeOfChunk(size_t allocSize);
|
||||
|
||||
Reference in New Issue
Block a user