Slurm's GPU path is four pieces: GRES declares the devices, a partition groups nodes with limits, the batch script asks for a shape, and cgroups confine the job to its GPUs. The script that gets eight GPUs on one node, the flags that scatter them across eight nodes, and how ranks find their GPU.
Explain how a Slurm job actually gets its GPUs: GRES, partitions, cgroups, and the sbatch that lands 8 GPUs on one node.
Slurm's GPU path is four pieces: GRES declares the devices, a partition groups nodes with limits, the batch script asks for a shape, and cgroups confine the job to its GPUs. The script that gets eight GPUs on one node, the flags that scatter them across eight nodes, and how ranks find their GPU.
Updated Sep 2026 · Grounded in real AI infrastructure interview loops and written to a senior-engineer editorial bar, with every number worked and every diagram hand-built.
The concepts behind this question
Ranked by how closely each one overlaps this question's topic, so the first card is the thing to read if the answer above moved too fast.
Scored on the correct sbatch for a whole node, on knowing that --gpus alone can scatter GPUs across nodes, on cgroup confinement as the isolation mechanism, and on the srun-to-rank-to-GPU mapping.
No comments yet — be the first to share your approach.
