Its not always smooth. However, few hints from the blog could help you get there quicker.
Hardware: GeForce RTX 2060 with Max-Q Design (All you need is a CUDA enabled card)
Num GPUs Available: 1
Before beginning any installations, check out the compatibility table here. The GPU. The combination that worked for me is: conda install tensorflow-gpu==2.1.0 with CUDA 10.1 toolkit & corresponding cuDNN
Sign up on Nvidia website.
Installing microsoft C++ redistributable.
CUDA toolkit (Make sure you install Visual Studio community edition prior to CUDA toolkit)
Install cuDNN .
Copy the files from bin, include & lib folders from the cuDNN folder to CUDA folder.
cudnn64_8.dll from Bin, cudnn.h from Include & cudnn.lib from lib folder are the important files that needs to be pasted to corresponding floders in C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1
Verify once that the Path points at the right location.
I recommend having a conda env with a python version specified:
conda create — name tf-gpu7 python=3.7
Install a tf version of appropriate choice :
conda install tensorflow-gpu==2.1.0
Activate the environment by: conda activate tf-gpu7
The following commands with trigger your python , you can check the version of python and tensorflow.
>>> import tensorflow as tf
>>> print(“Num GPUs Available: “, len(tf.config.experimental.list_physical_devices(‘GPU’)))
If the output is as shown in the pic above, GPU is found. It also tells you the GPU card used.
To verify Tensorflow version installed:
To check the CUDA toolkit info:
(tf-gpu7) C:\Users\piyus>conda list cudatoolkit
To know the cuDNN version:
(tf-gpu7) C:\Users\piyus>conda list cudnn
Some installations work only you restart the system.
Hope these pointers would cover all the frequently faced hurdles in getting the Tensorflow working with the underlying GPU hardware.
Source: Medium - Piyush Kulkarni
The Tech Platform