From f3a8944027cce44daa18df04e11597f84a5a168c Mon Sep 17 00:00:00 2001 From: Jaime Arteaga Date: Thu, 9 Feb 2023 22:30:22 +0000 Subject: [PATCH] Revert "Enable LUID Extension by Default" This reverts commit 8b4fe7093d0eee4b56e8661505609f220fd90d32. Signed-off-by: Jaime Arteaga --- .../sources/device/device_drm/test_device.cpp | 3 ++- .../sources/device/device_drm_or_wddm/test_device.cpp | 10 ++++++++++ .../sources/device/device_wddm/test_device.cpp | 3 +++ shared/source/debug_settings/debug_variables_base.inl | 2 +- shared/test/common/test_files/igdrcl.config | 2 +- 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/level_zero/core/test/unit_tests/sources/device/device_drm/test_device.cpp b/level_zero/core/test/unit_tests/sources/device/device_drm/test_device.cpp index c8c73ca7e0..9073938082 100644 --- a/level_zero/core/test/unit_tests/sources/device/device_drm/test_device.cpp +++ b/level_zero/core/test/unit_tests/sources/device/device_drm/test_device.cpp @@ -24,6 +24,7 @@ namespace ult { using LuidDeviceTest = Test; TEST_F(LuidDeviceTest, givenLuidDevicePropertiesStructureAndDRMDriverTypeThenUnsupportedReturned) { + DebugManager.flags.EnableL0ReadLUIDExtension.set(true); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(new NEO::OSInterface()); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::make_unique()); ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES}; @@ -31,10 +32,10 @@ TEST_F(LuidDeviceTest, givenLuidDevicePropertiesStructureAndDRMDriverTypeThenUns deviceProperties.pNext = &deviceLuidProperties; ze_result_t result = device->getProperties(&deviceProperties); EXPECT_EQ(result, ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + DebugManager.flags.EnableL0ReadLUIDExtension.set(false); } TEST_F(LuidDeviceTest, givenLuidDevicePropertiesStructureAndDebugVariableFalseThenSuccessReturned) { - DebugManagerStateRestore restorer; DebugManager.flags.EnableL0ReadLUIDExtension.set(false); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(new NEO::OSInterface()); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::make_unique()); diff --git a/level_zero/core/test/unit_tests/sources/device/device_drm_or_wddm/test_device.cpp b/level_zero/core/test/unit_tests/sources/device/device_drm_or_wddm/test_device.cpp index 452443cc6c..47776c13c5 100644 --- a/level_zero/core/test/unit_tests/sources/device/device_drm_or_wddm/test_device.cpp +++ b/level_zero/core/test/unit_tests/sources/device/device_drm_or_wddm/test_device.cpp @@ -77,14 +77,17 @@ class MockOsContextWin : public OsContextWin { using LuidDeviceTest = Test; TEST_F(LuidDeviceTest, givenOsContextWinAndGetDeviceNodeMaskThenNodeMaskIsAtLeast1) { + DebugManager.flags.EnableL0ReadLUIDExtension.set(true); auto luidMock = new MockDriverModelWDDMLUID(*neoDevice->executionEnvironment->rootDeviceEnvironments[0]); auto defaultEngine = defaultHwInfo->capabilityTable.defaultEngineType; OsContextWin osContext(*luidMock, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor({defaultEngine, EngineUsage::Regular})); EXPECT_GE(osContext.getDeviceNodeMask(), 1u); delete luidMock; + DebugManager.flags.EnableL0ReadLUIDExtension.set(false); } TEST_F(LuidDeviceTest, givenOsContextWinAndGetLUIDArrayThenLUIDisValid) { + DebugManager.flags.EnableL0ReadLUIDExtension.set(true); auto luidMock = new MockDriverModelWDDMLUID(*neoDevice->executionEnvironment->rootDeviceEnvironments[0]); auto defaultEngine = defaultHwInfo->capabilityTable.defaultEngineType; OsContextWin osContext(*luidMock, 0, 0u, EngineDescriptorHelper::getDefaultDescriptor({defaultEngine, EngineUsage::Regular})); @@ -95,9 +98,11 @@ TEST_F(LuidDeviceTest, givenOsContextWinAndGetLUIDArrayThenLUIDisValid) { memcpy_s(&luid, sizeof(uint64_t), luidData.data(), sizeof(uint8_t) * luidData.size()); EXPECT_NE(luid, (uint64_t)0); delete luidMock; + DebugManager.flags.EnableL0ReadLUIDExtension.set(false); } TEST_F(LuidDeviceTest, givenLuidDevicePropertiesStructureAndWDDMDriverTypeThenSuccessReturned) { + DebugManager.flags.EnableL0ReadLUIDExtension.set(true); auto defaultEngine = defaultHwInfo->capabilityTable.defaultEngineType; auto luidMock = new MockDriverModelWDDMLUID(*neoDevice->executionEnvironment->rootDeviceEnvironments[0]); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(new NEO::OSInterface()); @@ -120,9 +125,11 @@ TEST_F(LuidDeviceTest, givenLuidDevicePropertiesStructureAndWDDMDriverTypeThenSu EXPECT_EQ(lowLUID, (uint32_t)adapterLuid.LowPart); EXPECT_EQ(highLUID, (uint32_t)adapterLuid.HighPart); EXPECT_NE(deviceLuidProperties.nodeMask, (uint32_t)0); + DebugManager.flags.EnableL0ReadLUIDExtension.set(false); } TEST_F(LuidDeviceTest, givenLuidDevicePropertiesStructureAndDRMDriverTypeThenUnsupportedReturned) { + DebugManager.flags.EnableL0ReadLUIDExtension.set(true); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(new NEO::OSInterface()); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::make_unique()); ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES}; @@ -130,15 +137,18 @@ TEST_F(LuidDeviceTest, givenLuidDevicePropertiesStructureAndDRMDriverTypeThenUns deviceProperties.pNext = &deviceLuidProperties; ze_result_t result = device->getProperties(&deviceProperties); EXPECT_EQ(result, ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + DebugManager.flags.EnableL0ReadLUIDExtension.set(false); } TEST_F(LuidDeviceTest, givenLuidDevicePropertiesStructureAndAndNoOsInterfaceThenUninitReturned) { + DebugManager.flags.EnableL0ReadLUIDExtension.set(true); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(nullptr); ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES}; ze_device_luid_ext_properties_t deviceLuidProperties = {ZE_STRUCTURE_TYPE_DEVICE_LUID_EXT_PROPERTIES}; deviceProperties.pNext = &deviceLuidProperties; ze_result_t result = device->getProperties(&deviceProperties); EXPECT_EQ(result, ZE_RESULT_ERROR_UNINITIALIZED); + DebugManager.flags.EnableL0ReadLUIDExtension.set(false); } } // namespace ult diff --git a/level_zero/core/test/unit_tests/sources/device/device_wddm/test_device.cpp b/level_zero/core/test/unit_tests/sources/device/device_wddm/test_device.cpp index 9f0a174849..f8e2ee682d 100644 --- a/level_zero/core/test/unit_tests/sources/device/device_wddm/test_device.cpp +++ b/level_zero/core/test/unit_tests/sources/device/device_wddm/test_device.cpp @@ -9,6 +9,7 @@ #include "shared/source/os_interface/windows/hw_device_id.h" #include "shared/source/os_interface/windows/os_environment_win.h" #include "shared/source/os_interface/windows/wddm/wddm.h" +#include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/mock_gdi/mock_gdi.h" #include "shared/test/common/mocks/mock_device.h" #include "shared/test/common/mocks/mock_wddm.h" @@ -36,6 +37,7 @@ struct LuidDeviceTest : public ::testing::Test { }; TEST_F(LuidDeviceTest, givenLuidDevicePropertiesStructureThenLuidAndNodeMaskSetForWDDMDriverType) { + DebugManager.flags.EnableL0ReadLUIDExtension.set(true); NEO::MockDevice *neoDevice = nullptr; std::unique_ptr> driverHandle; L0::Device *device = nullptr; @@ -79,6 +81,7 @@ TEST_F(LuidDeviceTest, givenLuidDevicePropertiesStructureThenLuidAndNodeMaskSetF EXPECT_EQ(lowLUID, (uint32_t)adapterLuid.LowPart); EXPECT_EQ(highLUID, (uint32_t)adapterLuid.HighPart); EXPECT_NE(deviceLuidProperties.nodeMask, (uint32_t)0); + DebugManager.flags.EnableL0ReadLUIDExtension.set(false); } } // namespace ult diff --git a/shared/source/debug_settings/debug_variables_base.inl b/shared/source/debug_settings/debug_variables_base.inl index 74d7c4e6c1..c6e7af879f 100644 --- a/shared/source/debug_settings/debug_variables_base.inl +++ b/shared/source/debug_settings/debug_variables_base.inl @@ -344,7 +344,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, DirectSubmissionRelaxedOrderingMinNumberOfClient DECLARE_DEBUG_VARIABLE(bool, DirectSubmissionPrintBuffers, false, "Print address of submitted command buffers") /*FEATURE FLAGS*/ -DECLARE_DEBUG_VARIABLE(bool, EnableL0ReadLUIDExtension, true, "Enables Support for L0 Extension for reading the LUID from WDDM.") +DECLARE_DEBUG_VARIABLE(bool, EnableL0ReadLUIDExtension, false, "Enables Support for L0 Extension for reading the LUID from WDDM.") DECLARE_DEBUG_VARIABLE(bool, EnableL0EuCount, false, "Enables Support for L0 Extension for querying total nubmer of EUs.") DECLARE_DEBUG_VARIABLE(bool, USMEvictAfterMigration, false, "Evict USM allocation after implicit migration to GPU") DECLARE_DEBUG_VARIABLE(bool, EnableNV12, true, "Enables NV12 extension") diff --git a/shared/test/common/test_files/igdrcl.config b/shared/test/common/test_files/igdrcl.config index 51d8385c46..dbee767b47 100644 --- a/shared/test/common/test_files/igdrcl.config +++ b/shared/test/common/test_files/igdrcl.config @@ -108,7 +108,7 @@ DirectSubmissionDisableCacheFlush = -1 DirectSubmissionDisableMonitorFence = -1 DirectSubmissionPrintBuffers = 0 DirectSubmissionMaxRingBuffers = -1 -EnableL0ReadLUIDExtension = -1 +EnableL0ReadLUIDExtension = 0 EnableL0EuCount = 0 USMEvictAfterMigration = 0 EnableDirectSubmissionController = -1