This is a tutorial to help you get the Caffe deep learning framework up and running on a GPU-powered AWS instance running inside a Docker container.
Before you can start your docker container, you will need to go deeper down the rabbit hole.
You’ll first need to complete the steps here:
After you’re done, you’ll end up with a host OS with the following properties:
- A GPU enabled AWS instance running Ubuntu 14.04
- Nvidia kernel module
- Nvidia device drivers
- CUDA 6.5 installed and verified
Once your host OS is setup, you’re ready to install docker. (version 1.3 at the time of this writing)
Setup the key for the docker repo:
Add the docker repo:
Run the docker container
Find your nvidia devices
You should see:
1 2 3
You’ll have to adapt the
DOCKER_NVIDIA_DEVICES variable below to match your particular devices.
Here’s how to start the docker container:
It’s a large docker image, so this might take a few minutes, depending on your network connection.
Run caffe test suite
After the above
docker run command completes, your shell will now be inside a docker container that has Caffe installed.
You’ll want run the Caffe test suite and make sure it passes. This will validate your environment, including your GPU drivers.
... [ PASSED ] 838 tests.
Run the MNIST LeNet example
A more comprehensive way to verify your environment is to train the MNIST LeNet example:
1 2 3 4 5
This will take a few minutes.
1 2 3 4 5
Congratulations, you’ve got GPU-powered Caffe running in a docker container — celebrate with a cup of Philz!