Skip to content

Commit

Permalink
Revert "build: improve L0 driver versioning to allow HotFix number"
Browse files Browse the repository at this point in the history
This reverts commit 5684727.

Reverting due to bug in unified runtime:
oneapi-src/unified-runtime#1777

Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
Source: a979534
  • Loading branch information
ArturHarasimiuk authored and Compute-Runtime-Automation committed Jun 25, 2024
1 parent df7d116 commit 6aa7224
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 22 deletions.
1 change: 0 additions & 1 deletion driver_version.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
5 changes: 2 additions & 3 deletions level_zero/core/source/driver/driver_handle_imp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint32_t>(NEO_VERSION_BUILD) << 12;
uint32_t versionHotfix = static_cast<uint32_t>(NEO_VERSION_HOTFIX);
uint32_t versionBuild = static_cast<uint32_t>(NEO_VERSION_BUILD);

properties->driverVersion = versionBuild + versionHotfix;
properties->driverVersion = DriverHandleImp::initialDriverVersionValue + versionBuild;
if (NEO::debugManager.flags.OverrideDriverVersion.get() > -1) {
properties->driverVersion = static_cast<uint32_t>(NEO::debugManager.flags.OverrideDriverVersion.get());
}
Expand Down
2 changes: 2 additions & 0 deletions level_zero/core/source/driver/driver_handle_imp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions level_zero/core/test/unit_tests/sources/driver/test_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ TEST_F(DriverVersionTest, WhenGettingDriverVersionThenExpectedDriverVersionIsRet
ze_result_t res = driverHandle->getProperties(&properties);
EXPECT_EQ(ZE_RESULT_SUCCESS, res);

auto expectedDriverVersion = static_cast<uint32_t>(NEO_VERSION_BUILD << 12);
expectedDriverVersion += static_cast<uint32_t>(NEO_VERSION_HOTFIX);
auto expectedDriverVersion = static_cast<uint32_t>(DriverHandleImp::initialDriverVersionValue);
expectedDriverVersion += static_cast<uint32_t>(NEO_VERSION_BUILD);
EXPECT_EQ(expectedDriverVersion, properties.driverVersion);
}

Expand All @@ -227,12 +227,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);
}

Expand All @@ -249,8 +249,8 @@ TEST_F(DriverVersionTest, givenCallToGetDriverPropertiesThenUuidIsSet) {
EXPECT_NE(0u, uniqueId);

auto driverVersion = static_cast<uint32_t>(uuid & 0xFFFFFFFF);
auto expectedDriverVersion = static_cast<uint32_t>(NEO_VERSION_BUILD << 12);
expectedDriverVersion += static_cast<uint32_t>(NEO_VERSION_HOTFIX);
auto expectedDriverVersion = static_cast<uint32_t>(DriverHandleImp::initialDriverVersionValue);
expectedDriverVersion += static_cast<uint32_t>(NEO_VERSION_BUILD);
EXPECT_EQ(expectedDriverVersion, driverVersion);
}

Expand Down
5 changes: 2 additions & 3 deletions scripts/packaging/l0_gpu_driver/build_l0_gpu_driver_deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions scripts/packaging/l0_gpu_driver/build_l0_gpu_driver_rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion scripts/packaging/l0_gpu_driver/l0_gpu_driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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 \
Expand Down
2 changes: 0 additions & 2 deletions scripts/packaging/l0_gpu_driver/ubuntu_20.04/debian/rules
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/make -f
ver = xxx
ver_hf = 0

%:
dh $@ --builddir build/ --buildsystem=cmake+ninja
Expand All @@ -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} \
Expand Down

0 comments on commit 6aa7224

Please sign in to comment.