From a9795349b47f160a824ff23e04d022f9611ffe55 Mon Sep 17 00:00:00 2001 From: Artur Harasimiuk Date: Fri, 21 Jun 2024 10:31:08 +0000 Subject: [PATCH] Revert "build: improve L0 driver versioning to allow HotFix number" This reverts commit 56847274fab59d3f3027ad89c8fbcd18b4a687a4. Reverting due to bug in unified runtime: https://github.com/oneapi-src/unified-runtime/issues/1777 Signed-off-by: Artur Harasimiuk --- driver_version.h.in | 1 - level_zero/core/source/driver/driver_handle_imp.cpp | 5 ++--- level_zero/core/source/driver/driver_handle_imp.h | 2 ++ .../test/unit_tests/sources/driver/test_driver.cpp | 12 ++++++------ .../l0_gpu_driver/build_l0_gpu_driver_deb.sh | 5 ++--- .../l0_gpu_driver/build_l0_gpu_driver_rpm.sh | 3 +-- scripts/packaging/l0_gpu_driver/l0_gpu_driver.sh | 1 - .../l0_gpu_driver/rhel_8/SPECS/l0_gpu_driver.spec | 2 -- .../l0_gpu_driver/sles_15/SPECS/l0_gpu_driver.spec | 2 -- .../l0_gpu_driver/ubuntu_20.04/debian/rules | 2 -- version.cmake | 5 ----- 11 files changed, 13 insertions(+), 27 deletions(-) diff --git a/driver_version.h.in b/driver_version.h.in index 86d4dab8fa..d52b248232 100644 --- a/driver_version.h.in +++ b/driver_version.h.in @@ -12,6 +12,5 @@ #cmakedefine NEO_REVISION "${NEO_REVISION}" #define NEO_VERSION_BUILD ${NEO_VERSION_BUILD} -#define NEO_VERSION_HOTFIX ${NEO_VERSION_HOTFIX} #endif /* DRIVER_VERSION_H */ diff --git a/level_zero/core/source/driver/driver_handle_imp.cpp b/level_zero/core/source/driver/driver_handle_imp.cpp index e73ba8cac7..d4e75d9716 100644 --- a/level_zero/core/source/driver/driver_handle_imp.cpp +++ b/level_zero/core/source/driver/driver_handle_imp.cpp @@ -114,10 +114,9 @@ ze_result_t DriverHandleImp::getApiVersion(ze_api_version_t *version) { } ze_result_t DriverHandleImp::getProperties(ze_driver_properties_t *properties) { - uint32_t versionBuild = static_cast(NEO_VERSION_BUILD) << 12; - uint32_t versionHotfix = static_cast(NEO_VERSION_HOTFIX); + uint32_t versionBuild = static_cast(NEO_VERSION_BUILD); - properties->driverVersion = versionBuild + versionHotfix; + properties->driverVersion = DriverHandleImp::initialDriverVersionValue + versionBuild; if (NEO::debugManager.flags.OverrideDriverVersion.get() > -1) { properties->driverVersion = static_cast(NEO::debugManager.flags.OverrideDriverVersion.get()); } diff --git a/level_zero/core/source/driver/driver_handle_imp.h b/level_zero/core/source/driver/driver_handle_imp.h index 788dd2a6d1..f5eeab01e3 100644 --- a/level_zero/core/source/driver/driver_handle_imp.h +++ b/level_zero/core/source/driver/driver_handle_imp.h @@ -53,6 +53,8 @@ struct DriverHandleImp : public DriverHandle { ~DriverHandleImp() override; DriverHandleImp(); + static constexpr uint32_t initialDriverVersionValue = 0x01030000; + ze_result_t createContext(const ze_context_desc_t *desc, uint32_t numDevices, ze_device_handle_t *phDevices, diff --git a/level_zero/core/test/unit_tests/sources/driver/test_driver.cpp b/level_zero/core/test/unit_tests/sources/driver/test_driver.cpp index 280d4734d8..ca53092997 100644 --- a/level_zero/core/test/unit_tests/sources/driver/test_driver.cpp +++ b/level_zero/core/test/unit_tests/sources/driver/test_driver.cpp @@ -208,8 +208,8 @@ TEST_F(DriverVersionTest, WhenGettingDriverVersionThenExpectedDriverVersionIsRet ze_result_t res = driverHandle->getProperties(&properties); EXPECT_EQ(ZE_RESULT_SUCCESS, res); - auto expectedDriverVersion = static_cast(NEO_VERSION_BUILD << 12); - expectedDriverVersion += static_cast(NEO_VERSION_HOTFIX); + auto expectedDriverVersion = static_cast(DriverHandleImp::initialDriverVersionValue); + expectedDriverVersion += static_cast(NEO_VERSION_BUILD); EXPECT_EQ(expectedDriverVersion, properties.driverVersion); } @@ -232,12 +232,12 @@ TEST_F(DriverVersionTest, GivenDebugOverrideWhenGettingDriverVersionThenExpected expectedDriverVersion = 10; EXPECT_EQ(expectedDriverVersion, properties.driverVersion); - NEO::debugManager.flags.OverrideDriverVersion.set((29383 << 12) + 71); + NEO::debugManager.flags.OverrideDriverVersion.set(DriverHandleImp::initialDriverVersionValue + 20); res = driverHandle->getProperties(&properties); EXPECT_EQ(ZE_RESULT_SUCCESS, res); - expectedDriverVersion = (0x72c7000 + 0x47); + expectedDriverVersion = DriverHandleImp::initialDriverVersionValue + 20; EXPECT_EQ(expectedDriverVersion, properties.driverVersion); } @@ -254,8 +254,8 @@ TEST_F(DriverVersionTest, givenCallToGetDriverPropertiesThenUuidIsSet) { EXPECT_NE(0u, uniqueId); auto driverVersion = static_cast(uuid & 0xFFFFFFFF); - auto expectedDriverVersion = static_cast(NEO_VERSION_BUILD << 12); - expectedDriverVersion += static_cast(NEO_VERSION_HOTFIX); + auto expectedDriverVersion = static_cast(DriverHandleImp::initialDriverVersionValue); + expectedDriverVersion += static_cast(NEO_VERSION_BUILD); EXPECT_EQ(expectedDriverVersion, driverVersion); } diff --git a/scripts/packaging/l0_gpu_driver/build_l0_gpu_driver_deb.sh b/scripts/packaging/l0_gpu_driver/build_l0_gpu_driver_deb.sh index 363c1015cf..c59db5e2e2 100755 --- a/scripts/packaging/l0_gpu_driver/build_l0_gpu_driver_deb.sh +++ b/scripts/packaging/l0_gpu_driver/build_l0_gpu_driver_deb.sh @@ -32,10 +32,10 @@ source "${REPO_DIR}/scripts/packaging/${BRANCH_SUFFIX}/functions.sh" source "${REPO_DIR}/scripts/packaging/${BRANCH_SUFFIX}/l0_gpu_driver/l0_gpu_driver.sh" get_api_version # API_VERSION-API_VERSION_SRC and API_DEB_MODEL_LINK -get_l0_gpu_driver_version # NEO_L0_VERSION_MAJOR.NEO_L0_VERSION_MINOR.NEO_L0_VERSION_PATCH.NEO_L0_VERSION_HOTFIX +get_l0_gpu_driver_version # NEO_L0_VERSION_MAJOR.NEO_L0_VERSION_MINOR.NEO_L0_VERSION_PATCH if [ -z "${BRANCH_SUFFIX}" ]; then - VERSION="${NEO_L0_VERSION_MAJOR}.${NEO_L0_VERSION_MINOR}.${NEO_L0_VERSION_PATCH}-${NEO_L0_VERSION_HOTFIX}${API_DEB_MODEL_LINK}" + VERSION="${NEO_L0_VERSION_MAJOR}.${NEO_L0_VERSION_MINOR}.${NEO_L0_VERSION_PATCH}${API_DEB_MODEL_LINK}" else VERSION="${NEO_L0_VERSION_MAJOR}.${NEO_L0_VERSION_MINOR}.${NEO_L0_VERSION_PATCH}${API_VERSION}-${NEO_L0_VERSION_HOTFIX}${API_VERSION_SRC}${API_DEB_MODEL_LINK}" fi @@ -85,7 +85,6 @@ fi # Update rules file with new version perl -pi -e "s/^ver = .*/ver = $NEO_L0_VERSION_PATCH/" $BUILD_DIR/debian/rules -perl -pi -e "s/^ver_hf = .*/ver_hf = $NEO_L0_VERSION_HOTFIX/" $BUILD_DIR/debian/rules #needs a top level CMAKE file cat << EOF | tee $BUILD_DIR/CMakeLists.txt diff --git a/scripts/packaging/l0_gpu_driver/build_l0_gpu_driver_rpm.sh b/scripts/packaging/l0_gpu_driver/build_l0_gpu_driver_rpm.sh index 759a57b8e0..bfd6840943 100755 --- a/scripts/packaging/l0_gpu_driver/build_l0_gpu_driver_rpm.sh +++ b/scripts/packaging/l0_gpu_driver/build_l0_gpu_driver_rpm.sh @@ -47,7 +47,7 @@ if [ "${BUILD_SRPM}" == "1" ]; then source "${REPO_DIR}/scripts/packaging/${BRANCH_SUFFIX}/l0_gpu_driver/l0_gpu_driver.sh" get_api_version # API_VERSION-API_VERSION_SRC and API_RPM_MODEL_LINK - get_l0_gpu_driver_version # NEO_L0_VERSION_MAJOR.NEO_L0_VERSION_MINOR.NEO_L0_VERSION_PATCH.NEO_L0_VERSION_HOTFIX + get_l0_gpu_driver_version # NEO_L0_VERSION_MAJOR.NEO_L0_VERSION_MINOR.NEO_L0_VERSION_PATCH VERSION="${NEO_L0_VERSION_MAJOR}.${NEO_L0_VERSION_MINOR}.${NEO_L0_VERSION_PATCH}${API_VERSION}" RELEASE="${NEO_L0_VERSION_HOTFIX}${API_VERSION_SRC}${API_RPM_MODEL_LINK}" @@ -77,7 +77,6 @@ if [ "${BUILD_SRPM}" == "1" ]; then perl -pi -e "s/^%global rel .*/%global rel ${RELEASE}/" $SPEC perl -pi -e "s/^%global NEO_RELEASE_WITH_REGKEYS .*/%global NEO_RELEASE_WITH_REGKEYS ${RELEASE_WITH_REGKEYS}/" $SPEC perl -pi -e "s/^%global build_id .*/%global build_id ${NEO_L0_VERSION_PATCH}/" $SPEC - perl -pi -e "s/^%global hotfix_id .*/%global hotfix_id ${NEO_L0_VERSION_HOTFIX}/" $SPEC rpmbuild --define "_topdir $BUILD_DIR" -bs $SPEC --define 'build_type ${CMAKE_BUILD_TYPE}' "${build_args[@]}" mkdir -p ${REPO_DIR}/../output/SRPMS diff --git a/scripts/packaging/l0_gpu_driver/l0_gpu_driver.sh b/scripts/packaging/l0_gpu_driver/l0_gpu_driver.sh index eecfd56513..7ebc7eafbb 100755 --- a/scripts/packaging/l0_gpu_driver/l0_gpu_driver.sh +++ b/scripts/packaging/l0_gpu_driver/l0_gpu_driver.sh @@ -24,6 +24,5 @@ get_l0_gpu_driver_version() { unset __NEO_L0_VERSION_PATCH_TMP __NEO_L0_VERSION_HOTFIX_TMP=$(echo $NEO_TAG | awk -F '-' '{ if(NF>1) { print $2; } }') NEO_L0_VERSION_HOTFIX="${NEO_L0_VERSION_HOTFIX:-$__NEO_L0_VERSION_HOTFIX_TMP}" - NEO_L0_VERSION_HOTFIX="${NEO_L0_VERSION_HOTFIX:-0}" unset __NEO_L0_VERSION_HOTFIX_TMP } diff --git a/scripts/packaging/l0_gpu_driver/rhel_8/SPECS/l0_gpu_driver.spec b/scripts/packaging/l0_gpu_driver/rhel_8/SPECS/l0_gpu_driver.spec index aef1c8af59..40ad07c5bb 100644 --- a/scripts/packaging/l0_gpu_driver/rhel_8/SPECS/l0_gpu_driver.spec +++ b/scripts/packaging/l0_gpu_driver/rhel_8/SPECS/l0_gpu_driver.spec @@ -2,7 +2,6 @@ %global ver xxx %global rel xxx %global build_id xxx -%global hotfix_id xxx %global NEO_RELEASE_WITH_REGKEYS FALSE %global NEO_ENABLE_XE_EU_DEBUG_SUPPORT FALSE %global NEO_I915_PRELIM_HEADERS_DIR %{nil} @@ -63,7 +62,6 @@ cd build %cmake .. \ -GNinja ${NEO_BUILD_EXTRA_OPTS} \ -DNEO_VERSION_BUILD=%{build_id} \ - -DNEO_VERSION_HOTFIX=%{hotfix_id} \ -DCMAKE_BUILD_TYPE=Release \ -DNEO_BUILD_WITH_OCL=FALSE \ -DNEO_SKIP_UNIT_TESTS=TRUE \ diff --git a/scripts/packaging/l0_gpu_driver/sles_15/SPECS/l0_gpu_driver.spec b/scripts/packaging/l0_gpu_driver/sles_15/SPECS/l0_gpu_driver.spec index 042479a208..d754c09cd2 100644 --- a/scripts/packaging/l0_gpu_driver/sles_15/SPECS/l0_gpu_driver.spec +++ b/scripts/packaging/l0_gpu_driver/sles_15/SPECS/l0_gpu_driver.spec @@ -4,7 +4,6 @@ %global ver xxx %global rel xxx %global build_id xxx -%global hotfix_id xxx %global NEO_RELEASE_WITH_REGKEYS FALSE %global NEO_ENABLE_XE_EU_DEBUG_SUPPORT FALSE %global NEO_I915_PRELIM_HEADERS_DIR %{nil} @@ -73,7 +72,6 @@ Intel(R) Graphics Compute Runtime for oneAPI Level Zero - development headers %cmake .. \ -GNinja ${NEO_BUILD_EXTRA_OPTS} \ -DNEO_VERSION_BUILD=%{build_id} \ - -DNEO_VERSION_HOTFIX=%{hotfix_id} \ -DCMAKE_BUILD_TYPE=%{build_type} \ -DNEO_BUILD_WITH_OCL=FALSE \ -DNEO_SKIP_UNIT_TESTS=TRUE \ diff --git a/scripts/packaging/l0_gpu_driver/ubuntu_20.04/debian/rules b/scripts/packaging/l0_gpu_driver/ubuntu_20.04/debian/rules index 0d342a63c3..4a3c7a9072 100755 --- a/scripts/packaging/l0_gpu_driver/ubuntu_20.04/debian/rules +++ b/scripts/packaging/l0_gpu_driver/ubuntu_20.04/debian/rules @@ -1,6 +1,5 @@ #!/usr/bin/make -f ver = xxx -ver_hf = 0 %: dh $@ --builddir build/ --buildsystem=cmake+ninja @@ -17,7 +16,6 @@ override_dh_auto_configure: dh_auto_configure -- ${NEO_BUILD_EXTRA_OPTS} \ -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \ -DNEO_VERSION_BUILD=$(ver) \ - -DNEO_VERSION_HOTFIX=$(ver_hf) \ -DNEO_SKIP_UNIT_TESTS=${NEO_SKIP_UNIT_TESTS} \ -DNEO_ENABLE_i915_PRELIM_DETECTION=${NEO_ENABLE_i915_PRELIM_DETECTION} \ -DNEO_ENABLE_XE_EU_DEBUG_SUPPORT=${NEO_ENABLE_XE_EU_DEBUG_SUPPORT} \ diff --git a/version.cmake b/version.cmake index 83b0e90fcc..70e2a5d780 100644 --- a/version.cmake +++ b/version.cmake @@ -74,10 +74,6 @@ if(NOT DEFINED NEO_VERSION_BUILD) set(NEO_VERSION_BUILD 0) endif() -if(NOT DEFINED NEO_VERSION_HOTFIX) - set(NEO_VERSION_HOTFIX 0) -endif() - # OpenCL pacakge version set(NEO_OCL_DRIVER_VERSION "${NEO_OCL_VERSION_MAJOR}.${NEO_OCL_VERSION_MINOR}.${NEO_VERSION_BUILD}") @@ -87,4 +83,3 @@ set(NEO_L0_VERSION_MINOR 3) # Remove leading zeros string(REGEX REPLACE "^0+([0-9]+)" "\\1" NEO_VERSION_BUILD "${NEO_VERSION_BUILD}") -string(REGEX REPLACE "^0+([0-9]+)" "\\1" NEO_VERSION_HOTFIX "${NEO_VERSION_HOTFIX}")