Installing the GPU drivers (Linux)

In Ubuntu, the default driver for NVIDIA GPUs is an open-source driver called Nouveau; unfortunately, this does not work with CUDA at all, so we will have to install a proprietary driver. We will have to add the special graphics-drivers repository to our package manager to be able to download proprietary NVIDIA drivers to our Ubuntu system. We add the repository by typing the following line into the bash prompt:

sudo add-apt-repository ppa:graphics-drivers/ppa

Since this is a sudo superuser command, you will have to enter your password. We now synchronize our system with the new repository by typing the following line:

sudo apt-get update

We should now be ready to install our driver. From the Ubuntu desktop, ...

Get Hands-On GPU Programming with Python and CUDA now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.