How to Install CUDA on Ubuntu 18.04 Bionic Beaver

Install CUDA on Ubuntu 18.04

In this article, we will have explained the necessary steps to install and configure CUDA on Ubuntu 18.04 LTS. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

Cuda is a parallel computing platform created by Nvidia that can be used to increase performance by harnessing the power of the graphics processing unit (GPU) on your system. Cuda is a software layer that allows software developers to access the GPU’s virtual instruction set and parallel computational elements, for the execution of compute kernels.

Install CUDA on Ubuntu

Step 1. First, before you start installing any package on your Ubuntu server, we always recommend making sure that all system packages are updated.

Step 2. Installing CUDA on Ubuntu 18.04.

Go to download page of CUDA Toolkit 10.1 here. After downloading the .deb file execute the following commands:

If you finished installing, don’t forget adding the CUDA PATH to your ~/.bashrc:

Add the following two lines to the end of the ~/.bashrc:

There are a couple of patches for cuda. If you want to install them too, you have to download the patches and for every patch you have to execute the following commands:

Step 3. Verifying the installation.

Run nvcc -V to check if CUDA is correctly installed. You must see the following output:

That’s all you need to do to install Nvidia CUDA on Ubuntu 18.04. I hope you find this quick tip helpful. If you have questions or suggestions, feel free to leave a comment below.