diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index fee00dee0b551..8ff5b5d706435 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -807,6 +807,10 @@ if (onnxruntime_DISABLE_OPTIONAL_TYPE) add_compile_definitions(DISABLE_OPTIONAL_TYPE) endif() +if (onnxruntime_USE_CUDA AND "${onnxruntime_CUDNN_HOME}" STREQUAL "") + message(FATAL_ERROR "onnxruntime_CUDNN_HOME required for onnxruntime_USE_CUDA") +endif() + get_filename_component(ONNXRUNTIME_ROOT "${ONNXRUNTIME_ROOT}" ABSOLUTE) get_filename_component(ORTTRAINING_ROOT "${ORTTRAINING_ROOT}" ABSOLUTE) get_filename_component(REPO_ROOT "${REPO_ROOT}" ABSOLUTE)