Skip to content

Commit 6aa7224

Browse files
Revert "build: improve L0 driver versioning to allow HotFix number"
This reverts commit 5684727. Reverting due to bug in unified runtime: oneapi-src/unified-runtime#1777 Signed-off-by: Artur Harasimiuk <[email protected]> Source: a979534
1 parent df7d116 commit 6aa7224

File tree

10 files changed

+13
-22
lines changed

10 files changed

+13
-22
lines changed

driver_version.h.in

-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@
1212
#cmakedefine NEO_REVISION "${NEO_REVISION}"
1313

1414
#define NEO_VERSION_BUILD ${NEO_VERSION_BUILD}
15-
#define NEO_VERSION_HOTFIX ${NEO_VERSION_HOTFIX}
1615

1716
#endif /* DRIVER_VERSION_H */

level_zero/core/source/driver/driver_handle_imp.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,9 @@ ze_result_t DriverHandleImp::getApiVersion(ze_api_version_t *version) {
114114
}
115115

116116
ze_result_t DriverHandleImp::getProperties(ze_driver_properties_t *properties) {
117-
uint32_t versionBuild = static_cast<uint32_t>(NEO_VERSION_BUILD) << 12;
118-
uint32_t versionHotfix = static_cast<uint32_t>(NEO_VERSION_HOTFIX);
117+
uint32_t versionBuild = static_cast<uint32_t>(NEO_VERSION_BUILD);
119118

120-
properties->driverVersion = versionBuild + versionHotfix;
119+
properties->driverVersion = DriverHandleImp::initialDriverVersionValue + versionBuild;
121120
if (NEO::debugManager.flags.OverrideDriverVersion.get() > -1) {
122121
properties->driverVersion = static_cast<uint32_t>(NEO::debugManager.flags.OverrideDriverVersion.get());
123122
}

level_zero/core/source/driver/driver_handle_imp.h

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ struct DriverHandleImp : public DriverHandle {
5353
~DriverHandleImp() override;
5454
DriverHandleImp();
5555

56+
static constexpr uint32_t initialDriverVersionValue = 0x01030000;
57+
5658
ze_result_t createContext(const ze_context_desc_t *desc,
5759
uint32_t numDevices,
5860
ze_device_handle_t *phDevices,

level_zero/core/test/unit_tests/sources/driver/test_driver.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ TEST_F(DriverVersionTest, WhenGettingDriverVersionThenExpectedDriverVersionIsRet
203203
ze_result_t res = driverHandle->getProperties(&properties);
204204
EXPECT_EQ(ZE_RESULT_SUCCESS, res);
205205

206-
auto expectedDriverVersion = static_cast<uint32_t>(NEO_VERSION_BUILD << 12);
207-
expectedDriverVersion += static_cast<uint32_t>(NEO_VERSION_HOTFIX);
206+
auto expectedDriverVersion = static_cast<uint32_t>(DriverHandleImp::initialDriverVersionValue);
207+
expectedDriverVersion += static_cast<uint32_t>(NEO_VERSION_BUILD);
208208
EXPECT_EQ(expectedDriverVersion, properties.driverVersion);
209209
}
210210

@@ -227,12 +227,12 @@ TEST_F(DriverVersionTest, GivenDebugOverrideWhenGettingDriverVersionThenExpected
227227
expectedDriverVersion = 10;
228228
EXPECT_EQ(expectedDriverVersion, properties.driverVersion);
229229

230-
NEO::debugManager.flags.OverrideDriverVersion.set((29383 << 12) + 71);
230+
NEO::debugManager.flags.OverrideDriverVersion.set(DriverHandleImp::initialDriverVersionValue + 20);
231231

232232
res = driverHandle->getProperties(&properties);
233233
EXPECT_EQ(ZE_RESULT_SUCCESS, res);
234234

235-
expectedDriverVersion = (0x72c7000 + 0x47);
235+
expectedDriverVersion = DriverHandleImp::initialDriverVersionValue + 20;
236236
EXPECT_EQ(expectedDriverVersion, properties.driverVersion);
237237
}
238238

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

251251
auto driverVersion = static_cast<uint32_t>(uuid & 0xFFFFFFFF);
252-
auto expectedDriverVersion = static_cast<uint32_t>(NEO_VERSION_BUILD << 12);
253-
expectedDriverVersion += static_cast<uint32_t>(NEO_VERSION_HOTFIX);
252+
auto expectedDriverVersion = static_cast<uint32_t>(DriverHandleImp::initialDriverVersionValue);
253+
expectedDriverVersion += static_cast<uint32_t>(NEO_VERSION_BUILD);
254254
EXPECT_EQ(expectedDriverVersion, driverVersion);
255255
}
256256

scripts/packaging/l0_gpu_driver/build_l0_gpu_driver_deb.sh

+2-3
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ source "${REPO_DIR}/scripts/packaging/${BRANCH_SUFFIX}/functions.sh"
3232
source "${REPO_DIR}/scripts/packaging/${BRANCH_SUFFIX}/l0_gpu_driver/l0_gpu_driver.sh"
3333

3434
get_api_version # API_VERSION-API_VERSION_SRC and API_DEB_MODEL_LINK
35-
get_l0_gpu_driver_version # NEO_L0_VERSION_MAJOR.NEO_L0_VERSION_MINOR.NEO_L0_VERSION_PATCH.NEO_L0_VERSION_HOTFIX
35+
get_l0_gpu_driver_version # NEO_L0_VERSION_MAJOR.NEO_L0_VERSION_MINOR.NEO_L0_VERSION_PATCH
3636

3737
if [ -z "${BRANCH_SUFFIX}" ]; then
38-
VERSION="${NEO_L0_VERSION_MAJOR}.${NEO_L0_VERSION_MINOR}.${NEO_L0_VERSION_PATCH}-${NEO_L0_VERSION_HOTFIX}${API_DEB_MODEL_LINK}"
38+
VERSION="${NEO_L0_VERSION_MAJOR}.${NEO_L0_VERSION_MINOR}.${NEO_L0_VERSION_PATCH}${API_DEB_MODEL_LINK}"
3939
else
4040
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}"
4141
fi
@@ -85,7 +85,6 @@ fi
8585

8686
# Update rules file with new version
8787
perl -pi -e "s/^ver = .*/ver = $NEO_L0_VERSION_PATCH/" $BUILD_DIR/debian/rules
88-
perl -pi -e "s/^ver_hf = .*/ver_hf = $NEO_L0_VERSION_HOTFIX/" $BUILD_DIR/debian/rules
8988

9089
#needs a top level CMAKE file
9190
cat << EOF | tee $BUILD_DIR/CMakeLists.txt

scripts/packaging/l0_gpu_driver/build_l0_gpu_driver_rpm.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ if [ "${BUILD_SRPM}" == "1" ]; then
4747
source "${REPO_DIR}/scripts/packaging/${BRANCH_SUFFIX}/l0_gpu_driver/l0_gpu_driver.sh"
4848

4949
get_api_version # API_VERSION-API_VERSION_SRC and API_RPM_MODEL_LINK
50-
get_l0_gpu_driver_version # NEO_L0_VERSION_MAJOR.NEO_L0_VERSION_MINOR.NEO_L0_VERSION_PATCH.NEO_L0_VERSION_HOTFIX
50+
get_l0_gpu_driver_version # NEO_L0_VERSION_MAJOR.NEO_L0_VERSION_MINOR.NEO_L0_VERSION_PATCH
5151

5252
VERSION="${NEO_L0_VERSION_MAJOR}.${NEO_L0_VERSION_MINOR}.${NEO_L0_VERSION_PATCH}${API_VERSION}"
5353
RELEASE="${NEO_L0_VERSION_HOTFIX}${API_VERSION_SRC}${API_RPM_MODEL_LINK}"
@@ -77,7 +77,6 @@ if [ "${BUILD_SRPM}" == "1" ]; then
7777
perl -pi -e "s/^%global rel .*/%global rel ${RELEASE}/" $SPEC
7878
perl -pi -e "s/^%global NEO_RELEASE_WITH_REGKEYS .*/%global NEO_RELEASE_WITH_REGKEYS ${RELEASE_WITH_REGKEYS}/" $SPEC
7979
perl -pi -e "s/^%global build_id .*/%global build_id ${NEO_L0_VERSION_PATCH}/" $SPEC
80-
perl -pi -e "s/^%global hotfix_id .*/%global hotfix_id ${NEO_L0_VERSION_HOTFIX}/" $SPEC
8180

8281
rpmbuild --define "_topdir $BUILD_DIR" -bs $SPEC --define 'build_type ${CMAKE_BUILD_TYPE}' "${build_args[@]}"
8382
mkdir -p ${REPO_DIR}/../output/SRPMS

scripts/packaging/l0_gpu_driver/l0_gpu_driver.sh

-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,5 @@ get_l0_gpu_driver_version() {
2424
unset __NEO_L0_VERSION_PATCH_TMP
2525
__NEO_L0_VERSION_HOTFIX_TMP=$(echo $NEO_TAG | awk -F '-' '{ if(NF>1) { print $2; } }')
2626
NEO_L0_VERSION_HOTFIX="${NEO_L0_VERSION_HOTFIX:-$__NEO_L0_VERSION_HOTFIX_TMP}"
27-
NEO_L0_VERSION_HOTFIX="${NEO_L0_VERSION_HOTFIX:-0}"
2827
unset __NEO_L0_VERSION_HOTFIX_TMP
2928
}

scripts/packaging/l0_gpu_driver/rhel_8/SPECS/l0_gpu_driver.spec

-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
%global ver xxx
33
%global rel xxx
44
%global build_id xxx
5-
%global hotfix_id xxx
65
%global NEO_RELEASE_WITH_REGKEYS FALSE
76
%global NEO_ENABLE_XE_EU_DEBUG_SUPPORT FALSE
87
%global NEO_I915_PRELIM_HEADERS_DIR %{nil}
@@ -63,7 +62,6 @@ cd build
6362
%cmake .. \
6463
-GNinja ${NEO_BUILD_EXTRA_OPTS} \
6564
-DNEO_VERSION_BUILD=%{build_id} \
66-
-DNEO_VERSION_HOTFIX=%{hotfix_id} \
6765
-DCMAKE_BUILD_TYPE=Release \
6866
-DNEO_BUILD_WITH_OCL=FALSE \
6967
-DNEO_SKIP_UNIT_TESTS=TRUE \

scripts/packaging/l0_gpu_driver/sles_15/SPECS/l0_gpu_driver.spec

-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
%global ver xxx
55
%global rel xxx
66
%global build_id xxx
7-
%global hotfix_id xxx
87
%global NEO_RELEASE_WITH_REGKEYS FALSE
98
%global NEO_ENABLE_XE_EU_DEBUG_SUPPORT FALSE
109
%global NEO_I915_PRELIM_HEADERS_DIR %{nil}
@@ -73,7 +72,6 @@ Intel(R) Graphics Compute Runtime for oneAPI Level Zero - development headers
7372
%cmake .. \
7473
-GNinja ${NEO_BUILD_EXTRA_OPTS} \
7574
-DNEO_VERSION_BUILD=%{build_id} \
76-
-DNEO_VERSION_HOTFIX=%{hotfix_id} \
7775
-DCMAKE_BUILD_TYPE=%{build_type} \
7876
-DNEO_BUILD_WITH_OCL=FALSE \
7977
-DNEO_SKIP_UNIT_TESTS=TRUE \

scripts/packaging/l0_gpu_driver/ubuntu_20.04/debian/rules

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/make -f
22
ver = xxx
3-
ver_hf = 0
43

54
%:
65
dh $@ --builddir build/ --buildsystem=cmake+ninja
@@ -17,7 +16,6 @@ override_dh_auto_configure:
1716
dh_auto_configure -- ${NEO_BUILD_EXTRA_OPTS} \
1817
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
1918
-DNEO_VERSION_BUILD=$(ver) \
20-
-DNEO_VERSION_HOTFIX=$(ver_hf) \
2119
-DNEO_SKIP_UNIT_TESTS=${NEO_SKIP_UNIT_TESTS} \
2220
-DNEO_ENABLE_i915_PRELIM_DETECTION=${NEO_ENABLE_i915_PRELIM_DETECTION} \
2321
-DNEO_ENABLE_XE_EU_DEBUG_SUPPORT=${NEO_ENABLE_XE_EU_DEBUG_SUPPORT} \

0 commit comments

Comments
 (0)