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

Update Level Zero loader detection for newer compiler builds #2025

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

Conversation

ndgrigorian
Copy link
Collaborator

@ndgrigorian ndgrigorian commented Mar 18, 2025

As of intel/llvm#17104 libur_adapter_level_zero.so is statically linked to the Level Zero loader, meaning that the shared object can no longer be read for the loader filename

To resolve this, a default filename is now set in CMake, as it is unlikely to change. For backwards compatibility, it is only set to the default value if the object file is read and the loader is not found through the original approach.

Resolves #2022

  • 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?

SYCL nightly and future builds now link libur_adapter_level_zero to the level zero loader statically, so detecting through readelf is no longer possible

For this case, we instead set the default Level Zero Loader filename to be 'libze_loader.so.1,' which is likely to not change

See: intel/llvm#17104
@ndgrigorian
Copy link
Collaborator Author

@sommerlukas
This should resolve the need for a work-around

The only thing left is to make sure it works on Windows with nightly compiler

Copy link

Copy link

Array API standard conformance tests for dpctl=0.20.0dev0=py310h93fe807_59 ran successfully.
Passed: 895
Failed: 2
Skipped: 126

@coveralls
Copy link
Collaborator

coveralls commented Mar 18, 2025

Coverage Status

coverage: 87.677%. remained the same
when pulling d8bb37f on update-level-zero-loader-detection
into 45ab64c on master.

Copy link
Contributor

@sommerlukas sommerlukas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solution looks good, we could additionally allow users to set the variable.

Allows users to set Level Zero loader filename
Copy link

Array API standard conformance tests for dpctl=0.20.0dev0=py310h93fe807_68 ran successfully.
Passed: 895
Failed: 2
Skipped: 126

Copy link
Collaborator

@antonwolfy antonwolfy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @ndgrigorian, LGTM! Just a small nit.

endif()
else ()
set(LIBZE_LOADER_FILENAME ${LIBZE_SET_LOADER_FILENAME})
endif()
set(LIBZE_LOADER_FILENAME ${LIBZE_LOADER_FILENAME} PARENT_SCOPE)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove that line? It seems duplicating with one below.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Difficult to say, it does duplicate, but it was already present in the code before, so I would want to be sure that it never served a purpose

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.

Level Zero Loader detection does not work with most recent DPC++ nightly
4 participants