Pick a depth. Each prompt opens in your AI pre-loaded with the lesson. Click a row to preview the prompt.
All the infrastructure exists so that a workload can ask for a GPU, and the way it asks is a single line under resources. But GPUs behave differently from CPU and memory in one critical way: they are not compressible or fractional by default — you request whole GPUs, and the scheduler hands you exclusive use of that device. Getting the request syntax right, and understanding that a request of 1 means one entire physical GPU, is the difference between a pod that schedules and one that sits Pending or, worse, silently runs on CPU. This is the most-used five lines of YAML in the entire course.
A GPU request goes under resources.limits with the key nvidia.com/gpu. The pod below asks for one GPU and runs a CUDA workload; the scheduler will only place it on a node with a free GPU.
# gpu-pod.yml
apiVersion: v1
kind: Pod
metadata:
name: cuda-vectoradd
spec:
restartPolicy: OnFailure
containers:
- name: cuda-vectoradd
image: nvcr.io/nvidia/k8s/cuda-sample:vectoradd-cuda12.5.0
resources:
limits:
nvidia.com/gpu: 1 # request exactly one whole GPU
# No tolerations here yet; on a tainted GPU node this pod would stay Pending
# until you add the toleration covered in Module 3.