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

  1. Connect to your AWS Instance, for instructions follow this guide
  2. Next we install the dependencies for the CUDA installation
    1. First update the package manage
    2. sudo apt-get update
    3. Install build essentials
    4. sudo apt-get install build-essential
    5. The newer versions of gcc and g++ can cause issues with popular machine learning libraries, so we’ll install older versions:
    6. sudo apt-get install gcc-4.9
    7. sudo apt-get install g++-4.8
    8. Remove the original version and replace them with symbolic links to the older versions:
    9. sudo rm -f /usr/bin/gcc
    10. sudo rm -f /usr/bin/g++
    11. sudo ln -s /usr/bin/g++-4.8 /usr/bin/g++
    12. sudo ln -s /usr/bin/gcc-4.9 /usr/bin/gcc
    13. Install the missing Linux header files:
    14. sudo apt-get install linux-headers-generic
    15. Next, reboot the server: sudo reboot
  3. Download the CUDA toolkit
    1. In your webrowser navigate to the CUDA download section
    2. Navigate through to your target platform
    3. For our target platform of Ubuntu 16.04, navigate: Linux > x86_64 > Ubuntu > 16.04 > run file (local)
    4. Right click on the download link and select copy link
    5. Back in the terrainal window type wget <your_link> where <your_link> is the link you copied in the previous step
    6. After the file has downloaded, change the permissions using chmod 751 <file_name> so we can run it
  4. Next run the installation ./<file_name>
    1. After reading the EULA press q to begin the installation
    2. Follow the installation steps
  5. Next install NVIDIA Toolkit sudo apt-get install nvidia-cuda-toolkit
  6. Reboot the server sudo reboot
  7. 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.

Proudly sponsored by

Learn more about working with us.