[PYTHON] Until the Deep Learning environment (TensorFlow) using GPU is prepared for Ubuntu 14.04

python related

pyenv --Installation of required packages

sudo apt-get install git gcc make openssl libssl-dev libbz2-dev libreadline-dev libsqlite3-dev

--git clone pyenv

sudo git clone git://github.com/yyuu/pyenv.git ./pyenv

--PATH setting Editing .bash_profile

cd
vim .bash_profile
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
source .bash_profile

--installable version

pyenv install --list

virtualenv

git clone https://github.com/yyuu/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv
sudo apt-get install python-vietualenv

Other required packages

sudo apt-get install python-pip, python-dev

Around GPU

NVIDIA GPU driver

Select from Site CUDA Download from Site 「Linux」-> 「x86_64」->「Ubuntu」->「14.04」->「deb[local]」

cuDNN Download from Site Check it appropriately and click "Proceed to Downloads" Check Agree and check "Download cuDNN v5 (May 27, 2016), for CUDA 8.0"-> "cuDNN v5 Library for Linux"

Installation

NVIDIA GPU driver

--Move to GUI screen with "ctrl" + "alt" + "F1" --Various settings and execution

sudo apt-get purge nvidia*
sudo service lightdm stop
sudo chmod 755 ~/download/NVIDIA-XXXX
cd download
sudo ./NVIDIA-XXXX

Finally reboot with sudo reboot etc. CUDA

sudo dpkg -i download/cuda-repo-ubuntu1404-8-0-local_8.0.44-1_amd64.deb
sudo apt-get update
sudo apt-get install cuda

cuDNN

cd download
tar xvzf cudnn-8.0-linux-x64-v5.0-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/lib64/libcudnn*

PATH

cd
vim .bashrc
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64"
export CUDA_HOME=/usr/local/cuda

Reflect

. ~/.bashrc

Or if source .bashrc is in .bash_profile

source .bash_profile

TensorFlow Check what to install with here Assuming that the environment is created by virtualenv test etc. (I didn't use it even though I put it in pyenv)

Installation * 2 GPU version

(test)pip install --upgrade https://www.tensorflow.org/versions/r0.11/get_started/os_setup.html

Operation check

(test)f@f:~$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcurand.so locally
>>> sess=tf.Session()
I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:925] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
I tensorflow/core/common_runtime/gpu/gpu_device.cc:951] Found device 0 with properties: 
name: GeForce GTX 960
major: 5 minor: 2 memoryClockRate (GHz) 1.1775
pciBusID 0000:01:00.0
Total memory: 3.94GiB
Free memory: 3.16GiB
I tensorflow/core/common_runtime/gpu/gpu_device.cc:972] DMA: 0 
I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] 0:   Y 
I tensorflow/core/common_runtime/gpu/gpu_device.cc:1041] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 960, pci bus id: 0000:01:00.0)

Reference: Ubuntu14.04 + GPU + TensorFlow environment construction

I will add jupyter and so on.

Recommended Posts

Until the Deep Learning environment (TensorFlow) using GPU is prepared for Ubuntu 14.04
A scene where GPU is useful for deep learning?
Ubuntu14.04 + GPU + TensorFlow environment construction
[Is it explosive !?] Setup for using the GPU version of Tensorflow on OS X
Dealing with tensorflow suddenly stopped working using GPU in deep learning
Stock price forecast using deep learning (TensorFlow)
Stock Price Forecast Using Deep Learning (TensorFlow) -Part 2-
Notes for using TensorFlow on Bash on Ubuntu on Windows
The problem that the system restarts without permission while learning using GPU in TensorFlow
How to install the deep learning framework Tensorflow 1.0 in the Anaconda environment of Windows
Techniques for understanding the basis of deep learning decisions
Memo for building a machine learning environment using Python
Enable GPU for tensorflow
I built an environment for machine learning from scratch (windows10 + Anaconda + VSCode + Tensorflow + GPU version)
Introduction to Deep Learning for the first time (Chainer) Japanese character recognition Chapter 1 [Environment construction]
Build an environment for machine learning using Python on MacOSX
Create an environment for "Deep Learning from scratch" with Docker
(Now) Build a GPU Deep Learning environment with GeForce GTX 960
I tried hosting a TensorFlow deep learning model using TensorFlow Serving
Set up AWS (Ubuntu 14.04) for Deep Learning (install CUDA, cuDNN)
Until building a Python development environment using pyenv on Ubuntu 20.04
[For beginners] I tried using the Tensorflow Object Detection API
real-time-Personal-estimation (learning using GPU locally)
Try deep learning with TensorFlow
Deep Learning Gaiden ~ GPU Programming ~
Deep learning for compound formation?
What is the interface for ...
Solve the problem of missing libcudart in Ubuntu 16.04 + CUDA 8.0 + Tensorflow environment
Build Python environment on Ubuntu (when pip is not the default)
[Anomaly detection] Try using the latest method of deep distance learning
Using TensorFlow in the cloud integrated development environment Cloud9 ~ Basics of usage ~
Summary of pages useful for studying the deep learning framework Chainer