Ubuntu 18.04 Cuda 9.0 , Cudnn, tensorflow-gpu, driver install

Ubuntu 18.04 Cuda 9.0 , Cudnn, tensorflow-gpu, driver install

Ubuntu 18.04 Cuda 9.0 , Cudnn, tensorflow-gpu, driver install

This post is for ubuntu 18.04.
If you are using ubuntu 16.04 go to here.

This is working combination of using tensorflow.

  • tensorflow-gpu == v1.12.0
  • cuda == v9.0
  • cudnn== v7.3
  • nvidia-driver == v396

Install nvidia-driver-396

# install nvidia driver 396

sudo apt install nvidia-kernel-source-396
sudo apt install nvidia-driver-396

Reboot the computer.

Install cuda 9.0

In Unbuntu 18.04 version nvidia does not support download in hompage. So we will use gcc6.

sudo apt install gcc-6
sudo apt install g++-6
  • we will download cuda
cd 
wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run

# we will extract it to $HOME directory
cd
chmod +x cuda_9.0.176_384.81_linux-run
./cuda_9.0.176_384.81_linux-run --extract=$HOME 
sudo sh cuda-linux.9.0.176-22781540.run
  • remove file
rm cuda-linux.9.0.176-22781540.run
rm cuda-samples.9.0.176-22781540-linux.run
rm cuda_9.0.176_384.81_linux-run
sudo ln -s /usr/bin/gcc-6 /usr/local/cuda/bin/gcc
sudo ln -s /usr/bin/g++-6 /usr/local/cuda/bin/g++

install cuddn 7.3

https://developer.nvidia.com/cudnn
Imgur

  1. click download cuDNN button, there will be button named like “archived versions” click it.

Imgur

  1. Download v7.3.0 for CUDA 9.0. You have to be careful not to choose CUDA for 10.0 or 9.2 version.
tar xvfz cudnn-9.0-linux-x64-v7.1.tgz

sudo cp -P cuda/include/cudnn.h /usr/local/cuda/include
sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*

install tensorflow-gpu

It is safe to download v1.12.0 to avoid conflict with cuda, cudnn.

pip install tensorflow-gpu==1.12.0

댓글

이 블로그의 인기 게시물

[Linux, Unix] export, echo 명령어 알아보기

IEEE 754 부동 소수점 반올림과 근사