Installing CUDA and cuDNN on windows 10
This is an how-to guide for someone who is trying to figure our, how to install CUDA and cuDNN on windows to be used with tensorflow.
It should be noted that at the time of writing this, tensor flow is supporting only upto CUDA version 9.0 and corresponding cuDNN libraries so please don’t download CUDA 9.2.
Installing CUDA 9.0 on windows.
Pre requisites :
Please note if your connection permits, please download the
local version. That saves you from sitting around waiting for download to finish at the installation time.
The download should be ~ 1.4 G. Once the download finishes, launch the installer and follow the defaults. It takes around 10–15 mins for installation to finish. Pleasy verify the files at the default install location after the installation finishes:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0
Installing cuDNN from NVIDIA
First of all, register yourself at NVIDIA Developer site. Its an free registration and takes only a couple of mins. From there, the installation is a breeze Once registered, goto the download page and accept the terms and conditions. POst this download cuDNN v7.1.4 for CUDA 9.0
Once the files are downloaded locally, unzip them. Installing cuDNN is pretty straight forward. You just have to copy three files from the unzipped directory to CUDA 9.0 install location. For reference, NVIDIA team has put them in their own directory. So all you have to do is to copy file from :
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib
Testing it with tensor flow
pip3 install tensorflow-gpu. Once that is done, fire up a python console do a
from tensorflow import *. If you don't see any errors, we are good.
Another way you know that your GPU is being used by executing a keras model and having it use tensorflow as its backend. So at the runtime, you should see a message like this :
I am a Devops Expert and Machine Learning enthusiast. Please find my original blog post at An Average Joe