MobiledgeX allows you to deploy docker containers to GPU enabled hardware in one of two ways, via a docker image or via a docker compose file. Note that GPU support for docker and docker-compose is relatively immature, so these instructions may change over time as the technology develops.
In all regions with GPUs deployed there will be a set of specific flavors that allow you to use a GPU. These flavors will contain the string gpu
; for example, m4.small-gpu
.
This is the easiest way to deploy a GPU enabled container; the only additional step required outside of the standard workflow (Link to how to deploy docker images), which is simply to ensure that you select a GPU enabled flavor for the application if you plan on using auto-clustering, or for the cluster when you create it manually.
The process for deploying a GPU enabled container using docker-compose
is very similar to the standard workflow (Link to how to deploy using compose). However, there are a few key differences that you need to be aware of.
runtime: nvidia
in your service definition.NVIDIA_VISIBLE_DEVICES=all
to your environment section.This sample compose file shows the correct use of arguments to enable GPU support, using the MobiledgeX ComputerVision Application (Link to application).
version: '2.3'
services:
compvision:
image: docker.mobiledgex.net/mobiledgex/images/computervision-gpu:2020-09-15
network_mode: "host"
restart: unless-stopped
runtime: nvidia
environment:
- NVIDIA_VISIBLE_DEVICES=all
In all cases, please contact support if your problems persist.