How to Install cuDNN on Windows

cuDNN is a GPU-accelerated library for deep neural networks, used alongside CUDA. Here's a step-by-step guide to help you through the process.

What’s cuDNN

The NVIDIA CUDA® Deep Neural Network (cuDNN) is a GPU-accelerated library of primitives for deep neural networks. cuDNN provides highly tuned implementations for standard routines such as forward and backward convolution, attention, mammal, pooling, and normalization.

How To Install cuDNN

Installing cuDNN (CUDA Deep Neural Network library) on Windows involves several steps.

Step 1. Installing NVIDIA Graphic Drivers

(1) Go to NVIDIA drivers download page:https://www.nvidia.com/download/index.aspx?lang=en-us

(2) Select the GPU and OS version from the drop-down menus.

Nvidia download drivers

(3) Download and install the NVIDIA driver as indicated on that web page.

Install nvidia graphics driver

(4) Restart your system to ensure the graphics driver takes effect.

Step 2. Installing the CUDA Toolkit for Windows

(1) Install Visual Studio and check to install Python Development: Download Visual Studio Tools - Install Free for Windows, Mac, Linux (microsoft.com)

Download visual studio tools
python development

(2) Choose the right version. run command “nvidia-smi” to check your CUDA version

check your cuda version

(3) Go to CUDA Toolkit: https://developer.nvidia.com/cuda-downloads

download cuda-toolkit

(4) (4)Install CUDA Toolkit step by step

install cuda toolkit

(5) Check install successful,Run command “nvcc –V” to check

nvcc -v

Step 3. Installing cuDNN

(1) Go to cuDNN: https://developer.nvidia.com/rdp/cudnn-archive

cudnn archive

(2) Unzip the cuDNN package.

unzip cudnn package

(3) Copy the following files from the unzipped package into the NVIDIA cuDNN directory.

Copy to .bin\cudnn*.dll to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.5\bin

Copy to .include\cudnn*.h to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.5\include

Copy to .lib\x64\cudnn*.lib to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.5\lib

Copy files into the NVIDIA cuDNN directory

(4) Set the following environment variable to point to where cuDNN is located. To access the value of the environment variable, perform the following steps:

a. Open a command prompt from the Start menu, Type and hit Enter.Run.

b. Issue the command.control sysdm.cpl.

c. Select the Advanced tab at the top of the window.

d. Click Environment Variables at the bottom of the window.

Windows env var settings

e. Add the NVIDIA cuDNN directory path to the PATH variable:

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.5\bin
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.5\include
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.5\lib
edit environmnet variable

Step 4. Verify Installation

Verify that cuDNN is installed successfully by checking for the word “pass”. If it appears, the installation was successful.

cuda bandwidth test
cuda device query