From 45b0886bc4df0533c796f7fe06e089884cb11f88 Mon Sep 17 00:00:00 2001 From: John Falkowski Date: Wed, 19 Nov 2025 19:28:06 +0000 Subject: [PATCH] fix: Disable shared system USM for TBX mode Related-To: NEO-16531 Signed-off-by: John Falkowski --- shared/source/os_interface/device_factory.cpp | 1 + .../os_interface/device_factory_tests.cpp | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/shared/source/os_interface/device_factory.cpp b/shared/source/os_interface/device_factory.cpp index 54deec7261..d49dd15e8b 100644 --- a/shared/source/os_interface/device_factory.cpp +++ b/shared/source/os_interface/device_factory.cpp @@ -131,6 +131,7 @@ bool DeviceFactory::prepareDeviceEnvironmentsForProductFamilyOverride(ExecutionE if (!productHelper.setupHardwareInfo(*hardwareInfo, *capsReader)) { return false; } + hardwareInfo->capabilityTable.sharedSystemMemCapabilities = 0; } } } diff --git a/shared/test/unit_test/os_interface/device_factory_tests.cpp b/shared/test/unit_test/os_interface/device_factory_tests.cpp index a4671f7918..8ecb9663b8 100644 --- a/shared/test/unit_test/os_interface/device_factory_tests.cpp +++ b/shared/test/unit_test/os_interface/device_factory_tests.cpp @@ -321,6 +321,27 @@ TEST_F(DeviceFactoryOverrideTest, givenFailedProductHelperSetupHardwareInfoWhenP EXPECT_EQ(1u, productHelper->setupHardwareInfoCalled); } +TEST_F(DeviceFactoryOverrideTest, givenTbxModeWhenPreparingDeviceEnvironmentsForProductFamilyOverrideThenSharedSystemMemCapabilitiesCleard) { + DebugManagerStateRestore stateRestore; + debugManager.flags.SetCommandStreamReceiver.set(static_cast(CommandStreamReceiverType::tbx)); + + struct MyMockProductHelper : MockProductHelper { + std::unique_ptr getDeviceCapsReader(aub_stream::AubManager &aubManager) const override { + std::vector caps; + return std::make_unique(caps); + } + }; + + auto productHelper = new MyMockProductHelper(); + productHelper->setupHardwareInfoResult = true; + + executionEnvironment.rootDeviceEnvironments[0]->productHelper.reset(productHelper); + + auto rc = DeviceFactory::prepareDeviceEnvironmentsForProductFamilyOverride(executionEnvironment); + EXPECT_EQ(true, rc); + EXPECT_EQ(0u, executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo()->capabilityTable.sharedSystemMemCapabilities); +} + TEST_F(DeviceFactoryOverrideTest, givenDefaultHwInfoWhenPrepareDeviceEnvironmentsForProductFamilyOverrideIsCalledThenSlmSizeInKbEqualsMaxProgrammableSlmSize) { DebugManagerStateRestore restore; bool success = DeviceFactory::prepareDeviceEnvironmentsForProductFamilyOverride(executionEnvironment);