dpctl icon indicating copy to clipboard operation
dpctl copied to clipboard

dpctl pip install broken on windows for python3.11

Open icfaust opened this issue 1 year ago • 4 comments

System info:

OS Name:                   Microsoft Windows 11 Enterprise
OS Version:                10.0.22631 N/A Build 22631
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: Intel64 Family 6 Model 140 Stepping 1 GenuineIntel ~2995 Mhz

Using python3.11

Reproducer

python -m venv env2
env2\Scripts\activate.bat
python -m pip install dpctl
python -c "import dpctl"

image

Not sure if I am doing something wrong, but I am seeing this failure locally and in github action VMs using pip

icfaust avatar Jul 19 '24 15:07 icfaust

temporary fix:

import os, site
path_to_env = site.getsitepackages()[0]
path_to_libs = os.path.join(path_to_env, "Library", "bin")
os.add_dll_directory(path_to_libs)
import dpctl

icfaust avatar Jul 19 '24 15:07 icfaust

here is a rough github workflow which can show the error. also when fixed it doesnt show any devices (second error? i was able to install manually the dpcpp compiler separately using the offline installer and yield an opencl device via sycl-ls). also broken for 3.9

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 pip install dpctl==${{ env.DPCTL_VERSION }}
          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.get_devices())"
          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 https://software.repos.intel.com/python/conda/
          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))"

icfaust avatar Jul 21 '24 20:07 icfaust

it looks like conda on windows has the same behavior

EDIT: erroneous claim, this issue is addressed in another Turns out that there is a bug in the intel channel for windows and the vc14_runtime

icfaust avatar Jul 21 '24 21:07 icfaust

Second issue with missing devices discussed here: https://github.com/IntelPython/dpctl/issues/1751

icfaust avatar Jul 22 '24 14:07 icfaust

Closing as completed via gh-1922.

oleksandr-pavlyk avatar Dec 10 '24 15:12 oleksandr-pavlyk