0%

Install CUDA 10.0 with cuDNN 7.3.1 on Ubuntu 18.04 bionic

Introdution

This is helping you to install the latest CUDA 10.0 which released Sept. 2018 on Ubuntu 18.04 bionic

Step by step

At first you need a bionic ubuntu server and lets start it

  1. Install driver

    1
    2
    3
    sudo add-apt-repository ppa:graphics-drivers/ppa
    sudo apt-get update
    sudo apt-get install nvidia-396
  2. Install CUDA 10.0
    Download here

    1
    2
    3
    sudo dpkg -i 'cuda10.0.deb'
    sudo apt-get update
    sudo apt-get install cuda
  3. Test CUDA

    1
    2
    3
    cd /usr/local/cuda/samples/1_Utilities/deviceQuery
    sudo make
    ./deviceQuery
  4. Install cuDNN 7.3.1
    Download here
    (You need to register if you don’t have account)

    1
    2
    3
    sudo dpkg -i 'Your Runtime Library.deb'
    sudo dpkg -i 'Your Developer Library.deb'
    sudo dpkg -i 'Your Code Sample.deb'
  5. Test cdDNN

    1
    2
    3
    cd /usr/src/cudnn_samples_v7/mnistCUDNN
    sudo make
    ./mnistCuDNN

I got a error during “sudo make”

  1. One more thing
    There is a bug in cdDNN package
1
2
3
4
5
6
7
vim /usr/include/cudnn.h

//change this
#include "driver_types.h"

//to:
#include <driver_types.h>

And now you can repeat step 5.

All set!

BTW
It works on pytorch 0.4.1 with stable/linux/py3.6/cuda9.2
Download here

1
2
pip3 install http://download.pytorch.org/whl/cu92/torch-0.4.1-cp36-cp36m-linux_x86_64.whl
pip3 install torchvision

Ref

https://blog.csdn.net/junzia/article/details/80871145
https://medium.com/@afun/ubuntu-16-04-%E5%AE%89%E8%A3%9D-cuda-cudnn-nvidia-driver-%E7%9A%84%E8%B8%A9%E9%9B%B7%E5%BF%83%E5%BE%97-%E9%9D%9E%E5%AE%89%E8%A3%9D%E6%AD%A5%E9%A9%9F%E8%A9%B3%E8%A7%A3-b13121d95025