Installing CUDA and cuDNN on Windows

Ankit Kumar Singh
Analytics Vidhya
Published in
3 min readOct 4, 2020

Libraries like Tensorflow and OpenCV are optimized for working with GPU. For these libraries to communicate with GPU we install CUDA and cuDNN, provided GPU is CUDA compatible. There are different versions of CUDA depending upon the architecture and model of GPU.
So, during the installation of CUDA, we need to first find its suitable version which is compatible with our machine’s GPU.

Finding suitable versions

Steps for installation

1. Uninstall all CUDA installations

Goto installed programs and search for all installations where CUDA is written. If their versions do not match your requirements the uninstall all of them.

2. Install visual studio community edition 19 for nsight

Goto this link and download the latest community edition visual studio: https://visualstudio.microsoft.com/downloads/
Install all by defaults and check c++ tab on:-

3. Download and install CUDA toolkit

Download and Follow all default Procedure and after installation check for environment variables

4. Login and download cuDNN

For Downloading cuDNN we need to register our account on the NVIDIA website: https://developer.nvidia.com/rdp/cudnn-archive.
Download and extract the version which corresponds to your suitable Cuda version and satisfies Tensorflow requirements.
In my case, it is 7.6.5 for 10.1 CUDA.

5. Installing cuDNN

  • Find CUDA installation folder, In my case: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\
  • Open folder v10.1 side by side with the later downloaded cuDNN folder.
  • We just need to copy respective files from cuDNN to CUDA installation folder. From bin to bin, include to include, lib/x64 to lib/x64. Just Drag and drop the files inside of cudnn folder to respective folders of CUDA
  • And our cuDNN is also installed now

the installation is now finished.

Confirming our installation

Assuming you’ve already installed Python and TensorFlow, Now we will test if GPU is getting accessed by Tensorflow through python on command prompt.

Congratulations, We now have access to our GPU, lets warm it up!!!

Conclusion

The installation of CUDA and cuDNN is pretty straightforward but checking the suitable version for our GPU and Tensorflow is the main task. Yet another problem is of “path”, we need to check if during the installation the path is set correctly in system environment variables. If these things are considered then we are good to go.

--

--