@@ -131,21 +131,11 @@ endif()
131
131
132
132
# ---[ CUDA libraries wrapper
133
133
134
- # find libcuda.so and lbnvrtc.so
135
- # For libcuda.so, we will find it under lib, lib64, and then the
136
- # stubs folder, in case we are building on a system that does not
137
- # have cuda driver installed. On windows, we also search under the
138
- # folder lib/x64.
139
- set (CUDA_CUDA_LIB "${CUDA_cuda_driver_LIBRARY} " CACHE FILEPATH "" )
134
+ # find lbnvrtc.so
140
135
set (CUDA_NVRTC_LIB "${CUDA_nvrtc_LIBRARY} " CACHE FILEPATH "" )
141
136
if (CUDA_NVRTC_LIB AND NOT CUDA_NVRTC_SHORTHASH)
142
- if ("${Python_EXECUTABLE} " STREQUAL "" )
143
- set (_python_exe "python3" )
144
- else ()
145
- set (_python_exe "${Python_EXECUTABLE} " )
146
- endif ()
147
137
execute_process (
148
- COMMAND " ${_python_exe} " -c
138
+ COMMAND Python::Interpreter -c
149
139
"import hashlib;hash=hashlib.sha256();hash.update(open('${CUDA_NVRTC_LIB} ','rb').read());print(hash.hexdigest()[:8])"
150
140
RESULT_VARIABLE _retval
151
141
OUTPUT_VARIABLE CUDA_NVRTC_SHORTHASH)
@@ -281,7 +271,7 @@ endif()
281
271
add_library (caffe2::nvrtc INTERFACE IMPORTED )
282
272
set_property (
283
273
TARGET caffe2::nvrtc PROPERTY INTERFACE_LINK_LIBRARIES
284
- CUDA::nvrtc)
274
+ CUDA::nvrtc caffe2::cuda )
285
275
286
276
# Add onnx namepsace definition to nvcc
287
277
if (ONNX_NAMESPACE)
0 commit comments