ubuntu 16.04 :: cuda 9.0 설치하기

Ubuntu 16.04 Cuda 9.0 Install, Cudnn, tensorflow-gpu, nvidia-driver

Ubuntu 16.04 Cuda 9.0 Install, Cudnn, tensorflow-gpu, nvidia-driver

There is a issue on compatibility with tensorflow-gpu, cuda, cudnn and nvidia-driver.
In this post I would like to introduce quite latest combination of these things.
This post is for ubuntu 16.04.
If you are using ubuntu 18.04 go tohere

Install nvidia-driver-396

# nvidia driver 396 

sudo apt install nvidia-kernel-source-396
sudo apt install nvidia-driver-396
Reboot the computer.

install tensorflow-gpu

pip install tensorflow-gpu==1.12

install cuda 9.0

Execute this command.
sudo apt-get install cuda-9-0
Go to the nvidia, and click the button like that image. You have to sign in to download it.
https://developer.nvidia.com/cuda-90-download-archive?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=deblocal
Imgur
Imgur
  1. Install base installer and all patches. (There were four patches at 19.03.06)
  2. When the download is completed execute next commands.
sudo dpkg -i cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64.deb 
sudo apt-key add /var/cuda-repo-9-0-local/7fa2af80.pub 
sudo apt-get update
sudo apt-get install cuda  
  1. execute more commands for patches.
sudo dpkg -i cuda-repo-ubuntu1604-9-0-local-cublas-performance-update_1.0-1_amd64.deb 
sudo apt-get update 
sudo apt-get upgrade cuda-9-0 

sudo dpkg -i cuda-repo-ubuntu1604-9-0-local-cublas-performance-update-2_1.0-1_amd64.deb 
sudo apt-get update 
sudo apt-get upgrade cuda-9-0 

sudo dpkg -i cuda-repo-ubuntu1604-9-0-local-cublas-performance-update-3_1.0-1_amd64.deb 
sudo apt-get update 
sudo apt-get upgrade cuda-9-0  

sudo dpkg -i cuda-repo-ubuntu1604-9-0-176-local-patch-4_1.0-1_amd64.deb
sudo apt-get update
sudo apt-get upgrade cuda-9-0  

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*

댓글

이 블로그의 인기 게시물

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

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