My computuer specifications
- ubuntu 14.04
- 64bit CPU (Intel i7)
- GPU (NVIDIA gtx960)
- python3.4
- cuda toolkit 8.0
- cudnn 5.1
- pip installation method
- gpu enabled version of Tensorflow
Tensorflow download and setup official website
https://www.tensorflow.org/versions/r0.11/get_started/os_setup.html
1) Cuda installation (GPU use only)
https://www.tensorflow.org/versions/r0.11/get_started/os_setup.html#optional-install-cuda-gpus-on-linux
- To install cuda, we need to turn off x service.
ctrl + alt + f1 (Swtich to a console mode)
$ sudo stop lightdm (x service off and no loger GUI use)
$ sudo lightdm (will turn on the GUI use again)
- If the console mode is just a blank screen, refer following link. (matter of monitor resolution)
http://askubuntu.com/questions/162535/why-does-switching-to-the-tty-give-me-a-blank-screen
$ sudo sed -i -e 's/#GRUB_TERMINAL/GRUB_TERMINAL/g' /etc/default/grub
$ sudo update-grub
$ sudo reboot
- If the GUI appear not properly after reboot, just switch screen ctrl + alt + f1 and turn back (ctrl + alt + f7).
- cuda toolkit 8.0
https://developer.nvidia.com/cuda-downloads
(the link takes us to the website for the newest version of cuda)
linux, x86_64, ubuntu, 14.04, dev(local)
Move to the folder where the file is downloaded.
$ sudo dpkg -i cuda-repo-ubuntu1404-8-0-local_8.0.44-1_amd64.deb
$ sudo apt-get update
$ sudo apt-get install cuda
This autometically creates a folder e.g. /usr/local/cuda-8.0/
and also creates /usr/local/cuda/ which directs above folder so that we can also consider the cuda toolkit is installed in /usr/local/cuda/ as well.
- cudnn 5.1
https://developer.nvidia.com/cudnn
To download files, registration is needed.
Download cuDNN v5.1, for CUDA 8.0, cuDNN v5.1 Library for Linux
Move to the folder where the file is downloaded.
$ tar xvzf cudnn-8.0-linux-x64-v5.1-ga.tgz
$ sudo cp cuda/include/cudnn.h /usr/local/cuda/include
$ sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
$ sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
2) Tensorflow Installation
I followed 'pip install'
https://www.tensorflow.org/versions/r0.11/get_started/os_setup.html#pip-installation
pip preparation
$ sudo apt-get install python3-pip python3-dev (for python 3.4)
# Ubuntu/Linux 64-bit, GPU enabled, Python 3.4
# Requires CUDA toolkit 8.0 and CuDNN v5. For other versions, see "Install from sources" below.
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.11.0rc2-cp34-cp34m-linux_x86_64.whl
$ sudo pip3 install --upgrade $TF_BINARY_URL
- to update
first, delete previous tensorflow
$ sudo pip3 uninstall tensorflow
and follow the installation flow again.
3) Installation Test
https://www.tensorflow.org/versions/r0.11/get_started/os_setup.html#test-the-tensorflow-installation
Before running python3
$ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64"
$ export CUDA_HOME=/usr/local/cuda
- if "Couldn't open CUDA library libcudnn.so. LD_LIBRARY_PATH" error appears, check the version of cuda toolkit and cudnn; and make sure that the version of tensorflow installed is correct.
etc.) Tensorflow study materials
한국말로 설명된 설치법 (아나콘다 환경 등등을 고려한 설치)
http://yeramee.tistory.com/1
Basic of tensorflow
http://learningtensorflow.com/
한글자료
https://gist.github.com/haje01/202ac276bace4b25dd3f
최성준님의 강의자료
https://github.com/sjchoi86/Tensorflow-101