CUDA - Install CUDA 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 16.04 or 17.04.

Select Target Platform

Click the Download button and open the downloaded .deb

Download with

Click the Install button to install cuda-repo-ubuntu1704

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/
make

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

./bin/x86_64/linux/release/smokeParticles

smokeParticles

Occasionally, there are CUDA samples that don’t compile and break the process for the entire set. If one is broken, it can be removed to complete the rest of the building:

rm -rf 3_Imaging/cudaDecodeGL/ 3_Imaging/histogram/

Or individual examples can be compiled by changing to their directory and running make. Compiled binaries are found in the ~/cuda-samples/bin/x86_64/linux/release folder.