:py:mod:`dpctl` is licensed under Apache* License 2.0 that can be found in the LICENSE file. All usage and contributions to the project are subject to the terms and conditions of this license.
See the user guide :ref:`document <user_guide_dpctl_license>` for additional information.
Binary builds of :py:mod:`dpctl` are available for the conda package manager ecosystem.
Released versions of the package can be installed from the Intel channel, as
indicated by --channel option:
conda create --name dpctl_env --channel https://software.repos.intel.com/python/conda/ --channel conda-forge dpctlDevelopment builds of dpctl can be accessed from the dppy/label/dev channel:
conda create -n dpctl_nightly -c dppy/label/dev -c https://software.repos.intel.com/python/conda/ -c conda-forge dpctlNote
If :py:mod:`dpctl` is not available for the Python version of interest, see Building from source.
Binary wheels are published with Python Package Index (https://pypi.org/project/dpctl/).
python -m pip install dpctlBinary wheels of dpctl and its dependencies are also published on Intel(R) channel. To install from this non-default package index,
use
python -m pip install --index-url https://software.repos.intel.com/python/pypi dpctlNote
As of April 2024, installation using pip on Linux* requires
that host operating system had libstdc++.so library version 6.0.29
or later. Check the version you have by executing
find /lib/x86_64-linux-gnu/ -name "libstdc++*"
Note
If :py:mod:`dpctl` is not available for the Python version of interest, see Building from source.
Intel(R) Distribution for Python* is distributed as a conda-based installer and includes :py:mod:`dpctl` along with its dependencies and sister projects :py:mod:`dpnp` and :py:mod:`numba_dpex`.
Once the installed environment is activated, dpctl should be ready to use.
Since :py:mod:`dpctl` is compiled using the Intel(R) oneAPI DPC++ compiler, the compiler's system requirements for runtime must be met.
In order for DPC++ runtime to recognize supported hardware appropriate drivers must be installed. Directions to install drivers for Intel GPU devices are available at https://dgpu-docs.intel.com/
Once dpctl is installed, use python -m dpctl --full-list to list recognized devices.
For dpctl to target Intel GPU devices, appropriate drivers should be installed systemwide.
Please refer to GPU installation guide for detailed
instructions on how to install required drivers on Linux.
Note
Instructions for setting up GPU drivers in Windows Subsystem for Linux (WSL) will be added in a future release of this document.
There are several reasons to want to build dpctl from source:
- To use it with Python version for which binary artifacts are not available
- To be able to use DPC++ runtime libraries from local installation of DPC++ compiler and avoid installing them into Python environment
- To build for custom SYCL targets, such as
nvptx64-nvidia-cudaor"amdgcn-amd-amdhsa".
Working with :py:mod:`dpctl` in this mode assumes that the DPC++ compiler is activated, and that
Python environment has all build and runtime dependencies of dpctl installed.
One way to create such environment is as follows:
conda create -n dev_dpctl -c conda-forge python=3.12 pip
conda activate dev_dpctl
pip install --no-cache-dir numpy cython scikit-build cmake ninja pytestUsing such environment and with DPC++ compiler activated, build the project using
python scripts/build_locally.py --verboseNote
Coming back to use this local build of dpctl remember to activate DPC++.
Project :py:mod:`dpctl` is written using generic SYCL and supports building for multiple SYCL targets, subject to limitations of CodePlay plugins implementing SYCL programming model for classes of devices.
Building dpctl for these targets requires that these CodePlay plugins be
installed into DPC++ installation layout of compatible version.
The following plugins from CodePlay are supported:
Build dpctl as follows:
python scripts/build_locally.py --verbose --cmake-opts="-DDPCTL_TARGET_CUDA=ON"After setting up dpctl, you can test the Python examples as follows:
for script in `ls examples/python/`
do
echo "executing ${script}"
python examples/python/${script}
doneThe :py:mod:`dpctl` repository also provides a set of examples of building Cython and pybind11 extensions with the DPC++ compiler that interoperate with :py:mod:`dpctl`.
Please refer to the README.md file in respective folders for instructions on how to build
each example Python project and how to execute its test suite.
You can execute Python test suite of :py:mod:`dpctl` with:
pytest --pyargs dpctl