TLDR: Use AMI ami-b1e2c4a6, which provides the NVIDIA drivers, docker, and nvidia-docker. Run your projects as docker containers. Using docker to package your projects allows them to be easily ported. Here are a couple of Docker images to get started.

I recently read this post on r/MachineLearning about an AMI pre-built with GPU support and several popular software dependencies for Deep Learning like OpenCV, Caffe, Keras, Theano, Tensorflow, etc.

It’s definitely very useful to have an environment with everything set up and ready to go. One of the biggest sources of friction when trying a new project is having to set up the environment. Even when the source code and results are available, each project has its own framework with multiple dependencies. They’re implemented in different programming languages, different environments and operative systems. This adds up to make it really cumbersome and time consuming to test a new approach.

For this purpose, I think using an AMI pre-built with a ready-to-go environment is great and I wanted to follow suit by sharing one of the AMIs we use at empirical.

About the AMI

Instead of including several deep learning packages, our AMI includes only a few dependencies:

NVIDIA drivers 361.42

Docker 1.12

nvidia-docker

Docker allows us to easily install any software or project packaged as a docker image. The NVIDIA driver and nvidia-docker allow us to run these projects with GPU support. (You can learn more about the motivation for nvidia-docker on their wiki.)

I would really like to encourage you to use Docker for your projects. Packaging your projects as Docker images is really great for productivity, because once you do it, you have a portable environment that can be executed anywhere with minimal setup. Using docker images reduces the initial friction for testing a new approach, you can share the docker image with your peers and they can be running commands right away without having to setup anything more that Docker.

Note that GPU support for docker only works on Linux at the moment.

Launch the AMI

You can launch the AMI using the AWS UI.

Select AMI ID ami-b1e2c4a6 Then select the instance type: g2.2xlarge or p2.xlarge. Finally add storage depending on your needs. The current image includes 8GB of storage on the Root volume. However that’s only enough for the CUDA installation, you probably want to extend it, depending on the size of the applications you’re going to run, otherwise you’ll run out of disk space.

Build and customize the AMI

You can find the details about how to build the AMI from scratch here.

Executing your Deep Learning project

Once docker is installed you can run your projects as docker containers. For this you need to create a Docker image including your dependencies and your code.

You can find Dockerfiles and pre-built docker images for OpenCV 3.0 and Caffe with CUDA support here.

A note about Empirical

At empirical we aim to be the ArXiv for experiments and we’re currently developing tools for helping scientists and engineers to easily run and replicate experiments. Check us out at https://empiricalci.com.