LoginSignup
23
28

More than 3 years have passed since last update.

CUDA 10とcuDNNをUbuntu 18.04LTSにインストールする

Last updated at Posted at 2019-05-03

作業概要は、NVIDIAのパッケージレポジトリの追加、NVIDIAのドライバのインストール、CUDA 10.0とcuDNNのインストール、TensorRTのインストールという流れ。

NVIDIAのパッケージレポジトリを追加

terminal
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
sudo apt-get update
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb
sudo apt install ./nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb
sudo apt-get update

NVIDIAのドライバーをインストールして再起動する

先にNVIDIAのパッケージレポジトリを追加しておくと、最新のドライバがインストールできる。

terminal
ubuntu-drivers devices  # インストールされているデバイスと利用可能なドライバの確認。
sudo ubuntu-drivers autoinstall
sudo reboot

再起動後nvidia-smiでnvidiaのドライバがインストールされているか確認。

CUDA 10.0 と cuDNNのインストール

terminal
sudo apt-get install -y --no-install-recommends cuda-10-0 libcudnn7 libcudnn7-dev

TensorRTのインストール

terminal
sudo apt-get install nvinfer-runtime-trt-repo-ubuntu1804-5.0.2-ga-cuda10.0
sudo apt-get update
sudo apt-get install -y --no-install-recommends libnvinfer-dev

参考

https://www.tensorflow.org/install/gpu
https://linuxconfig.org/how-to-install-the-nvidia-drivers-on-ubuntu-18-04-bionic-beaver-linux
CUDA 8.0とcuDNN 6をUbuntu 16.04LTSにインストールする
CUDA 9.1とcuDNN 7.1をUbuntu 16.04LTSにインストールする

23
28
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
23
28