Tutorials:Install nVidia CUDA and GPU drivers

From Collective Computational Unit
Jump to navigation Jump to search

Overview

This tutorial will walk you through the necessary steps to set up nVidia CUDA and the correct corresponding version of GPU drivers, as well as a bunch of libraries needed for development.


Guide

If you have a freshly installed Ubuntu 18.04 or some derivative (such as Linux Mint 19), this should be simply a matter of running the following script:

#!/bin/bash
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.1.168-1_amd64.deb
dpkg -i cuda-repo-ubuntu1804_10.1.168-1_amd64.deb
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
apt-get update
apt-get install -y cuda

In case you had the driver or an earlier release of CUDA already installed, my recommendation is to first uninstall them.

If you cannot get the script to run or have a different linux version, head over to ... and install CUDA 10.1 by following their instructions. Make sure to explain your problems on the discussion page so that we can troubleshoot this guide.

Post installation, you should reboot your system to make sure it still works. Run the following commands in a shell to test installation: