Skip to content

Operator task guide

How to monitor Slurm GPU jobs, fix GRES errors, and configure Node Health Checks

Slurm GPU reliability relies on three controls working together: accurate --gres=gpu:<type>:<count> and memory requests in sbatch scripts, sacct/sstat accounting paired with host GPU telemetry, and automated Node Health Check (NHC) scripts that drain nodes on Xids or uncorrectable ECC before the next user lands on them.

When sinfo -R shows a node drained with Scheduler health check failed or NHCs timed out, preserve the drain reason, inspect host dmesg and nvidia-smi -q before clearing state, and verify the node passes a real GPU smoke test before running scontrol update State=RESUME.

Reviewed . Reference guidance is not a diagnosis of your workload.

Step-by-step method

  1. 1

    Inspect Slurm GPU job status, pending reasons, and accounting

    Use squeue to check pending reasons (ReqNodeNotAvail, QOSMaxGRESPerUser), sstat for live running step RSS/CPU, and sacct for completed/failed step exit codes.

    sinfo -o "%20P %10a %15F %20G %15t"
    sinfo -R
    squeue -j <jobid> -o "%.18i %.2t %.30R"
    sacct -j <jobid> --units=G --format=JobID,NodeList,State,ExitCode,ReqMem,MaxRSS,Elapsed
  2. 2

    Write clean sbatch GPU GRES and distributed launch flags

    Match --gres=gpu:<type>:<count> or --gpus-per-node to configured gres.conf names, request explicit host memory (--mem or --mem-per-gpu), and avoid launching torchrun inside an srun multi-task tree that duplicates rank spawning.

    #!/bin/bash
    #SBATCH --job-name=train-h100
    #SBATCH --nodes=2
    #SBATCH --ntasks-per-node=1
    #SBATCH --gpus-per-node=8
    #SBATCH --cpus-per-task=64
    #SBATCH --mem=0
    #SBATCH --time=04:00:00
    srun torchrun --nnodes=2 --nproc_per_node=8 --rdzv_backend=c10d --rdzv_endpoint=$(scontrol show hostnames "$SLURM_JOB_NODELIST" | head -n1):29500 train.py
  3. 3

    Triage Slurm scheduler health check failed and drained GPU nodes

    When Slurm marks a node DRAIN due to HealthCheckProgram failure, check the NHC log, NVML visibility, ECC/Xid events, and PCIe link state before manually resuming.

    scontrol show node <drained-node> | grep -iE 'State=|Reason=|Gres='
    dmesg -T | grep -iE 'NVRM: Xid|ECC|AER'
    nvidia-smi -q -d ECC,ROW_REMAPPER
  4. 4

    Resume a repaired node only after verification

    Once the underlying NHC condition (such as stale zombie processes, driver mismatch, or verified transient fault) is resolved and a health check passes, resume the node cleanly.

    sudo scontrol update NodeName=<node> State=RESUME

Slurm GPU error and drain triage

Signals, meanings and actions for how to monitor slurm gpu jobs, fix gres errors, and configure node health checks.
SignalWhat it meansNext action
sinfo -R shows NHCs / Health check failedNode Health Check caught missing GPU, Xid, ECC, zombie PID, or stale mount.Keep drained, read NHC logs and dmesg, fix root condition before RESUME.
Requested node configuration is not availableCombined GRES type, CPU, memory, or constraint matches zero nodes.Run sinfo -o "%P %G %c %m %f" and align sbatch flags.
slurmstepd: JOB CANCELLED DUE TO OOM-KILLERJob step exceeded host RAM cgroup (--mem), not GPU VRAM.Compare sacct MaxRSS vs ReqMem and adjust host memory or num_workers.
torchrun hangs under srunsrun spawned 8 tasks per node and each ran torchrun --nproc_per_node=8.Set --ntasks-per-node=1 when using torchrun, or pass --ntasks-per-node=8 without torchrun.

Evidence checklist

  • sbatch submission script and full srun/torchrun command
  • scontrol show job <jobid> and sacct accounting table
  • scontrol show node <node> Reason and Gres output
  • /var/log/nhc.log or HealthCheckProgram output on drained nodes
  • Host dmesg Xid/OOM lines and nvidia-smi -q output

Common mistakes

Running scontrol update State=RESUME without checking why NHC drained the node

Blindly resuming a hardware-faulted node black-holes the next user job immediately.

Mixing srun --ntasks-per-node=8 with torchrun --nproc_per_node=8

That spawns 64 processes on 8 GPUs and immediately deadlocks NCCL.

Confusing slurmstepd OOM-KILLER with CUDA out of memory

slurmstepd monitors host RAM cgroups, whereas CUDA OOM is reported by PyTorch inside stderr.

Frequently asked questions

How do I monitor GPU usage of running Slurm jobs?

Use squeue and scontrol show job to verify GRES allocation, SSH or wrap jobs to stream nvidia-smi dmon / dcgmi metrics per job, or export cgroup/DCGM metrics tagged by SLURM_JOB_ID to Prometheus and Grafana.

What causes Slurm scheduler health check failed?

The configured HealthCheckProgram (often LBNL NHC or custom NVML scripts) returned a non-zero exit code due to missing GPUs, uncorrectable ECC, zombie CUDA processes, full filesystems, or offline IB ports.

How do I specify GPU type in Slurm sbatch?

Check available GRES names with sinfo -o "%P %G", then pass #SBATCH --gres=gpu:h100:8 (or --gpus-per-node=h100:8 depending on cluster config).

Why did my Slurm GPU job hang when launched with srun and torchrun?

If srun creates one task per GPU (--ntasks-per-node=8) AND each task launches torchrun --nproc_per_node=8, ranks collide on GPUs and ports. Use --ntasks-per-node=1 for torchrun.

Live diagnosis, no signup

Upload your GPU log. Find what happened first.

Get the likely cause, supporting evidence, and next safe steps with the same cloud reasoning used by paid plans. A crash the engine recognizes is answered in seconds, then checked by an independent AI review that updates this page when it finishes. A crash it does not recognize waits for the AI's own answer, which can take a few minutes. No account, card, or installation. Logs are masked at Denpex API ingress and are not saved to account history.

Before uploading, review cloud data handling and local options.

training_logs.txt
No log to hand? Try one:

Upload your log file. Large files are processed in your browser. Only selected evidence is submitted when you run diagnosis.

3 free cloud diagnoses per day

Try Denpex for 30 days. FREE.

No credit card. No automatic subscription. See whether Denpex helps with an incident you already understand.

Start your free 30-day Team evaluation

Up to 50 diagnoses a day for 30 days. Verify your work email to activate an eligible company evaluation, then replay a resolved incident and compare the evidence and next steps with your team's confirmed cause.

Use your company email, for example alex@yourcompany.com.

Who qualifies?

Company email domains activate the free 30-day Team evaluation (up to 50 diagnoses a day) after an email and domain check, whatever mail provider you use. If we cannot verify your domain automatically, support reviews it: write to support@denpex.com. Free local diagnosis in the editor extension needs no account.

Using a personal email (Gmail, Outlook, Naver, QQ) or solo cluster? Create a free $0 account (no work email required) to save 7-day history and unlock AI fallback, or send a cluster crash log for a live walkthrough.

Apply the method to your incident

Use the three free diagnoses to review your error and relevant evidence. Keep reference guidance separate from the cause and recovery status of your own workload.

Diagnose your incident