mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-23 22:13:38 +00:00
Build Shared Library with cuda 10.1 (#1418)
Description: Describe your changes. Change the logic to find cublas dll Motivation and Context Why is this change required? What problem does it solve? The name pattern of cublas changed since 10.1. It doesn't include minor version in its name anymore. If it fixes an open issue, please link to the issue here.
This commit is contained in:
parent
02ded802ab
commit
6c41809655
1 changed files with 6 additions and 4 deletions
|
|
@ -577,11 +577,13 @@ if (onnxruntime_USE_CUDA)
|
|||
list(APPEND ONNXRUNTIME_CUDA_LIBRARIES cublas cudnn)
|
||||
if (WIN32)
|
||||
link_directories(${onnxruntime_CUDNN_HOME}/lib/x64)
|
||||
string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\1" onnxruntime_CUDA_VERSION_MAJOR ${CMAKE_CUDA_COMPILER_VERSION})
|
||||
string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\2" onnxruntime_CUDA_VERSION_MINOR ${CMAKE_CUDA_COMPILER_VERSION})
|
||||
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DELAYLOAD:cublas64_${onnxruntime_CUDA_VERSION_MAJOR}${onnxruntime_CUDA_VERSION_MINOR}.dll")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DELAYLOAD:cudart64_${onnxruntime_CUDA_VERSION_MAJOR}${onnxruntime_CUDA_VERSION_MINOR}.dll")
|
||||
file(GLOB cuda_dll_paths "${onnxruntime_CUDA_HOME}/bin/cublas64_*" "${onnxruntime_CUDA_HOME}/bin/cudart64_*")
|
||||
foreach(cuda_dll_path ${cuda_dll_paths})
|
||||
get_filename_component(cuda_dll_file_name ${cuda_dll_path} NAME)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DELAYLOAD:${cuda_dll_file_name}")
|
||||
endforeach(cuda_dll_path)
|
||||
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DELAYLOAD:cudnn64_7.dll")
|
||||
else()
|
||||
link_directories(${onnxruntime_CUDNN_HOME}/lib64)
|
||||
|
|
|
|||
Loading…
Reference in a new issue