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.
Install CUDA Toolkit 8.0
The official documents are very detailed but have too many details. To sum them up, 3 main steps are involved.
Step1: Pre-installation actions
This is just a pre-check to see whether your computer can install CUDA.
Verify You Have a CUDA-Capable GPU
|
|
If it returns nothing, we can give up installing it.
Check you have gcc installed
This is for compilation.
|
|
Remember your architecture
x86_64 or others.
|
|
Step2: Download .deb file and install
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.
|
|
Step3: Post-installing
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
nvidia-smi
Run some samples in
/usr/local/cuda-8.0/samples
to check CUDA.
Install cudnn v6.0
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 /usr/local/cuda
directory.
|
|
Install tensorflow-gpu 1.4.0
This the last step before we can use tensorflow.
You may need
$ sudo apt-get install libcupti-dev
to install this NVIDIA CUDA Profile Tools Interface.Use
pip3 install tensorflow-gpu
to install the tensorflow gpu version.
Check with examples
Finally, we can try following codes:
|
|