Skip to content

Commit fbe7a5a

Browse files
fix: Disable shared system USM for all KMDless modes
Related-To: NEO-16531 Signed-off-by: John Falkowski <john.falkowski@intel.com>
1 parent b864c34 commit fbe7a5a

File tree

2 files changed

+42
-2
lines changed

2 files changed

+42
-2
lines changed

shared/source/os_interface/device_factory.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ bool DeviceFactory::prepareDeviceEnvironmentsForProductFamilyOverride(ExecutionE
131131
if (!productHelper.setupHardwareInfo(*hardwareInfo, *capsReader)) {
132132
return false;
133133
}
134-
hardwareInfo->capabilityTable.sharedSystemMemCapabilities = 0;
135134
}
136135
}
137136
}
@@ -161,6 +160,8 @@ bool DeviceFactory::prepareDeviceEnvironmentsForProductFamilyOverride(ExecutionE
161160

162161
[[maybe_unused]] bool result = rootDeviceEnvironment.initAilConfiguration();
163162
DEBUG_BREAK_IF(!result);
163+
164+
hardwareInfo->capabilityTable.sharedSystemMemCapabilities = 0;
164165
}
165166

166167
executionEnvironment.setDeviceHierarchyMode(executionEnvironment.rootDeviceEnvironments[0]->getHelper<GfxCoreHelper>());

shared/test/unit_test/os_interface/device_factory_tests.cpp

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ TEST_F(DeviceFactoryOverrideTest, givenFailedProductHelperSetupHardwareInfoWhenP
321321
EXPECT_EQ(1u, productHelper->setupHardwareInfoCalled);
322322
}
323323

324-
TEST_F(DeviceFactoryOverrideTest, givenTbxModeWhenPreparingDeviceEnvironmentsForProductFamilyOverrideThenSharedSystemMemCapabilitiesCleard) {
324+
TEST_F(DeviceFactoryOverrideTest, givenTbxModeWhenPreparingDeviceEnvironmentsForProductFamilyOverrideThenSharedSystemMemCapabilitiesCleared) {
325325
DebugManagerStateRestore stateRestore;
326326
debugManager.flags.SetCommandStreamReceiver.set(static_cast<int>(CommandStreamReceiverType::tbx));
327327

@@ -342,6 +342,45 @@ TEST_F(DeviceFactoryOverrideTest, givenTbxModeWhenPreparingDeviceEnvironmentsFor
342342
EXPECT_EQ(0u, executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo()->capabilityTable.sharedSystemMemCapabilities);
343343
}
344344

345+
TEST_F(DeviceFactoryOverrideTest, givenTbxWithAubModeWhenPreparingDeviceEnvironmentsForProductFamilyOverrideThenSharedSystemMemCapabilitiesCleared) {
346+
DebugManagerStateRestore stateRestore;
347+
debugManager.flags.SetCommandStreamReceiver.set(static_cast<int>(CommandStreamReceiverType::tbxWithAub));
348+
349+
struct MyMockProductHelper : MockProductHelper {
350+
std::unique_ptr<DeviceCapsReader> getDeviceCapsReader(aub_stream::AubManager &aubManager) const override {
351+
std::vector<uint32_t> caps;
352+
return std::make_unique<DeviceCapsReaderMock>(caps);
353+
}
354+
};
355+
356+
auto productHelper = new MyMockProductHelper();
357+
productHelper->setupHardwareInfoResult = true;
358+
359+
executionEnvironment.rootDeviceEnvironments[0]->productHelper.reset(productHelper);
360+
361+
auto rc = DeviceFactory::prepareDeviceEnvironmentsForProductFamilyOverride(executionEnvironment);
362+
EXPECT_EQ(true, rc);
363+
EXPECT_EQ(0u, executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo()->capabilityTable.sharedSystemMemCapabilities);
364+
}
365+
366+
TEST_F(DeviceFactoryOverrideTest, givenAubModeWhenPreparingDeviceEnvironmentsForProductFamilyOverrideThenSharedSystemMemCapabilitiesCleared) {
367+
DebugManagerStateRestore stateRestore;
368+
debugManager.flags.SetCommandStreamReceiver.set(static_cast<int>(CommandStreamReceiverType::aub));
369+
370+
auto rc = DeviceFactory::prepareDeviceEnvironmentsForProductFamilyOverride(executionEnvironment);
371+
EXPECT_EQ(true, rc);
372+
EXPECT_EQ(0u, executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo()->capabilityTable.sharedSystemMemCapabilities);
373+
}
374+
375+
TEST_F(DeviceFactoryOverrideTest, givenNullAubModeWhenPreparingDeviceEnvironmentsForProductFamilyOverrideThenSharedSystemMemCapabilitiesCleared) {
376+
DebugManagerStateRestore stateRestore;
377+
debugManager.flags.SetCommandStreamReceiver.set(static_cast<int>(CommandStreamReceiverType::nullAub));
378+
379+
auto rc = DeviceFactory::prepareDeviceEnvironmentsForProductFamilyOverride(executionEnvironment);
380+
EXPECT_EQ(true, rc);
381+
EXPECT_EQ(0u, executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo()->capabilityTable.sharedSystemMemCapabilities);
382+
}
383+
345384
TEST_F(DeviceFactoryOverrideTest, givenDefaultHwInfoWhenPrepareDeviceEnvironmentsForProductFamilyOverrideIsCalledThenSlmSizeInKbEqualsMaxProgrammableSlmSize) {
346385
DebugManagerStateRestore restore;
347386
bool success = DeviceFactory::prepareDeviceEnvironmentsForProductFamilyOverride(executionEnvironment);

0 commit comments

Comments
 (0)