Common problems and solutions of TensorFlow GPU installation
When i first started using Tensorflow GPU setup, I often encounter problems. I have installed it several times and often encounter the same or similar problems. So I plan to record it and hope it can help others…
Inconsistent Libraries
Initially i used to install the TensorFlow with the improper versions of CUDA & Cudnn often leads me to several problems, even a slight mismatch in versions of libraries and binaries are a trouble some process to fix so i recommend everyone to follow the above chart and install the right versions on your machine.
Microsoft Visual C + + 2015 redistributable update 3 is not installed
In order for the Tensorflow modules to work perfectly it needs run-time components of Visual C++ libraries. So download and install the below libraries in case u face issues.
https://www.microsoft.com/en-us/download/details.aspx?id=52685
Updating Environment Path to Windows (Set your PATH)
After installation of CUDA and Cudnn libraries don’t forget to add its path to ensure that TensorFlow can find CUDA, you should go to the system environment and add them as mentioned below.
export PATH="/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.0/bin:$PATH"
export PATH="/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.0/extras/CUPTI/libx64:$PATH"
export PATH="/c/tools/cuda/bin:$PATH"
Cudart64 dll Error
When running the tensorflow code, initially we get an error cudart64 which prevents GPU execution. I recommend you to extract the DDL script from zip and paste it to,
C:\Windows\System32
https://drive.google.com/file/d/10kKz9YRRmTtMj4vZHTt8fNrrrbgD2ooU/view
Test Tensorflow GPU installation
To verify successful installation of tensorflow, try running this in your machine and hope fully it completes without any errors.
import tensorflow as tf
#Device Name
print('Device Name: '+tf.test.gpu_device_name())
# Version-check
print('Version: '+tf.__version__)
#CUDA Support
print('CUDA Support: '+str(tf.test.is_built_with_cuda()))
Subscribe to my newsletter
Read articles from Divakar directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Divakar
Divakar
Hey there! I’m Divakar. I am a software engineer at Infosys with experience in Cloud, Automation and Backend projects. My focus lies in the intersection of maximizing developer productivity and enhancing business values. I'm very passionate about large scale distributed systems and is a vivid fan of Python. I love anything related to technology used in films, and like to constantly engage on community activities.