Skip to content

Commit 0a377bc

Browse files
committed
[CI] Re-enable ABI-compatibility testing in pre-commit
Added UR_FORCE_FETCH_LEVEL_ZERO and corresponding SYCL_UR_FORCE_FETCH_LEVEL_ZERO CMake options that force Level Zero loader fetching even if a preinstalled one is found on the platform.
1 parent 168f459 commit 0a377bc

File tree

5 files changed

+29
-20
lines changed

5 files changed

+29
-20
lines changed

.github/workflows/sycl-linux-build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ jobs:
204204
--ci-defaults --use-zstd ${{ inputs.build_configure_extra_args }} \
205205
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
206206
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
207-
-DLLVM_INSTALL_UTILS=ON
207+
-DLLVM_INSTALL_UTILS=ON \
208+
-DSYCL_UR_FORCE_FETCH_LEVEL_ZERO=ON
208209
- name: Compile
209210
id: build
210211
# Emulate default value for manual dispatch as we've run out of available arguments.

.github/workflows/sycl-linux-precommit.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,12 @@ jobs:
197197
target_devices: level_zero:gpu
198198
extra_lit_opts: '--param test-preview-mode=False --filter-out "${{ needs.compat_read_exclude.outputs.FILTER_6_2 }}"'
199199
binaries_artifact: 'in-container'
200-
skip_run: true
201200
- name: ABI compatibility / sycl-rel-6_3
202201
runner: '["Linux", "pvc"]'
203202
image: ghcr.io/intel/llvm/sycl_prebuilt_tests:sycl-rel-6_3
204203
target_devices: level_zero:gpu
205204
extra_lit_opts: '--param test-preview-mode=False --filter-out "${{ needs.compat_read_exclude.outputs.FILTER_6_3 }}"'
206205
binaries_artifact: 'in-container'
207-
skip_run: true
208206

209207
uses: ./.github/workflows/sycl-linux-run-tests.yml
210208
with:

sycl/cmake/modules/BuildUnifiedRuntime.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ set(UR_ENABLE_TRACING ON CACHE BOOL "")
2727
set(UR_EXTERNAL_DEPENDENCIES "sycl-headers" CACHE STRING
2828
"List of external CMake targets for executables/libraries to depend on" FORCE)
2929

30+
# Force fetch Level Zero loader and headers from github.com
31+
option(SYCL_UR_FORCE_FETCH_LEVEL_ZERO "Force fetching Level Zero even if preinstalled loader is found" OFF)
32+
set(UR_FORCE_FETCH_LEVEL_ZERO "${SYCL_UR_FORCE_FETCH_LEVEL_ZERO}" CACHE BOOL "" FORCE)
33+
3034
if("level_zero" IN_LIST SYCL_ENABLE_BACKENDS)
3135
set(UR_BUILD_ADAPTER_L0 ON)
3236
endif()

unified-runtime/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ option(UR_BUILD_XPTI_LIBS "Build the XPTI libraries when tracing is enabled" ON)
5656
option(UR_STATIC_LOADER "Build loader as a static library" OFF)
5757
option(UR_FORCE_LIBSTDCXX "Force use of libstdc++ in a build using libc++ on Linux" OFF)
5858
option(UR_ENABLE_LATENCY_HISTOGRAM "Enable latncy histogram" OFF)
59+
option(UR_FORCE_FETCH_LEVEL_ZERO "Force fetching Level Zero even if preinstalled loader is found" OFF)
5960
set(UR_EXTERNAL_DEPENDENCIES "" CACHE STRING
6061
"List of external CMake targets for executables/libraries to depend on")
6162
set(UR_DPCXX "" CACHE FILEPATH "Path of the DPC++ compiler executable")

unified-runtime/cmake/FetchLevelZero.cmake

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,32 @@ find_package(PkgConfig QUIET)
1212
# LevelZero doesn't install a CMake config target, just PkgConfig,
1313
# so try using that to find the install and if it's not available
1414
# just try to search for the path.
15-
if(PkgConfig_FOUND)
16-
pkg_check_modules(level-zero level-zero>=1.25.2)
17-
if(level-zero_FOUND)
18-
set(LEVEL_ZERO_INCLUDE_DIR "${level-zero_INCLUDEDIR}/level_zero")
19-
set(LEVEL_ZERO_LIBRARY_SRC "${level-zero_LIBDIR}")
20-
set(LEVEL_ZERO_LIB_NAME "${level-zero_LIBRARIES}")
21-
message(STATUS "Level Zero Adapter: Using preinstalled level zero loader at ${level-zero_LINK_LIBRARIES}")
22-
endif()
23-
else()
24-
set(L0_HEADER_PATH "loader/ze_loader.h")
25-
find_path(L0_HEADER ${L0_HEADER_PATH} ${CMAKE_PREFIX_PATH} PATH_SUFFIXES "level_zero")
26-
find_library(ZE_LOADER NAMES ze_loader HINTS /usr ${CMAKE_PREFIX_PATH})
27-
if(L0_HEADER AND ZE_LOADER)
28-
set(LEVEL_ZERO_INCLUDE_DIR "${L0_HEADER}")
29-
set(LEVEL_ZERO_LIBRARY "${ZE_LOADER}")
30-
message(STATUS "Level Zero Adapter: Using preinstalled level zero loader at ${LEVEL_ZERO_LIBRARY}")
31-
add_library(ze_loader INTERFACE)
15+
if(NOT UR_FORCE_FETCH_LEVEL_ZERO)
16+
if(PkgConfig_FOUND)
17+
pkg_check_modules(level-zero level-zero>=1.25.2)
18+
if(level-zero_FOUND)
19+
set(LEVEL_ZERO_INCLUDE_DIR "${level-zero_INCLUDEDIR}/level_zero")
20+
set(LEVEL_ZERO_LIBRARY_SRC "${level-zero_LIBDIR}")
21+
set(LEVEL_ZERO_LIB_NAME "${level-zero_LIBRARIES}")
22+
message(STATUS "Level Zero Adapter: Using preinstalled level zero loader at ${level-zero_LINK_LIBRARIES}")
23+
endif()
24+
else()
25+
set(L0_HEADER_PATH "loader/ze_loader.h")
26+
find_path(L0_HEADER ${L0_HEADER_PATH} ${CMAKE_PREFIX_PATH} PATH_SUFFIXES "level_zero")
27+
find_library(ZE_LOADER NAMES ze_loader HINTS /usr ${CMAKE_PREFIX_PATH})
28+
if(L0_HEADER AND ZE_LOADER)
29+
set(LEVEL_ZERO_INCLUDE_DIR "${L0_HEADER}")
30+
set(LEVEL_ZERO_LIBRARY "${ZE_LOADER}")
31+
message(STATUS "Level Zero Adapter: Using preinstalled level zero loader at ${LEVEL_ZERO_LIBRARY}")
32+
add_library(ze_loader INTERFACE)
33+
endif()
3234
endif()
3335
endif()
3436

3537
if(NOT LEVEL_ZERO_LIB_NAME AND NOT LEVEL_ZERO_LIBRARY)
38+
if (UR_FORCE_FETCH_LEVEL_ZERO)
39+
message(STATUS "Level Zero Adapter: Forcing fetch of Level Zero loader and headers")
40+
endif()
3641
message(STATUS "Level Zero Adapter: Download Level Zero loader and headers from github.com")
3742

3843
# Workaround warnings/errors for Level Zero build

0 commit comments

Comments
 (0)