Skip to content

Commit 789a8fa

Browse files
committed
Set RPATH for cuda libraries from python package
Signed-off-by: take-cheeze <takechi101010@gmail.com>
1 parent 0ded113 commit 789a8fa

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

transformer_engine/common/CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ if(NOT arch_120_index EQUAL -1)
7979
endif()
8080
endif()
8181

82+
# Python
83+
find_package(Python COMPONENTS Interpreter Development.Module REQUIRED)
84+
8285
# cuDNN frontend API
8386
set(CUDNN_FRONTEND_INCLUDE_DIR
8487
"${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/cudnn-frontend/include")
@@ -90,14 +93,15 @@ if(NOT EXISTS "${CUDNN_FRONTEND_INCLUDE_DIR}")
9093
endif()
9194
include(${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/cudnn-frontend/cmake/cuDNN.cmake)
9295

96+
if(cudnn_LIBRARY MATCHES "nvidia/cudnn")
97+
set(CMAKE_INSTALL_RPATH "\${ORIGIN}/../nvidia/cudnn/lib:\${ORIGIN}/../nvidia/cublas/lib:\${ORIGIN}/../nvidia/cuda_runtime/lib")
98+
endif()
99+
93100
set(CUTLASS_INCLUDE_DIR
94101
"${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/cutlass/include")
95102
set(CUTLASS_TOOLS_INCLUDE_DIR
96103
"${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/cutlass/tools/util/include")
97104

98-
# Python
99-
find_package(Python COMPONENTS Interpreter Development.Module REQUIRED)
100-
101105
# Configure Transformer Engine library
102106
include_directories(${PROJECT_SOURCE_DIR}/..)
103107
set(transformer_engine_SOURCES)

0 commit comments

Comments
 (0)