Ubuntu 18.04 + NVIDIA Driver 418 + CUDA 10.0 + cuDNN 7.6

Hardware / System Environments:

  • NVIDIA GeForce RTX 2080 Ti
  • Ubuntu 18.04
  • NVIDIA Driver 418
  • CUDA Toolkit 10.0
  • CuDNN 7.6

Step 1: Installation Type






Step 2: Manual Partitioning

This table shows the required sizes of each partition in my case.

Partition Size (MB) Primary / Logical
/ 25600 Primary
/boot 1024 MB Primary
/var 12288 MB Logical
/tmp 15360 MB Logical
swap space 4096 MB Logical / swap area
EFI 256 MB Logical / EFI System Partition
/home Use the rest of free space Logical

After installation completed and system rebooted...

Step 3: Upgrade system

The first time you log in the system, it will pop-up a window for upgrading system. We need to upgrade it. Click "Install Now"

After upgraded, reboot the system. We do another upgrade.
$ sudo apt-get update
$ sudo apt-get upgrade

Step 4: Add NVIDIA package repositories


$ 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

Step 5: Install NVIDIA driver

We install NVIDIA driver 418 in this case. If you've already installed NVIDIA driver, you have to remove it first.
$ sudo apt-get purge nvidia*

Then type these commands:
$ sudo add-apt-repository ppa:graphics-drivers/ppa
$ sudo apt-get update
$ sudo apt-get install nvidia-driver-418

After you installed it, reboot system again and type this command to make sure driver is working.
$ nvidia-smi
Mon Jul 22 19:50:22 2019       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 418.67       Driver Version: 418.67       CUDA Version: 10.1     |
|-------------------------------+----------------------+----------------------+
| 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 RTX 208...  On   | 00000000:42:00.0  On |                  N/A |
| 43%   43C    P8    49W / 300W |    377MiB / 10986MiB |     33%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1331      G   /usr/lib/xorg/Xorg                            18MiB |
|    0      1368      G   /usr/bin/gnome-shell                          58MiB |
|    0      1678      G   /usr/lib/xorg/Xorg                           133MiB |
|    0      1810      G   /usr/bin/gnome-shell                         103MiB |
|    0      2235      G   ...quest-channel-token=1289530776527538373    62MiB |
+-----------------------------------------------------------------------------+

Step 6: Install CUDA 10.0 & cuDNN 7.6

Choose CUDA version from HERE

Install development and runtime libraries (~4GB)
$ sudo apt-get install --no-install-recommends \
    cuda-10-0 \
    libcudnn7=7.6.0.64-1+cuda10.0  \
    libcudnn7-dev=7.6.0.64-1+cuda10.0

Step 7: Setup environment variables

$ vi ~/.bashrc
Add these lines
export PATH=/usr/local/cuda/bin:${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/extras/CUPTI/lib64

References:

Share:

10 則留言: