Skip to content

Commit ccb8cf7

Browse files
committed
Merge branch 'master' into feature/sycl-source-compilation
2 parents eaac81e + ac092b2 commit ccb8cf7

8 files changed

Lines changed: 82 additions & 37 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818

1919
### Fixed
2020

21+
### Maintenance
22+
* Updated pybind11 version used by `dpctl` and examples [gh-2357](https://github.com/IntelPython/dpctl/pull/2357)
23+
2124
## [0.22.1] - Apr. 24, 2026
2225

2326
This is a bug-fix release which fixes a memory leak in `dpctl.RawKernelArg`.

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ include(FetchContent)
125125

126126
FetchContent_Declare(
127127
pybind11
128-
URL https://github.com/pybind/pybind11/archive/refs/tags/v3.0.1.tar.gz
129-
URL_HASH SHA256=741633da746b7c738bb71f1854f957b9da660bcd2dce68d71949037f0969d0ca
128+
URL https://github.com/pybind/pybind11/archive/refs/tags/v3.1.0.tar.gz
129+
URL_HASH SHA256=ef712655692a2e9bf7bb7874c022564a45f91d847ddee987e720cd9e28849665
130130
FIND_PACKAGE_ARGS NAMES pybind11
131131
)
132132
FetchContent_MakeAvailable(pybind11)

docs/doc_sources/contributor_guides/building.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,30 @@ You can retrieve available options and their descriptions using the option
186186
:code:`--help`.
187187

188188

189+
Runtime loaders when using a nightly DPC++ build
190+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
191+
192+
:py:mod:`dpctl` creates kernel bundles from OpenCL* source and from SPIR-V by
193+
calling into the OpenCL ICD loader and the Level Zero loader directly.
194+
195+
The oneAPI DPC++ Compiler installation and the conda packages provide these
196+
loaders as dependencies. Nightly builds of the open source DPC++ toolchain,
197+
however, bundle neither, so they must be installed separately:
198+
199+
- ``libOpenCL.so.1``, from the OpenCL ICD loader (for example, ``ocl-icd``
200+
conda package or ``ocl-icd-libopencl1`` system package)
201+
- ``libze_loader.so.1``, from the Level Zero loader (for example, the
202+
``level-zero`` conda package or the ``libze1`` system package)
203+
204+
Both can be installed from the toolchain's own dependencies. The DPC++ toolchain
205+
pins them in `devops/dependencies.json <https://github.com/intel/llvm/blob/sycl/devops/dependencies.json>`_,
206+
as the ``level_zero`` and ``oclcpu`` entries.
207+
208+
Should a loader be installed under a different file name, override the name that
209+
:py:mod:`dpctl` uses with the ``LIBCL_SET_LOADER_FILENAME`` and
210+
``LIBZE_SET_LOADER_FILENAME`` CMake variables.
211+
212+
189213
Building the libsyclinterface Library
190214
=======================================
191215

examples/pybind11/external_usm_allocation/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
1414
include(FetchContent)
1515
FetchContent_Declare(
1616
pybind11
17-
URL https://github.com/pybind/pybind11/archive/refs/tags/v2.13.6.tar.gz
18-
URL_HASH SHA256=e08cb87f4773da97fa7b5f035de8763abc656d87d5773e62f6da0587d1f0ec20
17+
URL https://github.com/pybind/pybind11/archive/refs/tags/v3.1.0.tar.gz
18+
URL_HASH SHA256=ef712655692a2e9bf7bb7874c022564a45f91d847ddee987e720cd9e28849665
1919
FIND_PACKAGE_ARGS NAMES pybind11
2020
)
2121
FetchContent_MakeAvailable(pybind11)

examples/pybind11/onemkl_gemv/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ include(GNUInstallDirs)
1818
include(FetchContent)
1919
FetchContent_Declare(
2020
pybind11
21-
URL https://github.com/pybind/pybind11/archive/refs/tags/v2.13.6.tar.gz
22-
URL_HASH SHA256=e08cb87f4773da97fa7b5f035de8763abc656d87d5773e62f6da0587d1f0ec20
21+
URL https://github.com/pybind/pybind11/archive/refs/tags/v3.1.0.tar.gz
22+
URL_HASH SHA256=ef712655692a2e9bf7bb7874c022564a45f91d847ddee987e720cd9e28849665
2323
FIND_PACKAGE_ARGS NAMES pybind11
2424
)
2525
FetchContent_MakeAvailable(pybind11)

examples/pybind11/use_dpctl_sycl_kernel/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ set(CMAKE_BUILD_TYPE Debug)
1515
include(FetchContent)
1616
FetchContent_Declare(
1717
pybind11
18-
URL https://github.com/pybind/pybind11/archive/refs/tags/v2.13.6.tar.gz
19-
URL_HASH SHA256=e08cb87f4773da97fa7b5f035de8763abc656d87d5773e62f6da0587d1f0ec20
18+
URL https://github.com/pybind/pybind11/archive/refs/tags/v3.1.0.tar.gz
19+
URL_HASH SHA256=ef712655692a2e9bf7bb7874c022564a45f91d847ddee987e720cd9e28849665
2020
FIND_PACKAGE_ARGS NAMES pybind11
2121
)
2222
FetchContent_MakeAvailable(pybind11)

examples/pybind11/use_dpctl_sycl_queue/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
1414
include(FetchContent)
1515
FetchContent_Declare(
1616
pybind11
17-
URL https://github.com/pybind/pybind11/archive/refs/tags/v2.13.6.tar.gz
18-
URL_HASH SHA256=e08cb87f4773da97fa7b5f035de8763abc656d87d5773e62f6da0587d1f0ec20
17+
URL https://github.com/pybind/pybind11/archive/refs/tags/v3.1.0.tar.gz
18+
URL_HASH SHA256=ef712655692a2e9bf7bb7874c022564a45f91d847ddee987e720cd9e28849665
1919
FIND_PACKAGE_ARGS NAMES pybind11
2020
)
2121
FetchContent_MakeAvailable(pybind11)

libsyclinterface/CMakeLists.txt

Lines changed: 45 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ set(LIBZE_SET_LOADER_FILENAME "" CACHE STRING "User-provided Level Zero Loader f
4848

4949
set(LIBZE_DEFAULT_LOADER_FILENAME "libze_loader.so.1" CACHE STRING "Default Level Zero Loader filename")
5050

51+
set(LIBCL_SET_LOADER_FILENAME "" CACHE STRING "User-provided OpenCL ICD Loader filename")
52+
53+
set(LIBCL_DEFAULT_LOADER_FILENAME "libOpenCL.so.1" CACHE STRING "Default OpenCL ICD Loader filename")
54+
5155
# Minimum version requirement only when oneAPI dpcpp is used.
5256
if(DPCTL_DPCPP_FROM_ONEAPI)
5357
find_package(IntelSyclCompiler 2021.3.0 REQUIRED)
@@ -65,21 +69,24 @@ if(DPCTL_ENABLE_L0_PROGRAM_CREATION)
6569
endif()
6670
if (UNIX)
6771
if ("x${LIBZE_SET_LOADER_FILENAME}" STREQUAL "x")
68-
find_library(PI_LEVEL_ZERO_LIB
69-
NAMES pi_level_zero ur_adapter_level_zero
72+
find_library(LEVEL_ZERO_LIB
73+
NAMES ur_adapter_level_zero
7074
HINTS ${IntelSyclCompiler_LIBRARY_DIR}
7175
)
72-
find_program(READELF_PROG readelf)
73-
find_program(GREP_PROG grep)
74-
execute_process(
75-
COMMAND ${READELF_PROG} -d ${PI_LEVEL_ZERO_LIB}
76-
COMMAND ${GREP_PROG} libze_loader
77-
COMMAND ${GREP_PROG} -Po "libze_loader[^\]]*"
78-
OUTPUT_VARIABLE LIBZE_LOADER_FILENAME
79-
OUTPUT_STRIP_TRAILING_WHITESPACE
80-
ERROR_STRIP_TRAILING_WHITESPACE
81-
)
82-
# if libze_loader is statically linked, LIBZE_LOADER_FILENAME will be an empty string
76+
if (LEVEL_ZERO_LIB)
77+
find_program(READELF_PROG readelf)
78+
find_program(GREP_PROG grep)
79+
execute_process(
80+
COMMAND ${READELF_PROG} -d ${LEVEL_ZERO_LIB}
81+
COMMAND ${GREP_PROG} libze_loader
82+
COMMAND ${GREP_PROG} -Po "libze_loader[^\]]*"
83+
OUTPUT_VARIABLE LIBZE_LOADER_FILENAME
84+
OUTPUT_STRIP_TRAILING_WHITESPACE
85+
ERROR_STRIP_TRAILING_WHITESPACE
86+
)
87+
endif()
88+
# empty if the adapter was not found or if it links the Level Zero
89+
# loader statically
8390
if ("x${LIBZE_LOADER_FILENAME}" STREQUAL "x")
8491
set(LIBZE_LOADER_FILENAME ${LIBZE_DEFAULT_LOADER_FILENAME})
8592
endif()
@@ -91,20 +98,31 @@ if(DPCTL_ENABLE_L0_PROGRAM_CREATION)
9198
endif()
9299

93100
if (UNIX)
94-
find_library(PI_OPENCL_LIB
95-
NAMES pi_opencl ur_adapter_opencl
96-
HINTS ${IntelSyclCompiler_LIBRARY_DIR}
97-
)
98-
find_program(READELF_PROG readelf)
99-
find_program(GREP_PROG grep)
100-
execute_process(
101-
COMMAND ${READELF_PROG} -d ${PI_OPENCL_LIB}
102-
COMMAND ${GREP_PROG} OpenCL
103-
COMMAND ${GREP_PROG} -Po "libOpenCL[^\]]*"
104-
OUTPUT_VARIABLE LIBCL_LOADER_FILENAME
105-
OUTPUT_STRIP_TRAILING_WHITESPACE
106-
ERROR_STRIP_TRAILING_WHITESPACE
107-
)
101+
if ("x${LIBCL_SET_LOADER_FILENAME}" STREQUAL "x")
102+
find_library(OPENCL_LIB
103+
NAMES ur_adapter_opencl OpenCL
104+
HINTS ${IntelSyclCompiler_LIBRARY_DIR}
105+
)
106+
if (OPENCL_LIB)
107+
find_program(READELF_PROG readelf)
108+
find_program(GREP_PROG grep)
109+
execute_process(
110+
COMMAND ${READELF_PROG} -d ${OPENCL_LIB}
111+
COMMAND ${GREP_PROG} OpenCL
112+
COMMAND ${GREP_PROG} -Po "libOpenCL[^\]]*"
113+
OUTPUT_VARIABLE LIBCL_LOADER_FILENAME
114+
OUTPUT_STRIP_TRAILING_WHITESPACE
115+
ERROR_STRIP_TRAILING_WHITESPACE
116+
)
117+
endif()
118+
# Empty if the adapter was not found or if it links the ICD loader
119+
# statically
120+
if ("x${LIBCL_LOADER_FILENAME}" STREQUAL "x")
121+
set(LIBCL_LOADER_FILENAME ${LIBCL_DEFAULT_LOADER_FILENAME})
122+
endif()
123+
else ()
124+
set(LIBCL_LOADER_FILENAME ${LIBCL_SET_LOADER_FILENAME})
125+
endif()
108126
set(LIBCL_LOADER_FILENAME ${LIBCL_LOADER_FILENAME} PARENT_SCOPE)
109127
endif()
110128

0 commit comments

Comments
 (0)