Setup CUDA On Ubuntu Edit on GitHub

Install The NVIDIA CUDA Toolkit

Click here to download the NVIDIA CUDA Toolkit

When you select your target platform, choose the ‘deb (network)’ installer for either 14.04 or 16.04. Please note that other versions of Ubuntu are not supported at this time.

Select Target Platform

Click the Download button and open the downloaded .deb file with Ubuntu Software Center:

Download with

Click the Install button in the Ubuntu Software Center to install cuda-repo-ubuntu1604:

Click Install

Then open a terminal and run these commands:

sudo apt update
sudo apt upgrade
sudo apt install cuda

Now reboot your system so that the new NVIDIA driver takes effect.

Compile The CUDA Samples

You’ll need to copy the CUDA samples source code to a writable location and then compile it, which you can do like this:

mkdir ~/cuda-samples
cp -r /usr/local/cuda-8.0/samples/ ~/cuda-samples
cd ~/cuda-samples/

And then you can run, for example, the smokeParticles sample like this: