Nvidia is pushing Docker containers in new directions with the release of a Docker plugin that enables GPU-accelerated applications inside Docker containers.
The plugin, which is available on GitHub, addresses a deep conundrum within the architecture of Docker containers.
The conundrum is this: Containers make apps highly portable by providing a universal software environment for deploying apps. No matter which OS your host system is running, you can deploy apps inside Docker containers, as long as the host supports Docker.
But that magic only works when your app is not dependent on specific hardware in any way. If your app wants to use GPU acceleration, then it’s going to need a GPU driver and access to the host GPU, which is normally not available through Docker.
The Nvidia Docker plugin works around this issue by mounting character devices and driver files when the container starts. That means the Nvidia driver does not need to be present inside the container. Instead, any Dockerized app can take advantage of GPU acceleration by loading the requisite resources when the apps starts.
Why it Matters
If you’re like most people, you probably don’t use GPU acceleration beyond the context of running desktop applications. So far, Docker is not being used to deliver desktop apps. So the benefits of pairing GPU acceleration with Docker may not be obvious to most people.
Of course, if you work in a field where you use GPUs to crunch numbers faster, the Nvidia plugin could come in handy.
More important, however, is how the plugin also sets a new precedent for using Docker containers in conjunction with hardware-dependent apps. From there, it’s not a big jump to making Docker containers compatible with, say, specialized networking hardware by following the same model that Nvidia has.
That could push Docker in new directions entirely. Instead of being simply an efficient way to deliver apps that don’t care much at all about the kind of hardware they run on (such as a web server), Docker containers could also turn into a method for delivering software that does depend extensively on special hardware features (such as a game that requires GPU acceleration, or an app that uses a special USB-connected digital camera).
For now, making enabling hardware-dependent containers such as this one remains tricky. To make things work Nvidia uses a modified Docker CLI. If Docker developers see the value in a plugin like the Nvidia one, however, it’s likely that, going forward, they’ll make such integrations easier without requiring special hacking.