Recently I found that the workstation in my office had a NVIDIA GPU. It is Quodra K620 with 2G memory, so I decided to make it in good use. Here is a note for how to install tensorflow 1.4.0 for ubuntu 16.04 LTS. For tensorflow 1.4.0, I find that CUDA 8.0 and cudnn v6.0 is the most recommended combination.
I maily follow the documents on official Tensorflow website and some NVIDIA documents.
The official documents are very detailed but have too many details. To sum them up, 3 main steps are involved.
This is just a pre-check to see whether your computer can install CUDA.
If it returns nothing, we can give up installing it.
This is for compilation.
x86_64 or others.
First I choose a proper .deb to download [here].(https://developer.nvidia.com/cuda-80-ga2-download-archive)
Next, we enter the following 3 commands in terminal.
Last, change environment variables: add these 2 lines to .bashrc or .zshrc.
After this, we should check 2 things:
If the driver is properly installed by
Run some samples in
/usr/local/cuda-8.0/samplesto check CUDA.
The cudnn is the nvidia’s deep learning library. You can find cudnn v6.0 here and download
cuDNN v6.0 Library for Linux.
Then unpack and copy some files to
This the last step before we can use tensorflow.
You may need
$ sudo apt-get install libcupti-devto install this NVIDIA CUDA Profile Tools Interface.
pip3 install tensorflow-gputo install the tensorflow gpu version.
Finally, we can try following codes: