To harness the GPU power, NVIDIA develops and provides CUDA toolkit that can be used as the development environment and libraries for GPU-accelerated applications. If you are using Ubuntu 16.04 (Xenial) and want to install the recent release of CUDA toolkit (version 9.1), this post may help.
As per TensorFlow documentation, following are the prerequisites to install TensorFlow with GPU support.
In the previous post we tried various methods to find out if the GPU is from NVIDIA or not. In this post we will install NVIDIA CUDA on Linux.
There few pre-installation steps to take care of. Here are some of the important ones
GCC
One of them is to ensure where GCC is installed or not. We can confirm it by executing the following command.
Since I am using Ubuntu, GCC comes pre-installed and here is the output that I got.
build essentials
It is important have the build-essential package installed. This is usually pre-installed on Ubuntu, however if it is not you can install it by executing the following command.
On my laptop it was already installed hence I got the following output.
Download CUDA package from NVIDIA website
Navigate to https://developer.nvidia.com/cuda-downloads and download the appropriate package.
Once the page is successfully downloaded, we need to install the package. First navigate to the folder where the package is located. In my case it is under ~/Downloads/CUDA$ folder. Then issue the following command which installs the package.