Install CUDA 10 on Ubuntu

22 Mar 2019

Install CUDA 10 on Ubuntu

  1. Download cuda sdk from: https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1810&target_type=deblocal
  2. On terminal run the following at the download directory.
    sudo dpkg -i cuda-repo-ubuntu1810-10-1-local-10.1.105-418.39_1.0-1_amd64.deb
    sudo apt-key add /var/cuda-repo-10-1-local-10.1.105-418.39/7fa2af80.pub
    sudo apt-get update
    sudo apt-get install cuda
  3. CUDA should be installed in:

    /usr/local/cuda-10.1

    With a soft link: /usr/loca/cuda->cuda-10.1

  4. Put the following into your PATH

    export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
    export LD_LIBRARY_PATH=/usr/local/cuda/lib64:${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
  5. Verify with samples:
    cp -r /usr/local/cuda/samples ~/cuda_samples
    cd ~/cuda_samples/1_Utilities/deviceQuery
    make
    ./deviceQuery
    You should see your GPU info printed.