Skip to content

Commit

Permalink
[cudnn] add support for v9.3 (microsoft#40535)
Browse files Browse the repository at this point in the history
  • Loading branch information
cenit authored Aug 20, 2024
1 parent ed6f9d8 commit 2145fbe
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
8 changes: 4 additions & 4 deletions ports/cudnn/FindCUDNN.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@

include(FindPackageHandleStandardArgs)
find_path(CUDNN_INCLUDE_DIR NAMES cudnn.h cudnn_v8.h cudnn_v7.h
HINTS ${CUDA_TOOLKIT_ROOT} $ENV{CUDA_PATH} $ENV{CUDA_TOOLKIT_ROOT_DIR} $ENV{cudnn} $ENV{CUDNN} $ENV{CUDNN_ROOT_DIR} $ENV{CUDA_PATH}/../../../NVIDIA/CUDNN/v9.0 $ENV{CUDA_PATH}/../../../NVIDIA/CUDNN/v9.1 /usr/include /usr/include/x86_64-linux-gnu/ /usr/include/aarch64-linux-gnu/
PATH_SUFFIXES cuda/include include include/12.4 include/12.3 include/11.8)
HINTS ${CUDA_TOOLKIT_ROOT} $ENV{CUDA_PATH} $ENV{CUDA_TOOLKIT_ROOT_DIR} $ENV{cudnn} $ENV{CUDNN} $ENV{CUDNN_ROOT_DIR} $ENV{CUDA_PATH}/../../../NVIDIA/CUDNN/v9.0 $ENV{CUDA_PATH}/../../../NVIDIA/CUDNN/v9.1 $ENV{CUDA_PATH}/../../../NVIDIA/CUDNN/v9.2 $ENV{CUDA_PATH}/../../../NVIDIA/CUDNN/v9.3 /usr/include /usr/include/x86_64-linux-gnu/ /usr/include/aarch64-linux-gnu/
PATH_SUFFIXES cuda/include include include/11.8 include/12.0 include/12.1 include/12.2 include/12.3 include/12.4 include/12.5 include/12.6)
find_library(CUDNN_LIBRARY NAMES cudnn cudnn8 cudnn7
HINTS ${CUDA_TOOLKIT_ROOT} $ENV{CUDA_PATH} $ENV{CUDA_TOOLKIT_ROOT_DIR} $ENV{cudnn} $ENV{CUDNN} $ENV{CUDNN_ROOT_DIR} $ENV{CUDA_PATH}/../../../NVIDIA/CUDNN/v9.0 $ENV{CUDA_PATH}/../../../NVIDIA/CUDNN/v9.1 /usr/lib/x86_64-linux-gnu/ /usr/include/aarch64-linux-gnu/ /usr/
PATH_SUFFIXES lib lib64 cuda/lib cuda/lib64 lib/x64 cuda/lib/x64 lib/12.4/x64 lib/12.3/x64 lib/11.8/x64)
HINTS ${CUDA_TOOLKIT_ROOT} $ENV{CUDA_PATH} $ENV{CUDA_TOOLKIT_ROOT_DIR} $ENV{cudnn} $ENV{CUDNN} $ENV{CUDNN_ROOT_DIR} $ENV{CUDA_PATH}/../../../NVIDIA/CUDNN/v9.0 $ENV{CUDA_PATH}/../../../NVIDIA/CUDNN/v9.1 $ENV{CUDA_PATH}/../../../NVIDIA/CUDNN/v9.2 $ENV{CUDA_PATH}/../../../NVIDIA/CUDNN/v9.3 /usr/lib/x86_64-linux-gnu/ /usr/include/aarch64-linux-gnu/ /usr/
PATH_SUFFIXES lib lib64 cuda/lib cuda/lib64 lib/x64 cuda/lib/x64 lib/11.8/x64 lib/12.0/x64 lib/12.1/x64 lib/12.2/x64 lib/12.3/x64 lib/12.4/x64 lib/12.5/x64 lib/12.6/x64)

if(EXISTS "${CUDNN_INCLUDE_DIR}/cudnn.h")
file(READ ${CUDNN_INCLUDE_DIR}/cudnn.h CUDNN_HEADER_CONTENTS)
Expand Down
10 changes: 5 additions & 5 deletions ports/cudnn/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ vcpkg_find_cuda(OUT_CUDA_TOOLKIT_ROOT CUDA_TOOLKIT_ROOT OUT_CUDA_VERSION CUDA_VE

# Try to find CUDNN if it exists; only download if it doesn't exist
find_path(CUDNN_INCLUDE_DIR NAMES cudnn.h cudnn_v8.h cudnn_v7.h
HINTS ${CUDA_TOOLKIT_ROOT} $ENV{CUDA_PATH} $ENV{CUDA_TOOLKIT_ROOT_DIR} $ENV{cudnn} $ENV{CUDNN} $ENV{CUDNN_ROOT_DIR} $ENV{CUDA_PATH}/../../../NVIDIA/CUDNN/v9.0 $ENV{CUDA_PATH}/../../../NVIDIA/CUDNN/v9.1 /usr/include /usr/include/x86_64-linux-gnu/ /usr/include/aarch64-linux-gnu/
PATH_SUFFIXES cuda/include include include/12.4 include/12.3 include/11.8)
HINTS ${CUDA_TOOLKIT_ROOT} $ENV{CUDA_PATH} $ENV{CUDA_TOOLKIT_ROOT_DIR} $ENV{cudnn} $ENV{CUDNN} $ENV{CUDNN_ROOT_DIR} $ENV{CUDA_PATH}/../../../NVIDIA/CUDNN/v9.0 $ENV{CUDA_PATH}/../../../NVIDIA/CUDNN/v9.1 $ENV{CUDA_PATH}/../../../NVIDIA/CUDNN/v9.2 $ENV{CUDA_PATH}/../../../NVIDIA/CUDNN/v9.3 /usr/include /usr/include/x86_64-linux-gnu/ /usr/include/aarch64-linux-gnu/
PATH_SUFFIXES cuda/include include include/11.8 include/12.0 include/12.1 include/12.2 include/12.3 include/12.4 include/12.5 include/12.6)
message(STATUS "CUDNN_INCLUDE_DIR: ${CUDNN_INCLUDE_DIR}")
find_library(CUDNN_LIBRARY NAMES cudnn cudnn8 cudnn7
HINTS ${CUDA_TOOLKIT_ROOT} $ENV{CUDA_PATH} $ENV{CUDA_TOOLKIT_ROOT_DIR} $ENV{cudnn} $ENV{CUDNN} $ENV{CUDNN_ROOT_DIR} $ENV{CUDA_PATH}/../../../NVIDIA/CUDNN/v9.0 $ENV{CUDA_PATH}/../../../NVIDIA/CUDNN/v9.1 /usr/lib/x86_64-linux-gnu/ /usr/include/aarch64-linux-gnu/ /usr/
PATH_SUFFIXES lib lib64 cuda/lib cuda/lib64 lib/x64 cuda/lib/x64 lib/12.4/x64 lib/12.3/x64 lib/11.8/x64)
HINTS ${CUDA_TOOLKIT_ROOT} $ENV{CUDA_PATH} $ENV{CUDA_TOOLKIT_ROOT_DIR} $ENV{cudnn} $ENV{CUDNN} $ENV{CUDNN_ROOT_DIR} $ENV{CUDA_PATH}/../../../NVIDIA/CUDNN/v9.0 $ENV{CUDA_PATH}/../../../NVIDIA/CUDNN/v9.1 $ENV{CUDA_PATH}/../../../NVIDIA/CUDNN/v9.2 $ENV{CUDA_PATH}/../../../NVIDIA/CUDNN/v9.3 /usr/lib/x86_64-linux-gnu/ /usr/include/aarch64-linux-gnu/ /usr/
PATH_SUFFIXES lib lib64 cuda/lib cuda/lib64 lib/x64 cuda/lib/x64 lib/11.8/x64 lib/12.0/x64 lib/12.1/x64 lib/12.2/x64 lib/12.3/x64 lib/12.4/x64 lib/12.5/x64 lib/12.6/x64)
message(STATUS "CUDNN_LIBRARY: ${CUDNN_LIBRARY}")
if(EXISTS "${CUDNN_INCLUDE_DIR}/cudnn.h")
file(READ ${CUDNN_INCLUDE_DIR}/cudnn.h CUDNN_HEADER_CONTENTS)
Expand Down Expand Up @@ -55,7 +55,7 @@ if (CUDNN_INCLUDE_DIR AND CUDNN_LIBRARY AND _CUDNN_VERSION VERSION_GREATER_EQUAL
message(STATUS "Found CUDNN ${_CUDNN_VERSION} located on system: (include ${CUDNN_INCLUDE_DIR} lib: ${CUDNN_LIBRARY})")
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
elseif(VCPKG_TARGET_IS_WINDOWS)
message(FATAL_ERROR "Please download CUDNN from official sources (such as https://developer.nvidia.com/rdp/cudnn-download ) and extract the zip into your CUDA_TOOLKIT_ROOT (${CUDA_TOOLKIT_ROOT}). (For example: tar.exe -xvf cudnn-11.2-windows-x64-v8.1.1.33.zip --strip 1 --directory \"${CUDA_TOOLKIT_ROOT}\"")
message(FATAL_ERROR "Please download CUDNN from official sources (https://developer.nvidia.com/cudnn) and install it")
else()
message(FATAL_ERROR "Please install CUDNN using your system package manager (the same way you installed CUDA). For example: apt install libcudnn8-dev.")
endif()
Expand Down
2 changes: 1 addition & 1 deletion ports/cudnn/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cudnn",
"version": "7.6.5",
"port-version": 12,
"port-version": 13,
"description": "NVIDIA's cuDNN deep neural network acceleration library.",
"homepage": "https://developer.nvidia.com/cudnn",
"license": null,
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2098,7 +2098,7 @@
},
"cudnn": {
"baseline": "7.6.5",
"port-version": 12
"port-version": 13
},
"cunit": {
"baseline": "2.1.3",
Expand Down
5 changes: 5 additions & 0 deletions versions/c-/cudnn.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "92d21a780ad42ae4fa7aaf9481d8a43a832d6e4c",
"version": "7.6.5",
"port-version": 13
},
{
"git-tree": "a8687f7d446d544d2111cac62f5aa36681c2b223",
"version": "7.6.5",
Expand Down

0 comments on commit 2145fbe

Please sign in to comment.