apiVersion: batch/v1
kind: Job
metadata:
  name: nvidia-smi
spec:
  template:
    metadata:
      name: nvidia-smi
    spec:
      restartPolicy: Never
      containers:
      - name: nvidia-smi
        image: nvidia/cuda
        command:
        - nvidia-smi
        resources:
          limits:
            nvidia.com/gpu: 1
        volumeMounts:
        - name: nvidia
          mountPath: /usr/local/nvidia/
      volumes:
      - name: nvidia
        hostPath:
          path: /usr/local/nvidia