mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-30 09:58:55 +08:00
Get rid of UNRECOVERABLE_IF in MemoryManager constructor
Related-To: NEO-5053 Change-Id: Ibf955c760e61e34c4d38cbb5071ef712bae1c518 Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
47f5867e8f
commit
bd9695a19a
@@ -124,11 +124,15 @@ bool DeviceFactory::prepareDeviceEnvironments(ExecutionEnvironment &executionEnv
|
||||
|
||||
std::vector<std::unique_ptr<Device>> DeviceFactory::createDevices(ExecutionEnvironment &executionEnvironment) {
|
||||
std::vector<std::unique_ptr<Device>> devices;
|
||||
auto status = NEO::prepareDeviceEnvironments(executionEnvironment);
|
||||
if (!status) {
|
||||
|
||||
if (!NEO::prepareDeviceEnvironments(executionEnvironment)) {
|
||||
return devices;
|
||||
}
|
||||
executionEnvironment.initializeMemoryManager();
|
||||
|
||||
if (!executionEnvironment.initializeMemoryManager()) {
|
||||
return devices;
|
||||
}
|
||||
|
||||
for (uint32_t rootDeviceIndex = 0u; rootDeviceIndex < executionEnvironment.rootDeviceEnvironments.size(); rootDeviceIndex++) {
|
||||
auto device = createRootDeviceFunc(executionEnvironment, rootDeviceIndex);
|
||||
if (device) {
|
||||
|
||||
@@ -38,9 +38,16 @@ DrmMemoryManager::DrmMemoryManager(gemCloseWorkerMode mode,
|
||||
ExecutionEnvironment &executionEnvironment) : MemoryManager(executionEnvironment),
|
||||
forcePinEnabled(forcePinAllowed),
|
||||
validateHostPtrMemory(validateHostPtrMemory) {
|
||||
initialize(mode);
|
||||
}
|
||||
|
||||
void DrmMemoryManager::initialize(gemCloseWorkerMode mode) {
|
||||
for (uint32_t rootDeviceIndex = 0; rootDeviceIndex < gfxPartitions.size(); ++rootDeviceIndex) {
|
||||
auto gpuAddressSpace = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo()->capabilityTable.gpuAddressSpace;
|
||||
getGfxPartition(rootDeviceIndex)->init(gpuAddressSpace, getSizeToReserve(), rootDeviceIndex, gfxPartitions.size(), heapAssigner.apiAllowExternalHeapForSshAndDsh);
|
||||
if (!getGfxPartition(rootDeviceIndex)->init(gpuAddressSpace, getSizeToReserve(), rootDeviceIndex, gfxPartitions.size(), heapAssigner.apiAllowExternalHeapForSshAndDsh)) {
|
||||
initialized = false;
|
||||
return;
|
||||
}
|
||||
localMemAllocs.emplace_back();
|
||||
}
|
||||
MemoryManager::virtualPaddingAvailable = true;
|
||||
@@ -78,6 +85,8 @@ DrmMemoryManager::DrmMemoryManager(gemCloseWorkerMode mode,
|
||||
|
||||
pinBBs.push_back(bo);
|
||||
}
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
DrmMemoryManager::~DrmMemoryManager() {
|
||||
|
||||
@@ -29,6 +29,7 @@ class DrmMemoryManager : public MemoryManager {
|
||||
ExecutionEnvironment &executionEnvironment);
|
||||
~DrmMemoryManager() override;
|
||||
|
||||
void initialize(gemCloseWorkerMode mode);
|
||||
void addAllocationToHostPtrManager(GraphicsAllocation *gfxAllocation) override;
|
||||
void removeAllocationFromHostPtrManager(GraphicsAllocation *gfxAllocation) override;
|
||||
void freeGraphicsMemoryImpl(GraphicsAllocation *gfxAllocation) override;
|
||||
|
||||
@@ -48,6 +48,8 @@ WddmMemoryManager::WddmMemoryManager(ExecutionEnvironment &executionEnvironment)
|
||||
getWddm(rootDeviceIndex).initGfxPartition(*getGfxPartition(rootDeviceIndex), rootDeviceIndex, gfxPartitions.size(), heapAssigner.apiAllowExternalHeapForSshAndDsh);
|
||||
mallocRestrictions.minAddress = std::max(mallocRestrictions.minAddress, getWddm(rootDeviceIndex).getWddmMinAddress());
|
||||
}
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
GraphicsAllocation *WddmMemoryManager::allocateShareableMemory(const AllocationData &allocationData) {
|
||||
|
||||
Reference in New Issue
Block a user