3D Accelerated Docker image for the Udacity Robotics Nanodegree

(or how to have a performant 3D desktop in the cloud)

If you’re enrolled in the Udacity Robotics Nanodegree, or you’d like to work on ROS projects, but don’t have performant hardware accessible, or are a bit anxious of setting up the environment all by yourself, or would like to access your environment from anywhere, then, well, I have a solution for you!


I was interested in being able to access a single highly performant workspace from anywhere, and being able to scale it to my future needs. This includes the ability to run desktop and 3D accelerated applications. I reviewed the current commercial offerings, none of which exactly corresponded to my needs. So I decided to take matter into my own hands and build my environment from scratch. I used a combination of Amazon G2 AWS instances, Docker and Nvidia software and hardware for this purpose.

Here's the setup working:

Now I can build my Docker images, upload them to Docker Hub, and keep them up to date. This provides me with an identical environment that I can instantiate anywhere. I can then create AWS G2 instances on the fly, pull one of my Docker images and have my setup ready in a matter of minutes. The minutes can be turned into seconds when used with a combination of snapshots and/or volume storage.

I am finally able to run my ROS and Gazebo projects, or any other 3D app, with the full power of Nvidia graphics on AWS, and access that from any device, not matter how old it is!

If you’d like to use a similar setup, I prepared a list of scripts that you can use to turn a stock Ubuntu 16.04 AMI into a fully fledged 3D workspace. You can find them on my ec2-setup GitHub repo. Once you have your machine ready, fetch the Robotics Docker image on Docker Hub (the GitHub repo used to build it could also be of interest).

Hint: use a spot instance — This will result in major cost savings ;-)

Good luck, and let me know if you find any issues.

PS: You might also be interested in my previous one about a Docker image for the Udacity Self-Driving Car Nanodegree.

UPDATE (2018–03–15): Glad to see that this work has inspired a new feature in the Udacity classroom that will help students learn more efficiently. Thanks for the acknowledgement Udacity!