Installing CUDA. Before CUDA can be installed you, there are a few steps you need to do otherwise you will get an error telling you an X server is running and it won. Hi, I'm a newbie on CUDA. Would anyone kindly share what command line to type in downloading and installing cuda 8 in Ubuntu Bash Windows 10.I have a 64-bit system, Ubuntu 14.04 trusty.
If you’re serious about doing any type of deep learning, you should be utilizing your GPU rather than your CPU. And the more GPUs you have, the better off you are.
If you already have an NVIDIA supported GPU, then the next logical step is to install two important libraries:
- $ sudo dpkg -i cuda-repo-ubuntu1404_7.5-18_amd64.deb $ sudo apt-get update $ sudo apt install cuda-7-5 This worked great on a notebook for me. However, on a desktop I started getting the infamous login loop problem.
- Installing the CUDA Toolkit. Watch this short video about how to install the CUDA Toolkit.
- Installing CUDA Toolkit 8.0 on Ubuntu 16.04 As per TensorFlow documentation, following are the prerequisites to install TensorFlow with GPU support. In the previous post we tried various methods to find out if the GPU is from NVIDIA or not.
- Sister Blog post: Setup Keras, Theano Backend on Ubuntu 16.04 (this is a similar post aimed at Keras+Theano instead) This is a small tutorial to guide you through installing Tensorflow with GPU enabled, on top of the CUDA + cuDNN frameworks by NVIDIA. If you want more information about how to.
- The NVIDIA CUDA Toolkit: A development environment for building GPU-accelerated applications. This toolkit includes a compiler specifically designed for NVIDIA GPUs and associated math libraries + optimization routines.
- The cuDNN library: A GPU-accelerated library of primitives for deep neural networks. Using the cuDNN package, you can increase training speeds by upwards of 44%, with over 6x speedups in Torch and Caffe.
In the remainder of this blog post, I’ll demonstrate how to install both the NVIDIA CUDA Toolkit and the cuDNN library for deep learning.
Specifically, I’ll be using an Amazon EC2 g2.2xlarge machine running Ubuntu 14.04. Feel free to spin up an instance of your own and follow along.
By the time you’re finished this tutorial, you’ll have a brand new system ready for deep learning.
How to install CUDA Toolkit and cuDNN for deep learning
As I mentioned in an earlier blog post, Amazon offers an EC2 instance that provides access to the GPU for computation purposes.
This instance is named the g2.2xlarge instance and costs approximately $0.65 per hour. The GPU included on the system is a K520 with 4GB of memory and 1,536 cores.
You can also upgrade to the g2.8xlarge instance ($2.60 per hour) to obtain four K520 GPUs (for a grand total of 16GB of memory).
For most of us, the g2.8xlarge is a bit expensive, especially if you’re only doing deep learning as a hobby. On the other hand, the g2.2xlarge instance is a totally reasonable option, allowing you to forgo your afternoon Starbucks coffee and trade a caffeine jolt for a bit of deep learning fun and education.
Insider the remainder of this blog post, I’ll detail how to install the NVIDIA CUDA Toolkit v7.5 along with cuDNN v5 in a g2.2xlarge GPU instance on Amazon EC2.
If you’re interested in deep learning, I highly encourage you to setup your own EC2 system using the instructions detailed in this blog post — you’ll be able to use your GPU instance to follow along with future deep learning tutorials on the PyImageSearch blog (and trust me, there will be a lot of them).
Note: Are you new to Amazon AWS and EC2? You might want to read Deep learning on Amazon EC2 GPU with Python and nolearn before continuing. This blog post provides step-by-step instructions (with tons of screenshots) on how to spin up your first EC2 instance and use it for deep learning.
Installing the CUDA Toolkit
Assuming you have either (1) an EC2 system spun up with GPU support or (2) your own NVIDIA-enabled GPU hardware, the next step is to install the CUDA Toolkit.
But before we can do that, we need to install a few required packages first:
Installing cuDNN
We are now ready to install the NVIDIA CUDA Deep Neural Network library, a GPU-accelerated library for deep neural networks. Packages such as Caffe and Keras (and at a lower level, Theano) use cuDNN to dramatically speedup the networking training process.
To obtain the cuDNN library, you first need to create a (free) account with NVIDIA. From there, you can download cuDNN.
For this tutorial, we’ll be using cuDNN v5:
Figure 4: We’ll be installing the cuDNN v5 library for deep learning.
Make sure you download the cuDNN v5 Library for Linux:
Figure 5: Since we’re installing the cuDNN on Ubuntu, we download the library for Linux.
This is a small, 75MB download which you should save to your local machine (i.e., the laptop/desktop you are using to read this tutorial) and then upload to your EC2 instance. To accomplish this, simply use scp , replacing the paths and IP address as necessary: