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

add rpath of sycl libraries location in python env to avoid manually activating sycl environment #857

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ foreach(lib ${TORCH_XPU_OPS_LIBRARIES})
target_include_directories(${lib} PUBLIC ${SYCL_INCLUDE_DIR})

target_link_libraries(${lib} PUBLIC ${SYCL_LIBRARY})
if(LINUX)
target_link_options(${lib} PRIVATE "-Wl,-rpath,$ORIGIN")
target_link_options(${lib} PRIVATE "-Wl,-rpath,$ORIGIN/../../../../")
target_link_options(${lib} PRIVATE "-Wl,--disable-new-dtags")
endif()
Comment on lines +86 to +90
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you hope PyTorch XPU could work at runtime without sourcing oneAPI bundle?

Copy link
Author

Choose a reason for hiding this comment

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

yes, when pip packages are released.
The PR in PyTorch is pytorch/pytorch#134912

endforeach()

include(${TORCH_XPU_OPS_ROOT}/cmake/ClangFormat.cmake)
Expand Down
Loading