Install Nvidia CUDA Drivers on Ubuntu
Notes: This guide was written using an Ubuntu 16.04 image, therefore it may not work on other systems
- Connect to your AWS Instance, for instructions follow this guide
- Next we install the dependencies for the CUDA installation
- First update the package manage
sudo apt-get update
- Install build essentials
sudo apt-get install build-essential
- The newer versions of gcc and g++ can cause issues with popular machine learning libraries, so we’ll install older versions:
sudo apt-get install gcc-4.9
sudo apt-get install g++-4.8
- Remove the original version and replace them with symbolic links to the older versions:
sudo rm -f /usr/bin/gcc
sudo rm -f /usr/bin/g++
sudo ln -s /usr/bin/g++-4.8 /usr/bin/g++
sudo ln -s /usr/bin/gcc-4.9 /usr/bin/gcc
- Install the missing Linux header files:
sudo apt-get install linux-headers-generic
- Next, reboot the server:
sudo reboot
- Download the CUDA toolkit
- In your webrowser navigate to the CUDA download section
- Navigate through to your target platform
- For our target platform of Ubuntu 16.04, navigate: Linux > x86_64 > Ubuntu > 16.04 > run file (local)
- Right click on the download link and select
copy link
- Back in the terrainal window type
wget <your_link>
where<your_link>
is the link you copied in the previous step - After the file has downloaded, change the permissions using
chmod 751 <file_name>
so we can run it
- Next run the installation
./<file_name>
- After reading the EULA press
q
to begin the installation - Follow the installation steps
- After reading the EULA press
- Next install NVIDIA Toolkit
sudo apt-get install nvidia-cuda-toolkit
- Reboot the server
sudo reboot
- If you have installed the Nvidia sample pack, build and the
deviceQuery
program located in<sample_dir>/1_Utilities/deviceQuery
Feedback
Any issues with this tutorial? Submit an issue or a pull request and we'll get it sorted out right away.