3. Create the quota: 

4. Verify that the namespace has the correct quota set: 

apiVersion: v1 kind: ResourceQuota metadata: name: gpu-quota namespace: nvidia spec: hard: requests.nvidia.com/gpu: 1 

# oc create -f gpu-quota.yaml 

## Example output 

resourcequota/gpu-quota created 

# oc describe quota gpu-quota -n nvidia 

## Example output 

Name: gpu-quota Namespace: nvidia Resource Used Hard -------- ---- ---- requests.nvidia.com/gpu 0 1 

5. Define a pod that asks for a single GPU. The following example definition file is called gpu- pod.yaml : 

apiVersion: v1 kind: Pod metadata: generateName: gpu-pod- namespace: nvidia spec: restartPolicy: OnFailure containers: - name: rhel7-gpu-pod image: rhel7 env: - name: NVIDIA_VISIBLE_DEVICES value: all - name: NVIDIA_DRIVER_CAPABILITIES value: "compute,utility" - name: NVIDIA_REQUIRE_CUDA value: "cuda>=5.0" command: [ "sleep" ] args: [ "infinity" ] 

