Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dpctl installed into virtual env fails to import #1892

Open
oleksandr-pavlyk opened this issue Nov 14, 2024 · 0 comments · May be fixed by #1893
Open

dpctl installed into virtual env fails to import #1892

oleksandr-pavlyk opened this issue Nov 14, 2024 · 0 comments · May be fixed by #1893
Assignees

Comments

@oleksandr-pavlyk
Copy link
Collaborator

I executed the following steps;

conda create -n py312 -c conda-forge --override-channels python=3.12 virtualenv
conda activate py312
python -m venv pypi_venv
source pypi_venv/bin/activate
pip install --no-cache-dir --index-url https://software.repos.intel.com/python/pypi  dpctl==0.18.1
python -c "import dpctl"

Observed output:

(pypi_venv) (py312) opavlyk@opavlyk-mobl:~/tmp$ python -c "import dpctl"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/opavlyk/tmp/pypi_venv/lib/python3.12/site-packages/dpctl/__init__.py", line 29, in <module>
    from ._device_selection import select_device_with_aspects
  File "/home/opavlyk/tmp/pypi_venv/lib/python3.12/site-packages/dpctl/_device_selection.py", line 20, in <module>
    from ._sycl_device import SyclDevice, SyclDeviceCreationError
ImportError: libintlc.so.5: cannot open shared object file: No such file or directory

Executing patchelf --set-rpath '$ORIGIN:$ORIGIN/../../../' --force-rpath $VIRTUAL_ENV/lib/python3.12/site-packages/dpctl/*.cpython*.so fixes the problem, because it allows Python modules to find the dependent DPC++ runtime libraries in Python prefix's lib folder.

@oleksandr-pavlyk oleksandr-pavlyk self-assigned this Nov 14, 2024
@oleksandr-pavlyk oleksandr-pavlyk linked a pull request Nov 14, 2024 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant