apiVersion: batch/v1
kind: Job
metadata:
  name: nvidia-smi-job
spec:
  ttlSecondsAfterFinished: 100
  template:
    spec:
      restartPolicy: OnFailure
      containers:
        - name: nvidia-smi
          image: nvidia/cuda:9.2-devel
          command: ["/bin/sh"]
          args: ["-c", "sleep 120 && nvidia-smi"]
          resources:
            limits:
              nvidia.com/gpu: 4
