From 4e983634ffb1a9e3f198480a166c5622bccac164 Mon Sep 17 00:00:00 2001 From: Tianlei Wu Date: Wed, 7 Oct 2020 11:33:12 -0700 Subject: [PATCH] clear cudaDelayLoadedLibs since delayload is disabled (#5386) --- BUILD.md | 2 +- cmake/CMakeLists.txt | 3 ++- csharp/src/Microsoft.ML.OnnxRuntime/SessionOptions.cs | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/BUILD.md b/BUILD.md index ee5adb5910..dba88f769b 100644 --- a/BUILD.md +++ b/BUILD.md @@ -168,7 +168,7 @@ Nuget packages are created under \nuget-artifacts ONNX Runtime can also be built with CUDA versions from 10.1 up to 11.0, and cuDNN versions from 7.6 up to 8.0. * The path to the CUDA installation must be provided via the CUDA_PATH environment variable, or the `--cuda_home` parameter * The path to the cuDNN installation (include the `cuda` folder in the path) must be provided via the cuDNN_PATH environment variable, or `--cudnn_home` parameter. The cuDNN path should contain `bin`, `include` and `lib` directories. - * The path to the cuDNN bin directory must be added to the PATH environment variable so that cudnn64_7.dll is found. + * The path to the cuDNN bin directory must be added to the PATH environment variable so that cudnn64_8.dll is found. #### Build Instructions ##### Windows diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index bd7114bd03..853651ac51 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -1031,8 +1031,9 @@ if (onnxruntime_USE_CUDA) link_directories(${onnxruntime_CUDNN_HOME}/lib/x64) # delayload causes crash on exit, so disable for now + # please update cudaDelayLoadedLibs in Microsoft.ML.OnnxRuntime/SessionOptions.cs if you change delayload #file(GLOB cuda_dll_paths "${onnxruntime_CUDA_HOME}/bin/cublas64_*" "${onnxruntime_CUDA_HOME}/bin/cudart64_*" "${onnxruntime_CUDA_HOME}/bin/curand64_*" "${onnxruntime_CUDA_HOME}/bin/cufft64_*") - #set(onnxruntime_DELAYLOAD_FLAGS "${onnxruntime_DELAYLOAD_FLAGS} /DELAYLOAD:cudnn64_7.dll") + #set(onnxruntime_DELAYLOAD_FLAGS "${onnxruntime_DELAYLOAD_FLAGS} /DELAYLOAD:cudnn64_8.dll") #foreach(cuda_dll_path ${cuda_dll_paths}) # get_filename_component(cuda_dll_file_name ${cuda_dll_path} NAME) # set(onnxruntime_DELAYLOAD_FLAGS "${onnxruntime_DELAYLOAD_FLAGS} /DELAYLOAD:${cuda_dll_file_name}") diff --git a/csharp/src/Microsoft.ML.OnnxRuntime/SessionOptions.cs b/csharp/src/Microsoft.ML.OnnxRuntime/SessionOptions.cs index 138fce5dfe..e65e824256 100644 --- a/csharp/src/Microsoft.ML.OnnxRuntime/SessionOptions.cs +++ b/csharp/src/Microsoft.ML.OnnxRuntime/SessionOptions.cs @@ -36,7 +36,8 @@ namespace Microsoft.ML.OnnxRuntime /// public class SessionOptions : SafeHandle { - private static string[] cudaDelayLoadedLibs = { "cublas64_10.dll", "cudnn64_7.dll", "curand64_10.dll" }; + // Delayloaded CUDA or cuDNN DLLs. Currently, delayload is disabled. See cmake/CMakeLists.txt for more information. + private static string[] cudaDelayLoadedLibs = { }; #region Constructor and Factory methods