우분투(Ununtu)에서 텐서플로우(TensorFlow) GPU 설치(install) 방법

Environment

Date: 2018.06.15
OS: Ubuntu 18.04
Graphic Card: NVIDIA Geforce 1070
TensorFlow version: 1.80

Graphics Driver

# add-apt-repository ppa:graphics-drivers/ppa
# apt update
# apt install nvidia-390
# nvidia-smi

CUDA 9.0


# dpkg -i cuda-repo-ubuntu1704-9-0-local_9.0.176-1_amd64.deb
# apt-key add /var/cuda-repo-9-0-local/7fa2af80.pub
# apt-get install cuda

CUDA 9.0 Patch

1. Click the “Download” button.
2. Open with “Software Install (default)”.
3. Click the “Install” button.

Environment Variables

Add the following environment variables at ~/.bashrc.
export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$PATH

cuDNN

Download: cudnn-9.0-linux-x64-v7.tgz @ https://developer.nvidia.com/rdp/cudnn-archive
(You need to log in the site.)
# tar xvfz cudnn-9.0-linux-x64-v7.tgz
# cp cuda/include/* /usr/local/cuda/include
# cp -d cuda/lib/* /usr/local/cuda/lib64
# chmod a+r /usr/local/cuda/include/cudnn.h
# chmod a+r /usr/local/cuda/lib64/libcudnn*

TensorFlow GPU

For Python 2.x
# pip install tensorflow-gpu
For Python 3.x
# pip3 install tensorflow-gpu

Reference) https://www.youtube.com/watch?v=vxjbL5iN1XY

Add a Comment