# Slurm doesn't see your GPUs: the gres.conf, AutoDetect, and cgroup checklist

> Source: <https://dev.to/altostratus_amihai_71d88f/slurm-doesnt-see-your-gpus-the-gresconf-autodetect-and-cgroup-checklist-5cll>
> Published: 2026-12-03 13:36:58+00:00

**Recommendation:** After editing gres.conf or GPU lines in slurm.conf, restart slurmd on affected nodes and resume drained nodes, then confirm with srun --gres=gpu:1 --pty nvidia-smi -L.
More in the playbook "Running AI in production": <https://wpnews.pro/playbooks/production-ops>

You run `srun --gres=gpu:1 nvidia-smi` and get `Requested node configuration is not available`, or the job starts and sees zero GPUs. Meanwhile `nvidia-smi` on the node itself shows all 8 cards. The gap between "the OS sees the GPUs" and "Slurm sees the GPUs" is almost always one of the five things below, in this order.

```
scontrol show node gpu-node-01 | grep -i gres
```

If you see `Gres=gpu:0` or no `Gres` at all, slurmd never detected the devices. If you see `Gres=gpu:8` but jobs still fail, skip to section 4.

Two layers have to agree:

`slurm.conf` needs `GresTypes=gpu` and a node definition that advertises GPUs, for example `NodeName=gpu-node-01 ... Gres=gpu:8`, or the auto-detect path.` gres.conf` needs `AutoDetect=nvml` and slurmd must be built with NVML support. Auto-detect only works when the `gres/nvml` plugin is actually installed (check your plugin directory, often `/usr/lib64/slurm/` or similar) and `libnvidia-ml.so` is reachable on the compute node.
A manual `gres.conf` line looks like:

```
NodeName=gpu-node-01 Name=gpu Type=h100 File=/dev/nvidia[0-7]
```

Two common mistakes here:

`/dev/nvidiactl`, `/dev/nvidia-uvm`) as `File=` entries. Only the numbered GPU devices belong in `scontrol reconfigure` does not fully re-read `gres.conf`. After changing `gres.conf` or GPU-related `slurm.conf` lines, restart slurmd on the affected compute nodes:

```
systemctl restart slurmd
```

Then re-check `scontrol show node`. A node that was drained for the change needs `scontrol update NodeName=gpu-node-01 State=RESUME` afterwards.

If `cgroup.conf` has `ConstrainDevices=yes` (and it should on a shared cluster), the job's devices cgroup is built from the `File=` entries in `gres.conf`. Wrong or missing entries here produce a different symptom: the job is allocated a GPU but cannot open the device (`cuInit` fails, or `nvidia-smi` inside the job says "No devices were found"). Fix the `File=` entries rather than turning off `ConstrainDevices`.

On nodes that also run Kubernetes with the NVIDIA device plugin, decide who owns the GPUs. Slurm's gres accounting and the k8s device plugin allocate independently and will happily double-book the same card. Run GPU workloads under one scheduler per node, or partition the cards statically.

```
srun --gres=gpu:1 --pty nvidia-smi -L
```

One GPU listed, visible only inside the allocation, means detection, gres.conf, and cgroup are all correct.

Disclosure: I am affiliated with Altostratus (altostratus.bot), an AI assistant for GPU and Kubernetes troubleshooting. The checklist above stands on its own and works without it. Treat any assistant, including that one, as a starting point and check your own logs. Questions about this checklist are welcome in the comments.
