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

Introduce DPCTL_WITH_REDIST cmake option to fix #1893

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

oleksandr-pavlyk
Copy link
Collaborator

Closes gh-1892

This PR introduced DPCTL_WITH_REDIST cmake options, defaulting to OFF.

If set, cmake script add to RUNPATH an entry relative to $ORIGIN that would point to $PREFIX/lib, hence allowing native extensions to find DPC++ redistributable libraries.

conda-recipe/build.sh is modified to set DPCTL_WITH_REDIST=TRUE.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?
  • If this PR is a work in progress, are you opening the PR as a draft?

Copy link

Copy link

Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_212 ran successfully.
Passed: 893
Failed: 2
Skipped: 119

@coveralls
Copy link
Collaborator

coveralls commented Nov 14, 2024

Coverage Status

coverage: 87.705%. remained the same
when pulling e4f3964 on support-redist-runpath
into dd2812f on master.

@oleksandr-pavlyk
Copy link
Collaborator Author

I can see that RUNPATH is set as expected in conda package:

(test_fix) (py312) opavlyk@opavlyk-mobl:~/tmp/tmp$ readelf -d lib/python3.12/site-packages/dpctl/_sycl_device.cpython-312-x86_64-linux-gnu.so

Dynamic section at offset 0x335e0 contains 29 entries:
  Tag        Type                         Name/Value
 0x000000000000000f (RPATH)              Library rpath: [$ORIGIN/../../..:$ORIGIN]
 0x0000000000000001 (NEEDED)             Shared library: [libDPCTLSyclInterface.so]
 0x0000000000000001 (NEEDED)             Shared library: [libintlc.so.5]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]

but it is not set correctly in the wheels built by our CI (wheel is built in build.sh as part of conda build command execution.

(test_fix) (py312) opavlyk@opavlyk-mobl:~/tmp/tmp$ readelf -d $VIRTUAL_ENV/lib/python3.12/site-packages/dpctl/utils/_compute_follows_data.cpython-312-x86_64-linux-gnu.so | head

Dynamic section at offset 0x2c6a0 contains 29 entries:
  Tag        Type                         Name/Value
 0x000000000000000f (RPATH)              Library rpath: [/usr/share/miniconda/conda-bld/dpctl_1731606427598/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib:$ORIGIN]
 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libintlc.so.5]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000000000001e (FLAGS)              BIND_NOW
 0x000000006ffffffb (FLAGS_1)            Flags: NOW
 0x0000000000000007 (RELA)               0x2508

Copy link

Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_214 ran successfully.
Passed: 895
Failed: 0
Skipped: 119

Copy link

Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_218 ran successfully.
Passed: 895
Failed: 0
Skipped: 119

Copy link

Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_219 ran successfully.
Passed: 894
Failed: 1
Skipped: 119

@oleksandr-pavlyk
Copy link
Collaborator Author

This PR has fixed the issue now:

(test_wheel) (py312) opavlyk@sprpvcbenchlin01:/localdisk/work/opavlyk/cmplrllvm-62975/tmp/wd$ readelf -d ${VIRTUAL_ENV}/lib/python3.12/site-packages/dpctl/_sycl_device.cpython-312-x86_64-linux-gnu.so  | grep RPATH
 0x000000000000000f (RPATH)              Library rpath: [/localdisk/work/opavlyk/mamba/conda-bld/dpctl_1731702185792/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib:$ORIGIN:$ORIGIN/../../..]

Both $ORIGIN (to be able to find libDPCTLSyclInterface.so) and $ORIGIN/../../.. to be able to find libraries from intel-cmplr-lib-rt are present.

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 this pull request may close these issues.

dpctl installed into virtual env fails to import
2 participants