TensorFlow is an open source library that helps you to build machine learning and deep learning models. It is widely utilized library among researchers and organizations to smart applications. I personally use TensorFlow and Keras (build on top of TensorFlow and offers ease in development) to develop deep learning models. You can follow my research work here.
Every model you develop in deep learning require good performance GPU enabled environment. And to run the models on GPU we need CUDA and cuDNN drivers installed in our system.
As of today, there are a lot of versions available for TensorFlow, CUDA and cuDNN, which might confuse the developers or the beginners to select right compatible combination to make their development environment.
The following table lists the compatible versions of CUDA, cuDNN with TensorFlow. This list is developed with reference to build configurations shared here.
|2.4.0||3.6 - 3.8||11.0||8.0|
|2.3.0||3.5 - 3.8||10.1||7.6|
|2.2.0||3.5 - 3.8||10.1||7.6|
|2.1.0||3.5 - 3.7||10.1||7.6|
|2.0.0||3.5 - 3.7||10.0||7.4|
|1.15.0||3.5 - 3.7||10.0||7.4|
|1.14.0||3.5 - 3.7||10.0||7.4|
|1.13.0||3.5 - 3.7||10.0||7.4|
|1.12.0||3.5 - 3.6||9.0||7.2|
In my development environment with NVIDIA RTX 2070 GPU I have following multiple configurations in my system. Different tensorflow-gpu versions can be installed by creating different anaconda environments (I prefer to use miniconda that offers minimal installed packages). And you can follow normal installation process for installing different version of CUDA and cuDNN together.
Note: You may also need to check the GPU compatibility before selecting the CUDA version. You can check that here.
Check Installed Version
After you finished the installation, you verify the tensorflow-gpu library as follows:
These above commands should list your available GPU devices.
PS: In case you are getting an error like unable load cuDNN dynamic library it means that you have installed incorrect version of cuDNN with CUDA.
To check the installed version of CUDA and cuDNN proceed as follows:
- You can open “NVIDIA GPU Computing Toolkit\CUDA\vX.X\version.txt” to check the CUDA version.
- You can open “NVIDIA GPU Computing Toolkit\CUDA\vX.X\include\cudnn.h” and search for “#define CUDNN_VERSION” to check cuDNN version inside CUDA. (Note: In cuDNN 8.0, the version details are moved to cudnn_version.h)