Installation of Nvidia Cuda Toolkit and CuDNN library

Hi, everyone. I am trying to install Nvidia Cuda Toolkit and CuDNN library in my laptop (OS-windows 10).
I am facing version compatibility problem while installing the above two.
Can anyone please suggest what will be the correct versions of -
Python, Anaconda, Tensorflow, Cuda Toolkit, CuDNN library
to run deeplearning algos in my system.

1 Like

I’ve been able to install Cuda and CUDNN on Windows to use for tensorflow with Rstudio and jupyter/python for the first half of the fast AI first-course years ago (when the first classifier was still dogs vs cats and not dog breeds), but in the end it was not worth the time. I will work on re-installing CUDA/CUDNN on my Windows laptop to see if I can get a better answer for you in 2020 for Windows (this will be provided at later a later date)

Tensorflow.js runs WebGL for GPU acceleration on Nvidia/AMD/Intel , and probably any ARM processors that allocate enough memory to the GPU (currently my raspberry PI 4 4GB is not compatible with the basic MNIST demo). There is a future of even better acceleration backends to be implemented later by Tensorflow.js.

  • if not wanting to start with javascript, next consider the following suggested procedure instead for Linux on your own hardware:
  1. be in a situation where you are ok installing an ubuntu flavor as your main OS on your laptop, or just have two laptops, or be able to partition your laptop to run an Ubuntu flavor

  2. download 20.04 LTS with the proprietary NVIDIA driver preinstalled (this is an Ubuntu flavor)

  3. setup (this actually supports a number of linux distributions, not just Ubuntu based)

  4. setup a tensorflow-docker image (the latest docker image for TF2.2 as of this posting is still running 18.04 inside, this is fine as the tensorflow-docker image contains CUDA as well as CUDNN in a configuration that is known to work (image generated by Google) )

docker pull tensorflow/tensorflow:latest-gpu-jupyter
  1. understand how to be sure docker is opening a port on your host machine to connect to jupyter, and how to use docker commands to directly use bash in your docker image, among other docker commands; this is probably the most difficult step

5.1) Also you may need to specify a GPU number as well as ipc=host to use a GPU

docker run --gpus 1 -it --ipc="host" --rm someidentifier/someimagename
  1. remember to set
    TF_FORCE_GPU_ALLOW_GROWTH to true inside the docker container as an environment variable (sounds confusing but last I checked this is needed for Windows as well).

Maintaining tensorflow and Cuda/CUDNN on any installation is a problem there are plenty of people working on innovative ideas to address the problem, for example tensorman is an attempt to make docker images easier to use.

As much I like system76 and their tensorman effort, their linux distribution is probably more valuable in that they provide a version that installs nvidia drivers right out of the box. I’m sure someone smarter than me can find a way to integrate tensorman into regular tutorial workflows, but I’ve not found it very convenient.

  • There are other options that do not require a powerful GPU or even tensorflow.

Pytorch is MKL enabled, as well is this GluonCV by Apache mxnet

pip install --upgrade mxnet-mkl gluoncv

MKL-enabled GluonCV is markedly faster on my CPU (AMD R5 3600) than the version without MKL.

for Windows: these versions are the compatible versions of cudatoolkit, cudnn, and tensorflow installed through conda 2020-JUN24 (there are many other packages omitted (***) )

Name Version Build

cudatoolkit 10.1.243 h74a9793_0
cudnn 7.6.5 cuda10.1_0

tensorboard 2.2.1 pyh532a8cf_0
tensorboard-plugin-wit 1.6.0 py_0
tensorflow 2.1.0 gpu_py37h7db9008_0
tensorflow-base 2.1.0 gpu_py37h55f5790_0
tensorflow-estimator 2.1.0 pyhd54b08b_0
tensorflow-gpu 2.1.0 h0d30ee6_0

Assuming basic familiarity with powershell and anaconda, following commands were applied to install these packages

conda update -n base -c defaults conda
conda create -n envirName
conda activate envirName
conda install tensorflow-gpu

To verify functionality, grab this notebook

copy to the current directory and run in jupyter (installed through anaconda-navigator) to see that CUDA/CUDNN are working. Append to the end of the notebook additional code to see how tensorflow will report on versions of CUDA/CUDNN (not necessarily the same number of significant digits in the version number).

from tensorflow.python.platform import build_info as tf_build_info




additionally stackoverflow link below has links to TF documentation on what the tested-build combinations are:

Anaconda Individual Python 3.7
64-Bit Graphical Installer (466 MB)

Windows specifications
Edition Windows 10 Home
Version 2004

SYSTEM RAM 16.0 GB 3200Mhz DDR4