Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/sycl-linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ jobs:
--ci-defaults --use-zstd ${{ inputs.build_configure_extra_args }} \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DLLVM_INSTALL_UTILS=ON
-DLLVM_INSTALL_UTILS=ON \
-DSYCL_UR_FORCE_FETCH_LEVEL_ZERO=ON
- name: Compile
id: build
# Emulate default value for manual dispatch as we've run out of available arguments.
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/sycl-linux-precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,12 @@ jobs:
target_devices: level_zero:gpu
extra_lit_opts: '--param test-preview-mode=False --filter-out "${{ needs.compat_read_exclude.outputs.FILTER_6_2 }}"'
binaries_artifact: 'in-container'
skip_run: true
- name: ABI compatibility / sycl-rel-6_3
runner: '["Linux", "pvc"]'
image: ghcr.io/intel/llvm/sycl_prebuilt_tests:sycl-rel-6_3
target_devices: level_zero:gpu
extra_lit_opts: '--param test-preview-mode=False --filter-out "${{ needs.compat_read_exclude.outputs.FILTER_6_3 }}"'
binaries_artifact: 'in-container'
skip_run: true

uses: ./.github/workflows/sycl-linux-run-tests.yml
with:
Expand Down
4 changes: 4 additions & 0 deletions sycl/cmake/modules/BuildUnifiedRuntime.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ set(UR_ENABLE_TRACING ON CACHE BOOL "")
set(UR_EXTERNAL_DEPENDENCIES "sycl-headers" CACHE STRING
"List of external CMake targets for executables/libraries to depend on" FORCE)

# Force fetch Level Zero loader and headers from github.com
option(SYCL_UR_FORCE_FETCH_LEVEL_ZERO "Force fetching Level Zero even if preinstalled loader is found" OFF)
set(UR_FORCE_FETCH_LEVEL_ZERO "${SYCL_UR_FORCE_FETCH_LEVEL_ZERO}" CACHE BOOL "" FORCE)

if("level_zero" IN_LIST SYCL_ENABLE_BACKENDS)
set(UR_BUILD_ADAPTER_L0 ON)
endif()
Expand Down
1 change: 1 addition & 0 deletions unified-runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ option(UR_BUILD_XPTI_LIBS "Build the XPTI libraries when tracing is enabled" ON)
option(UR_STATIC_LOADER "Build loader as a static library" OFF)
option(UR_FORCE_LIBSTDCXX "Force use of libstdc++ in a build using libc++ on Linux" OFF)
option(UR_ENABLE_LATENCY_HISTOGRAM "Enable latncy histogram" OFF)
option(UR_FORCE_FETCH_LEVEL_ZERO "Force fetching Level Zero even if preinstalled loader is found" OFF)
set(UR_EXTERNAL_DEPENDENCIES "" CACHE STRING
"List of external CMake targets for executables/libraries to depend on")
set(UR_DPCXX "" CACHE FILEPATH "Path of the DPC++ compiler executable")
Expand Down
39 changes: 22 additions & 17 deletions unified-runtime/cmake/FetchLevelZero.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,32 @@ find_package(PkgConfig QUIET)
# LevelZero doesn't install a CMake config target, just PkgConfig,
# so try using that to find the install and if it's not available
# just try to search for the path.
if(PkgConfig_FOUND)
pkg_check_modules(level-zero level-zero>=1.26.0)
if(level-zero_FOUND)
set(LEVEL_ZERO_INCLUDE_DIR "${level-zero_INCLUDEDIR}/level_zero")
set(LEVEL_ZERO_LIBRARY_SRC "${level-zero_LIBDIR}")
set(LEVEL_ZERO_LIB_NAME "${level-zero_LIBRARIES}")
message(STATUS "Level Zero Adapter: Using preinstalled level zero loader at ${level-zero_LINK_LIBRARIES}")
endif()
else()
set(L0_HEADER_PATH "loader/ze_loader.h")
find_path(L0_HEADER ${L0_HEADER_PATH} ${CMAKE_PREFIX_PATH} PATH_SUFFIXES "level_zero")
find_library(ZE_LOADER NAMES ze_loader HINTS /usr ${CMAKE_PREFIX_PATH})
if(L0_HEADER AND ZE_LOADER)
set(LEVEL_ZERO_INCLUDE_DIR "${L0_HEADER}")
set(LEVEL_ZERO_LIBRARY "${ZE_LOADER}")
message(STATUS "Level Zero Adapter: Using preinstalled level zero loader at ${LEVEL_ZERO_LIBRARY}")
add_library(ze_loader INTERFACE)
if(NOT UR_FORCE_FETCH_LEVEL_ZERO)
if(PkgConfig_FOUND)
pkg_check_modules(level-zero level-zero>=1.26.0)
if(level-zero_FOUND)
set(LEVEL_ZERO_INCLUDE_DIR "${level-zero_INCLUDEDIR}/level_zero")
set(LEVEL_ZERO_LIBRARY_SRC "${level-zero_LIBDIR}")
set(LEVEL_ZERO_LIB_NAME "${level-zero_LIBRARIES}")
message(STATUS "Level Zero Adapter: Using preinstalled level zero loader at ${level-zero_LINK_LIBRARIES}")
endif()
else()
set(L0_HEADER_PATH "loader/ze_loader.h")
find_path(L0_HEADER ${L0_HEADER_PATH} ${CMAKE_PREFIX_PATH} PATH_SUFFIXES "level_zero")
find_library(ZE_LOADER NAMES ze_loader HINTS /usr ${CMAKE_PREFIX_PATH})
if(L0_HEADER AND ZE_LOADER)
set(LEVEL_ZERO_INCLUDE_DIR "${L0_HEADER}")
set(LEVEL_ZERO_LIBRARY "${ZE_LOADER}")
message(STATUS "Level Zero Adapter: Using preinstalled level zero loader at ${LEVEL_ZERO_LIBRARY}")
add_library(ze_loader INTERFACE)
endif()
endif()
endif()

if(NOT LEVEL_ZERO_LIB_NAME AND NOT LEVEL_ZERO_LIBRARY)
if (UR_FORCE_FETCH_LEVEL_ZERO)
message(STATUS "Level Zero Adapter: Forcing fetch of Level Zero loader and headers")
endif()
message(STATUS "Level Zero Adapter: Download Level Zero loader and headers from github.com")

# Workaround warnings/errors for Level Zero build
Expand Down