dpctl
dpctl copied to clipboard
windows pip installation doesn't find openCL cpu drivers properly
In this github action example, the conda environment can properly access the installed opencl driver, but pip cannot:
name: pip dpctl validator
on:
workflow_dispatch:
env:
PYTHON_VERSION: 3.9
DPCTL_VERSION: 0.17.0
jobs:
dpctl:
name: dpctl_test
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dpctl
shell: cmd
run: |
set PATH=C:\msys64\usr\bin;%PATH%
python -m venv env2
call .\env2\Scripts\activate.bat
set DPCTL_SUPPORTED=3.9 3.11
FOR %%i IN (%DPCTL_SUPPORTED%) DO if ${{ env.PYTHON_VERSION }}==%%i python -m pip install --index-url https://pypi.anaconda.org/intel/simple dpctl==0.17.0
python -c "import os, os.path, site; path_to_env = site.getsitepackages()[0]; path_to_libs = os.path.join(path_to_env, 'Library', 'bin'); temp=os.add_dll_directory(path_to_libs) if os.path.exists(path_to_libs) else None; import dpctl; print(dpctl.get_devices())"
python -c "import dpctl; print(dpctl.lsplatform(2))"
pip list
- name: Install dpctl conda
shell: cmd
run: |
set PATH=C:\msys64\usr\bin;%PATH%
call C:\Miniconda\condabin\conda.bat config --add channels https://software.repos.intel.com/python/conda/
call C:\Miniconda\condabin\conda.bat config --append channels conda-forge
call C:\Miniconda\condabin\conda.bat create --name dpctl_env dpctl
call C:\Miniconda\condabin\conda.bat activate dpctl_env
python -c "import dpctl; print(dpctl.lsplatform(2))"
By installing the opencl cpu driver from here: and including the following path:
set PATH="C:\Program Files (x86)\Common Files\Intel\Shared Libraries\bin;"%PATH%
The pip version can recover the CPU sycl device.
Could be this is an upstream issue with intel-opencl-rt repository? Either a warning needs to be added to the documentation that the drivers must be installed separately in the pip path, or this would need to be fixed.