@@ -36,18 +36,23 @@ uint32_t MemoryManager::maxOsContextCount = 0u;
3636MemoryManager::MemoryManager (ExecutionEnvironment &executionEnvironment) : executionEnvironment(executionEnvironment), hostPtrManager(std::make_unique<HostPtrManager>()),
3737 multiContextResourceDestructor (std::make_unique<DeferredDeleter>()) {
3838 auto hwInfo = executionEnvironment.getHardwareInfo ();
39- this ->localMemorySupported = HwHelper::get (hwInfo->platform .eRenderCoreFamily ).getEnableLocalMemory (*hwInfo);
40- this ->enable64kbpages = OSInterface::osEnabled64kbPages && hwInfo->capabilityTable .ftr64KBpages ;
41- if (DebugManager.flags .Enable64kbpages .get () > -1 ) {
42- this ->enable64kbpages = DebugManager.flags .Enable64kbpages .get () != 0 ;
43- }
4439 localMemoryUsageBankSelector.reset (new LocalMemoryUsageBankSelector (getBanksCount ()));
4540
41+ bool anyLocalMemorySupported = false ;
42+
4643 for (uint32_t rootDeviceIndex = 0 ; rootDeviceIndex < executionEnvironment.rootDeviceEnvironments .size (); ++rootDeviceIndex) {
44+ this ->localMemorySupported .push_back (HwHelper::get (hwInfo->platform .eRenderCoreFamily ).getEnableLocalMemory (*hwInfo));
45+ this ->enable64kbpages .push_back (OSInterface::osEnabled64kbPages && hwInfo->capabilityTable .ftr64KBpages );
46+ if (DebugManager.flags .Enable64kbpages .get () > -1 ) {
47+ this ->enable64kbpages [rootDeviceIndex] = DebugManager.flags .Enable64kbpages .get () != 0 ;
48+ }
49+
4750 gfxPartitions.push_back (std::make_unique<GfxPartition>());
51+
52+ anyLocalMemorySupported |= this ->localMemorySupported [rootDeviceIndex];
4853 }
4954
50- if (this -> localMemorySupported ) {
55+ if (anyLocalMemorySupported ) {
5156 pageFaultManager = PageFaultManager::create ();
5257 }
5358}
@@ -181,8 +186,12 @@ bool MemoryManager::isAsyncDeleterEnabled() const {
181186 return asyncDeleterEnabled;
182187}
183188
184- bool MemoryManager::isLocalMemorySupported () const {
185- return localMemorySupported;
189+ bool MemoryManager::isLocalMemorySupported (uint32_t rootDeviceIndex) const {
190+ return localMemorySupported[rootDeviceIndex];
191+ }
192+
193+ bool MemoryManager::peek64kbPagesEnabled (uint32_t rootDeviceIndex) const {
194+ return enable64kbpages[rootDeviceIndex];
186195}
187196
188197bool MemoryManager::isMemoryBudgetExhausted () const {
@@ -361,7 +370,7 @@ GraphicsAllocation *MemoryManager::allocateGraphicsMemory(const AllocationData &
361370 if (allocationData.hostPtr ) {
362371 return allocateGraphicsMemoryWithHostPtr (allocationData);
363372 }
364- if (peek64kbPagesEnabled () && allocationData.flags .allow64kbPages ) {
373+ if (peek64kbPagesEnabled (allocationData. rootDeviceIndex ) && allocationData.flags .allow64kbPages ) {
365374 return allocateGraphicsMemory64kb (allocationData);
366375 }
367376 return allocateGraphicsMemoryWithAlignment (allocationData);
0 commit comments