78
77

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

UbuntuにNvidia GPUのDriver + CUDAをInstallする(GTX1080対応版)

Last updated at Posted at 2016-08-09

2016/08/10時点で、GTX1080のドライバーインストールは中々大変だったのでメモ。

1. 事前準備

既にドライバーがインストールされていないかチェックする

dpkg -l | grep nvidia
dpkg -l | grep cuda

2. 古いドライバーの削除(Optional)

もし 1.で古いドライバーがインストールされていたら下記コマンドにて削除

# remove previous cuda and graphic driver
sudo apt-get --purge remove nvidia-*
sudo apt-get --purge remove cuda-*

3. リポジトリの登録

Ubuntuのドライバーを提供しているリポジトリを登録
(https://launchpad.net/~graphics-drivers/+archive/ubuntu/ppa)

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update

4. ドライバーのインストール

sudo apt-get install nvidia-367

5. 再起動

sudo reboot

6. 確認

下記コマンドにてGPUが認識されているかを確認する

nvidia-smi

以下の様に接続しているGPUが確認されればOK

Wed Aug 10 00:17:55 2016
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 367.35                 Driver Version: 367.35                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 1080    Off  | 0000:03:00.0     Off |                  N/A |
|  0%   40C    P0    48W / 230W |      0MiB /  8113MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   1  GeForce GTX 1080    Off  | 0000:04:00.0     Off |                  N/A |
|  0%   42C    P0    47W / 230W |      0MiB /  8112MiB |      1%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID  Type  Process name                               Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

7. cudaのインストール

CUDA Toolkit 8.0(RC版, 2016/08/10時点)を下記URLからダウンロード
https://developer.nvidia.com/cuda-release-candidate-download

Webのマニュアルにしたがってインストール

sudo dpkg -i cuda-repo-ubuntu1404-8-0-rc_8.0.27-1_amd64.deb
sudo apt-get update
sudo apt-get install cuda

*これを行うとドライバーのバージョンが、nvidia-361にダウングレードしてしまうため、もう一度最新ドライバーをインストール(正しいのかは不明。。。)
*ちなみに現時点でnvidia-361だとGTX1080は認識されなかった(対応していると書いてあるが。。。)

sudo apt-get install nvidia-367

8. 再度確認

  1. と同様の出力であればOK

インストールされているのは下記のパッケージ
(361と367が混在して気持ち悪い。。。)

ubuntu@dev-004:~$ dpkg -l | grep nvidia
rc  nvidia-361                                361.77-0ubuntu1                                     amd64        NVIDIA binary driver - version 361.77
ii  nvidia-367                                367.35-0ubuntu0~gpu14.04.1                          amd64        NVIDIA binary driver - version 367.35
ii  nvidia-modprobe                           361.77-0ubuntu1                                     amd64        Load the NVIDIA kernel driver and create device files
rc  nvidia-opencl-icd-361                     361.77-0ubuntu1                                     amd64        NVIDIA OpenCL ICD
ii  nvidia-opencl-icd-367                     367.35-0ubuntu0~gpu14.04.1                          amd64        NVIDIA OpenCL ICD
ii  nvidia-prime                              0.6.2                                               amd64        Tools to enable NVIDIA's Prime
ii  nvidia-settings                           367.35-0ubuntu0~gpu14.04.1                          amd64        Tool for configuring the NVIDIA graphics driver
ubuntu@dev-004:~$ dpkg -l | grep cuda
ii  cuda-command-line-tools-8-0               8.0.27-1                                            amd64        CUDA command-line tools
ii  cuda-core-8-0                             8.0.27-1                                            amd64        CUDA core tools
ii  cuda-cublas-8-0                           8.0.27-1                                            amd64        CUBLAS native runtime libraries
ii  cuda-cublas-dev-8-0                       8.0.27-1                                            amd64        CUBLAS native dev links, headers
ii  cuda-cudart-8-0                           8.0.27-1                                            amd64        CUDA Runtime native Libraries
ii  cuda-cudart-dev-8-0                       8.0.27-1                                            amd64        CUDA Runtime native dev links, headers
ii  cuda-cufft-8-0                            8.0.27-1                                            amd64        CUFFT native runtime libraries
ii  cuda-cufft-dev-8-0                        8.0.27-1                                            amd64        CUFFT native dev links, headers
ii  cuda-curand-8-0                           8.0.27-1                                            amd64        CURAND native runtime libraries
ii  cuda-curand-dev-8-0                       8.0.27-1                                            amd64        CURAND native dev links, headers
ii  cuda-cusolver-8-0                         8.0.27-1                                            amd64        CUDA solver native runtime libraries
ii  cuda-cusolver-dev-8-0                     8.0.27-1                                            amd64        CUDA solver native dev links, headers
ii  cuda-cusparse-8-0                         8.0.27-1                                            amd64        CUSPARSE native runtime libraries
ii  cuda-cusparse-dev-8-0                     8.0.27-1                                            amd64        CUSPARSE native dev links, headers
ii  cuda-documentation-8-0                    8.0.27-1                                            amd64        CUDA documentation
ii  cuda-driver-dev-8-0                       8.0.27-1                                            amd64        CUDA Driver native dev stub library
ii  cuda-license-8-0                          8.0.27-1                                            amd64        CUDA licenses
ii  cuda-misc-headers-8-0                     8.0.27-1                                            amd64        CUDA miscellaneous headers
ii  cuda-npp-8-0                              8.0.27-1                                            amd64        NPP native runtime libraries
ii  cuda-npp-dev-8-0                          8.0.27-1                                            amd64        NPP native dev links, headers
ii  cuda-nvgraph-8-0                          8.0.27-1                                            amd64        NVGRAPH native runtime libraries
ii  cuda-nvgraph-dev-8-0                      8.0.27-1                                            amd64        NVGRAPH native dev links, headers
ii  cuda-nvml-dev-8-0                         8.0.27-1                                            amd64        NVML native dev links, headers
ii  cuda-nvrtc-8-0                            8.0.27-1                                            amd64        NVRTC native runtime libraries
ii  cuda-nvrtc-dev-8-0                        8.0.27-1                                            amd64        NVRTC native dev links, headers
ii  cuda-repo-ubuntu1404-8-0-rc               8.0.27-1                                            amd64        cuda repository configuration files
ii  cuda-samples-8-0                          8.0.27-1                                            amd64        CUDA example applications
ii  cuda-toolkit-8-0                          8.0.27-1                                            amd64        CUDA Toolkit 8.0 meta-package
ii  cuda-visual-tools-8-0                     8.0.27-1                                            amd64        CUDA visual tools
rc  libcuda1-361                              361.77-0ubuntu1                                     amd64        NVIDIA CUDA runtime library
ii  libcuda1-367                              367.35-0ubuntu0~gpu14.04.1                          amd64        NVIDIA CUDA runtime library

早くCUDA 8.0の正式版を出して欲しい

78
77
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
78
77

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?