Skip to content

Creating a GPU Enabled Job in Scale

Raul.A edited this page Aug 1, 2019 · 2 revisions

This guide assumes you have a basic understanding of building docker containers, as well as a basic understanding of the seed manifest file.

1. Set your dockerfile to build from an existing nvidia cuda image

FROM nvidia/cuda:9.0-base

This is optional, as any docker image properly set up for GPU tasks should work, but the nvidia/cuda images already have everything set up for you when starting from scratch.

2. Set gpus to >= 1

In your seed manifest, gpus must be set to at least 1 in order for your job to be assigned a GPU in scale when it runs.

   "resources": {
      "scalar": [
        {
          "name": "gpus",
          "value": 1
        }
      ]
   }

Here is an example of a complete basic gpu manifest job

 "seedVersion": "1.0.0",
        "job": {
            "name": "gpu-test",
            "jobVersion": "1.0.0",
            "packageVersion": "1.0.0",
            "title": "GPU Test",
            "description": "Basic GPU test job",
            "maintainer": {
                "name": "AIS",
                "organization": "Applied Information Sciences",
                "email": ""
            },
            "timeout": 3600,
                "interface": {
                "command": "nvidia-smi"
            },
            "resources":
            {
                "scalar": [
                    { "name": "gpus", "value": 1.0 }
                ]
            }
        }

3. Test your image locally

To test locally refer to this guide for setting up nvidia docker, then you can mimic the way scale calls docker for GPU jobs simply by adding --runtime=nvidia to your docker command.

docker run --runtime=nvidia someorg/mygpudockercontainer:latest

Clone this wiki locally