From 0b6b0e3954e629fa5906582ca73f03917b3c59c9 Mon Sep 17 00:00:00 2001 From: shubham kumar Date: Tue, 23 Sep 2025 14:38:16 +0000 Subject: [PATCH] Revert "feature: Use zesInit on windows always" This reverts commit 9dadadfa73660966edd67cbc4492f148c467ec88. Signed-off-by: shubham kumar --- level_zero/core/source/device/device_imp.cpp | 6 ------ level_zero/core/source/driver/driver_handle_imp.cpp | 3 --- level_zero/core/source/global_teardown.cpp | 7 +++++-- level_zero/sysman/source/driver/sysman_driver.cpp | 7 ------- level_zero/sysman/source/driver/sysman_driver.h | 1 - .../sysman/test/unit_tests/sources/linux/test_sysman.cpp | 8 -------- .../sources/linux/test_sysman_core_handle_support.cpp | 6 +++--- .../test/unit_tests/sources/windows/test_sysman.cpp | 8 -------- .../sources/windows/test_sysman_core_handle_support.cpp | 6 +++--- level_zero/tools/source/sysman/windows/os_sysman_imp.cpp | 3 +-- .../sources/sysman/windows/mock_sysman_fixture.cpp | 1 - .../sources/sysman/windows/mock_sysman_fixture.h | 1 - .../unit_tests/sources/sysman/windows/test_sysman.cpp | 7 ------- shared/source/debug_settings/debug_variables_base.inl | 1 - shared/test/common/test_files/igdrcl.config | 1 - 15 files changed, 12 insertions(+), 54 deletions(-) diff --git a/level_zero/core/source/device/device_imp.cpp b/level_zero/core/source/device/device_imp.cpp index 695a339071..c965e9afbb 100644 --- a/level_zero/core/source/device/device_imp.cpp +++ b/level_zero/core/source/device/device_imp.cpp @@ -61,7 +61,6 @@ #include "level_zero/core/source/sampler/sampler.h" #include "level_zero/driver_experimental/zex_graph.h" #include "level_zero/driver_experimental/zex_module.h" -#include "level_zero/sysman/source/driver/sysman_driver.h" #include "level_zero/tools/source/debug/debug_session.h" #include "level_zero/tools/source/metrics/metric.h" #include "level_zero/tools/source/sysman/sysman.h" @@ -1692,11 +1691,6 @@ Device *Device::create(DriverHandle *driverHandle, NEO::Device *neoDevice, bool bool isHwMode = device->getNEODevice()->getAllEngines().size() ? device->getNEODevice()->getAllEngines()[0].commandStreamReceiver->getType() == NEO::CommandStreamReceiverType::hardware : device->getNEODevice()->getRootDevice()->getAllEngines()[0].commandStreamReceiver->getType() == NEO::CommandStreamReceiverType::hardware; if (isHwMode) { device->createSysmanHandle(isSubDevice); - auto osInterface = neoDevice->getRootDeviceEnvironment().osInterface.get(); - if (osInterface && osInterface->getDriverModel()->getDriverModelType() == NEO::DriverModelType::wddm && NEO::debugManager.flags.EnableSysmanLegacyModeUsingZesInit.get()) { - // if driver type is wddm (windows) always use zesInit path for sysman - L0::Sysman::init(ZE_INIT_FLAG_GPU_ONLY); - } } device->resourcesReleased = false; diff --git a/level_zero/core/source/driver/driver_handle_imp.cpp b/level_zero/core/source/driver/driver_handle_imp.cpp index 6fa249bcc8..587bf453d1 100644 --- a/level_zero/core/source/driver/driver_handle_imp.cpp +++ b/level_zero/core/source/driver/driver_handle_imp.cpp @@ -43,7 +43,6 @@ #include "level_zero/core/source/image/image.h" #include "level_zero/core/source/semaphore/external_semaphore_imp.h" #include "level_zero/driver_experimental/zex_common.h" -#include "level_zero/sysman/source/driver/sysman_driver.h" #include "driver_version.h" @@ -283,8 +282,6 @@ DriverHandleImp::~DriverHandleImp() { delete this->svmAllocsManager; this->svmAllocsManager = nullptr; } - - L0::Sysman::globalSysmanDriverCleanup(); } void DriverHandleImp::updateRootDeviceBitFields(std::unique_ptr &neoDevice) { diff --git a/level_zero/core/source/global_teardown.cpp b/level_zero/core/source/global_teardown.cpp index a22898fb26..759bd6cd5d 100644 --- a/level_zero/core/source/global_teardown.cpp +++ b/level_zero/core/source/global_teardown.cpp @@ -12,7 +12,7 @@ #include "level_zero/core/source/driver/driver.h" #include "level_zero/core/source/driver/driver_handle_imp.h" #include "level_zero/ddi/ze_ddi_tables.h" -#include "level_zero/sysman/source/driver/sysman_driver.h" +#include "level_zero/sysman/source/driver/sysman_driver_handle_imp.h" namespace L0 { @@ -60,9 +60,12 @@ void globalDriverTeardown() { delete globalDriverHandles; globalDriverHandles = nullptr; } + if (Sysman::globalSysmanDriver != nullptr) { + delete Sysman::globalSysmanDriver; + Sysman::globalSysmanDriver = nullptr; + } globalDriverDispatch.core.isValidFlag = false; globalDriverDispatch.tools.isValidFlag = false; globalDriverDispatch.sysman.isValidFlag = false; - L0::Sysman::globalSysmanDriverCleanup(); } } // namespace L0 diff --git a/level_zero/sysman/source/driver/sysman_driver.cpp b/level_zero/sysman/source/driver/sysman_driver.cpp index 8e783502d3..11a9b9baf2 100644 --- a/level_zero/sysman/source/driver/sysman_driver.cpp +++ b/level_zero/sysman/source/driver/sysman_driver.cpp @@ -122,12 +122,5 @@ ze_result_t init(zes_init_flags_t flags) { } } -void globalSysmanDriverCleanup() { - if (Sysman::globalSysmanDriver != nullptr) { - delete Sysman::globalSysmanDriver; - Sysman::globalSysmanDriver = nullptr; - } -} - } // namespace Sysman } // namespace L0 diff --git a/level_zero/sysman/source/driver/sysman_driver.h b/level_zero/sysman/source/driver/sysman_driver.h index 85244b7951..be965e7a0a 100644 --- a/level_zero/sysman/source/driver/sysman_driver.h +++ b/level_zero/sysman/source/driver/sysman_driver.h @@ -24,7 +24,6 @@ struct SysmanDriver { ze_result_t init(zes_init_flags_t); ze_result_t driverHandleGet(uint32_t *pCount, ze_driver_handle_t *phDrivers); -void globalSysmanDriverCleanup(); extern uint32_t driverCount; extern _ze_driver_handle_t *globalSysmanDriverHandle; diff --git a/level_zero/sysman/test/unit_tests/sources/linux/test_sysman.cpp b/level_zero/sysman/test/unit_tests/sources/linux/test_sysman.cpp index 44387eb7f6..eaacc56356 100644 --- a/level_zero/sysman/test/unit_tests/sources/linux/test_sysman.cpp +++ b/level_zero/sysman/test/unit_tests/sources/linux/test_sysman.cpp @@ -631,14 +631,6 @@ TEST_F(SysmanDeviceFixture, GivenValidDeviceWhenRetrievingUuidThenValidFdIsVerif std::swap(rootDeviceEnvironment.productHelper, mockProductHelper); } -TEST(SysmanInitTest, GivenGlobalSysmanDriverPointerIsSetDuringSysmanInitThenWhenCallingGlobalSysmanDriverCleanupPointerIsNull) { - auto sysmanDriverHandle = new L0::Sysman::SysmanDriverHandleImp(); - L0::Sysman::globalSysmanDriver = sysmanDriverHandle; - EXPECT_NE(L0::Sysman::globalSysmanDriver, nullptr); - L0::Sysman::globalSysmanDriverCleanup(); - EXPECT_EQ(L0::Sysman::globalSysmanDriver, nullptr); -} - } // namespace ult } // namespace Sysman } // namespace L0 diff --git a/level_zero/sysman/test/unit_tests/sources/linux/test_sysman_core_handle_support.cpp b/level_zero/sysman/test/unit_tests/sources/linux/test_sysman_core_handle_support.cpp index 1f2cd29b65..c854c128d3 100644 --- a/level_zero/sysman/test/unit_tests/sources/linux/test_sysman_core_handle_support.cpp +++ b/level_zero/sysman/test/unit_tests/sources/linux/test_sysman_core_handle_support.cpp @@ -16,15 +16,15 @@ namespace L0 { namespace Sysman { namespace ult { -class SysmanDeviceFixtureWithCore : public L0::ult::DeviceFixture, public SysmanDeviceFixture { +class SysmanDeviceFixtureWithCore : public SysmanDeviceFixture, public L0::ult::DeviceFixture { protected: void SetUp() override { - L0::ult::DeviceFixture::setUp(); SysmanDeviceFixture::SetUp(); + L0::ult::DeviceFixture::setUp(); } void TearDown() override { - SysmanDeviceFixture::TearDown(); L0::ult::DeviceFixture::tearDown(); + SysmanDeviceFixture::TearDown(); } }; diff --git a/level_zero/sysman/test/unit_tests/sources/windows/test_sysman.cpp b/level_zero/sysman/test/unit_tests/sources/windows/test_sysman.cpp index 235c87321c..b7222e646e 100644 --- a/level_zero/sysman/test/unit_tests/sources/windows/test_sysman.cpp +++ b/level_zero/sysman/test/unit_tests/sources/windows/test_sysman.cpp @@ -161,14 +161,6 @@ TEST_F(SysmanDeviceFixture, GivenValidWddmSysmanImpWhenRetrievingUuidThenTrueIsR EXPECT_TRUE(result); } -TEST(SysmanInitTest, GivenGlobalSysmanDriverPointerIsSetDuringSysmanInitThenWhenCallingGlobalSysmanDriverCleanupPointerIsNull) { - auto sysmanDriverHandle = new L0::Sysman::SysmanDriverHandleImp(); - L0::Sysman::globalSysmanDriver = sysmanDriverHandle; - EXPECT_NE(L0::Sysman::globalSysmanDriver, nullptr); - L0::Sysman::globalSysmanDriverCleanup(); - EXPECT_EQ(L0::Sysman::globalSysmanDriver, nullptr); -} - } // namespace ult } // namespace Sysman } // namespace L0 diff --git a/level_zero/sysman/test/unit_tests/sources/windows/test_sysman_core_handle_support.cpp b/level_zero/sysman/test/unit_tests/sources/windows/test_sysman_core_handle_support.cpp index 0812ae1c56..1569d9d723 100644 --- a/level_zero/sysman/test/unit_tests/sources/windows/test_sysman_core_handle_support.cpp +++ b/level_zero/sysman/test/unit_tests/sources/windows/test_sysman_core_handle_support.cpp @@ -16,15 +16,15 @@ namespace L0 { namespace Sysman { namespace ult { -class SysmanDeviceFixtureWithCore : public L0::ult::DeviceFixture, public SysmanDeviceFixture { +class SysmanDeviceFixtureWithCore : public SysmanDeviceFixture, public L0::ult::DeviceFixture { protected: void SetUp() override { - L0::ult::DeviceFixture::setUp(); SysmanDeviceFixture::SetUp(); + L0::ult::DeviceFixture::setUp(); } void TearDown() override { - SysmanDeviceFixture::TearDown(); L0::ult::DeviceFixture::tearDown(); + SysmanDeviceFixture::TearDown(); } }; diff --git a/level_zero/tools/source/sysman/windows/os_sysman_imp.cpp b/level_zero/tools/source/sysman/windows/os_sysman_imp.cpp index 78ec2da1f0..dd10f5a164 100644 --- a/level_zero/tools/source/sysman/windows/os_sysman_imp.cpp +++ b/level_zero/tools/source/sysman/windows/os_sysman_imp.cpp @@ -55,8 +55,7 @@ Device *WddmSysmanImp::getDeviceHandle() { } ze_bool_t WddmSysmanImp::isDriverModelSupported() { - auto usingZesInit = NEO::debugManager.flags.EnableSysmanLegacyModeUsingZesInit.get(); - return !usingZesInit; + return true; } std::vector &WddmSysmanImp::getDeviceHandles() { diff --git a/level_zero/tools/test/unit_tests/sources/sysman/windows/mock_sysman_fixture.cpp b/level_zero/tools/test/unit_tests/sources/sysman/windows/mock_sysman_fixture.cpp index 8a175feaa1..a600f730f3 100644 --- a/level_zero/tools/test/unit_tests/sources/sysman/windows/mock_sysman_fixture.cpp +++ b/level_zero/tools/test/unit_tests/sources/sysman/windows/mock_sysman_fixture.cpp @@ -17,7 +17,6 @@ namespace L0 { namespace ult { void SysmanDeviceFixture::SetUp() { - debugManager.flags.EnableSysmanLegacyModeUsingZesInit.set(false); if (!sysmanUltsEnable) { GTEST_SKIP(); } diff --git a/level_zero/tools/test/unit_tests/sources/sysman/windows/mock_sysman_fixture.h b/level_zero/tools/test/unit_tests/sources/sysman/windows/mock_sysman_fixture.h index f9689e86b4..78fe00a46e 100644 --- a/level_zero/tools/test/unit_tests/sources/sysman/windows/mock_sysman_fixture.h +++ b/level_zero/tools/test/unit_tests/sources/sysman/windows/mock_sysman_fixture.h @@ -37,7 +37,6 @@ class SysmanDeviceFixture : public DeviceFixture, public SysmanEnabledFixture { SysmanDeviceImp *pSysmanDeviceImp = nullptr; OsSysman *pOsSysman = nullptr; PublicWddmSysmanImp *pWddmSysmanImp = nullptr; - DebugManagerStateRestore restorer; }; } // namespace ult diff --git a/level_zero/tools/test/unit_tests/sources/sysman/windows/test_sysman.cpp b/level_zero/tools/test/unit_tests/sources/sysman/windows/test_sysman.cpp index 5df60e009d..5c7c221ffc 100644 --- a/level_zero/tools/test/unit_tests/sources/sysman/windows/test_sysman.cpp +++ b/level_zero/tools/test/unit_tests/sources/sysman/windows/test_sysman.cpp @@ -95,12 +95,5 @@ TEST_F(SysmanDeviceFixture, GivenValidSysmanDeviceImpWhenOsSysmanInitFailsThenUn delete testOsSysman; } -TEST_F(SysmanDeviceFixture, GivenValidWddmSysmanImpWhenExternBooleanUseZesInitOnWddmIsTrueThenFalseIsReturned) { - EXPECT_EQ(true, pWddmSysmanImp->isDriverModelSupported()); - debugManager.flags.EnableSysmanLegacyModeUsingZesInit.set(true); - EXPECT_EQ(false, pWddmSysmanImp->isDriverModelSupported()); - debugManager.flags.EnableSysmanLegacyModeUsingZesInit.set(false); -} - } // namespace ult } // namespace L0 diff --git a/shared/source/debug_settings/debug_variables_base.inl b/shared/source/debug_settings/debug_variables_base.inl index 1dd37c3f71..36be112dd3 100644 --- a/shared/source/debug_settings/debug_variables_base.inl +++ b/shared/source/debug_settings/debug_variables_base.inl @@ -480,7 +480,6 @@ DECLARE_DEBUG_VARIABLE(int32_t, WaitForPagingFenceInController, -1, "Instead of DECLARE_DEBUG_VARIABLE(int32_t, DirectSubmissionControllerIdleDetection, -1, "Terminate direct submission only if CSR is idle. -1: default, 0 - disable, 1 - enable.") DECLARE_DEBUG_VARIABLE(int32_t, DirectSubmissionControllerContextGroupIdleDetection, -1, "Terminate direct submission only if all CSRs in group are idle. -1: default, 0 - disable, 1 - enable.") /*FEATURE FLAGS*/ -DECLARE_DEBUG_VARIABLE(bool, EnableSysmanLegacyModeUsingZesInit, true, "Use zesInit based sysman initialization during zeInit") DECLARE_DEBUG_VARIABLE(bool, RegisterPageFaultHandlerOnMigration, false, "Register handler on migration to GPU when current is not from pagefault manager") DECLARE_DEBUG_VARIABLE(bool, EnableNV12, true, "Enables NV12 extension") DECLARE_DEBUG_VARIABLE(bool, EnablePackedYuv, true, "Enables cl_packed_yuv extension") diff --git a/shared/test/common/test_files/igdrcl.config b/shared/test/common/test_files/igdrcl.config index 47fd94c94a..678d1fb409 100644 --- a/shared/test/common/test_files/igdrcl.config +++ b/shared/test/common/test_files/igdrcl.config @@ -670,6 +670,5 @@ Disable2MBSizeAlignment = 0 InOrderCopyMiFlushSync = -1 SplitBcsForCopyOffload = -1 LimitIsaPrefetchSize = -1 -EnableSysmanLegacyModeUsingZesInit = 1 ForceTotalWMTPDataSize = -1 # Please don't edit below this line