Ubuntu | 16.0.4 |
---|---|
GPU | GTX 1080 ti |
Driver | 390.30 |
Cuda | 9.0 |
Cudnn | 7.0.4 |
Requirements for Tensorflow (official): https://www.tensorflow.org/install/gpu
install cuda v9.0
Do pre-installation actions first.
Install cuda using apt-get (easist way)
1 | sudo dpkg -i cuda-repo-ubuntu1604_9.0.176-1_amd64.deb |
You can install driver 390 with
1 | sudo apt-get install -y nvidia-390 |
To uninstall cuda,
1 | sudo apt-get --purge remove cuda |
Check cuda version (if you have installed cuda toolkit, it’ll show the toolkit version)
1 | nvvc --version |
Check if there’s a symbolic /usr/local/cuda
to /usr/local/cuda-9.0
, or you can link by
1 | ln -s -T /usr/local/cuda |
install cudnn v7.0.4
Download cudnn here, and refer to cudnn install guide before installation.
The easiest way is to install from a tar file
1 | tar -xzvf cudnn-9.0-linux-x64-v7.tgz |
Check cudnn version
1 | cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2 |
If you get error like ImportError: libcudart.so.7.0: cannot open shared object file: No such file or directory
when you run TensorFlow, just export the environment value
1 | export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH |
install libcupti-dev library
Taken from tensorflow install guide
The libcupti-dev library, which is the NVIDIA CUDA Profile Tools Interface. This library provides advanced profiling support. To install this library, issue the following command for CUDA Toolkit >= 8.0:
1 | $ sudo apt-get install cuda-command-line-tools |
and add its path to your LD_LIBRARY_PATH
environment variable:
1 | $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/extras/CUPTI/lib64 |
For CUDA Toolkit <= 7.5 do:
1 | $ sudo apt-get install libcupti-dev |
install tensorflow
1 | for python3.x and gpu version |