diff --git a/shared/source/debug_settings/debug_variables_base.inl b/shared/source/debug_settings/debug_variables_base.inl index 86165cc60c..c9d27ea747 100644 --- a/shared/source/debug_settings/debug_variables_base.inl +++ b/shared/source/debug_settings/debug_variables_base.inl @@ -141,6 +141,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, GpuScratchRegWriteRegisterData, 0, "register dat DECLARE_DEBUG_VARIABLE(int32_t, OverrideSlmAllocationSize, -1, "-1: default, >=0: program value for shared local memory size") DECLARE_DEBUG_VARIABLE(int32_t, DebuggerLogBitmask, 0, "0: logs disabled, 1 - INFO, 2 - ERROR, 1<<10 - Dump elf, see DebugVariables::DEBUGGER_LOG_BITMASK") DECLARE_DEBUG_VARIABLE(int32_t, DebuggerForceSbaTrackingMode, -1, "-1: default, 0: per context address spaces, 1: single address space") +DECLARE_DEBUG_VARIABLE(bool, DisableSupportForL0Debugger, 0, "0: default setting for product, 1: disable l0 debugger") DECLARE_DEBUG_VARIABLE(int32_t, DebugApiUsed, 0, "0: default L0 Debug API not used, 1: L0 Debug API used") DECLARE_DEBUG_VARIABLE(int32_t, OverrideCsrAllocationSize, -1, "-1: default, >0: use value for size of CSR allocation") DECLARE_DEBUG_VARIABLE(int32_t, CFEComputeOverdispatchDisable, -1, "Set Compute Overdispatch Disable field in CFE_STATE, -1: do not set.") diff --git a/shared/source/execution_environment/root_device_environment.cpp b/shared/source/execution_environment/root_device_environment.cpp index 70aa7bd35c..3389ced2f6 100644 --- a/shared/source/execution_environment/root_device_environment.cpp +++ b/shared/source/execution_environment/root_device_environment.cpp @@ -75,12 +75,15 @@ HardwareInfo *RootDeviceEnvironment::getMutableHardwareInfo() const { } void RootDeviceEnvironment::setHwInfoAndInitHelpers(const HardwareInfo *hwInfo) { - *this->hwInfo = *hwInfo; + setHwInfo(hwInfo); initHelpers(); } void RootDeviceEnvironment::setHwInfo(const HardwareInfo *hwInfo) { *this->hwInfo = *hwInfo; + if (debugManager.flags.DisableSupportForL0Debugger.get() == 1) { + this->hwInfo->capabilityTable.l0DebuggerSupported = false; + } } bool RootDeviceEnvironment::isFullRangeSvm() const { diff --git a/shared/test/common/test_files/igdrcl.config b/shared/test/common/test_files/igdrcl.config index df3ba61616..c231567d9e 100644 --- a/shared/test/common/test_files/igdrcl.config +++ b/shared/test/common/test_files/igdrcl.config @@ -605,4 +605,5 @@ EnableLogLevel = 6 EnableReusingGpuTimestamps = -1 ForceCopyOperationOffloadForComputeCmdList = -1 SecondaryContextEngineTypeMask = -1 +DisableSupportForL0Debugger=0 # Please don't edit below this line diff --git a/shared/test/unit_test/device/neo_device_tests.cpp b/shared/test/unit_test/device/neo_device_tests.cpp index b1a680696c..fa69df2fee 100644 --- a/shared/test/unit_test/device/neo_device_tests.cpp +++ b/shared/test/unit_test/device/neo_device_tests.cpp @@ -95,6 +95,22 @@ TEST(Device, givenNoDebuggerWhenGettingDebuggerThenNullptrIsReturned) { EXPECT_EQ(nullptr, device->getL0Debugger()); } +struct DeviceWithDisabledL0DebuggerTests : public DeviceFixture, public ::testing::Test { + void SetUp() override { + debugManager.flags.DisableSupportForL0Debugger.set(true); + DeviceFixture::setUp(); + } + + void TearDown() override { + DeviceFixture::tearDown(); + } + DebugManagerStateRestore dbgRestorer; +}; + +TEST_F(DeviceWithDisabledL0DebuggerTests, givenSetFlagDisableSupportForL0DebuggerWhenCreateDeviceThenCapabilityLDebuggerSupportedIsDisabled) { + EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.l0DebuggerSupported); +} + TEST(Device, givenDeviceWithBrandingStringNameWhenGettingDeviceNameThenBrandingStringIsReturned) { auto hwInfo = *defaultHwInfo;