Slurm Detected oom_kill Event in StepId: Host RAM
Troubleshoot slurmstepd Detected 1 oom_kill event in StepId errors using sacct MaxRSS and Linux cgroup memory.events when GPU VRAM still has headroom.
slurmstepd: error: Detected 1 oom_kill event in StepId=... means the Linux kernel cgroup OOM killer terminated a job task for exceeding host system RAM (cgroup memory ceiling), NOT GPU VRAM. Verify with sacct -j <jobid> --format=JobID,State,ExitCode,ReqMem,MaxRSS,MaxRSSTask,MaxRSSNode and kernel dmesg, then size --mem, DataLoader workers, or CPU offload headroom.
- Symptom
slurmstepd: error: Detected 1 oom_kill event in StepId=491820.0. Some of the step tasks have been OOM Killed. srun: error: gpu-h100-node04: task 3: Out Of Memory srun: Terminating StepId=491820.0 slurmstepd: error: *** STEP 491820.0 ON gpu-h100-node04 CANCELLED AT 2026-11-25T04:19:02 ***- Root cause
- Task host RAM plus tmpfs (/dev/shm) and page cache attribution exceeded the Slurm job step's cgroup memory allocation.
- Recommended fix
- Query Slurm accounting on the step ID: sacct -j <jobid> --units=G --format=JobID,State,ExitCode,ReqMem,AllocTRES,MaxRSS,MaxRSSTask,MaxRSSNode to see which task and node hit the host limit.
- How Denpex helps
- Denpex investigates Slurm Detected oom_kill Event in StepId: Host RAM using the evidence you provide or your connected workload collects. Earlier rank, host or application evidence is needed to distinguish an initiating failure from a downstream report.
What this failure is
A Slurm job-step termination message triggered when Linux kernel cgroup accounting detects an oom_kill inside a step's host-RAM cgroup.
Is this what broke your run? Paste your log.
You're reading about Slurm Detected oom_kill Event in StepId: Host RAM. Paste your own traceback and relevant evidence for an investigation of your workload, with a next action or a specific missing fact. A reference entry does not establish your cause. No account or card for the free diagnosis. Review data handling before submitting sensitive logs.
Before uploading, review cloud data handling and local options.
Upload your log file. Large files are processed in your browser. Only selected evidence is submitted when you run diagnosis.
Why it happens (the mechanism)
Even when 80 GB H100 VRAM is half empty, host CPU RAM fills rapidly from PyTorch DataLoader workers (fork copy-on-write across num_workers), ZeRO/FSDP CPU offloading with pin_memory, large checkpoint gathers on rank 0, or shared /dev/shm tmpfs caches counted inside the job cgroup.
What you'll observe
- Training cancels mid-step with slurmstepd: error: Detected 1 oom_kill event in StepId while nvidia-smi showed low GPU usage
- Healthy nodes abort simultaneously with srun: Terminating StepId
Common symptoms and what they mean
Check possible explanations against the incident evidence. A matching symptom alone does not establish its cause.
| Symptom | Possible explanation |
|---|---|
| slurmstepd: error: Detected 1 oom_kill event in StepId=491820.0. Some of the step tasks have been OOM Killed | Task host RAM plus tmpfs (/dev/shm) and page cache attribution exceeded the Slurm job step's cgroup memory allocation. |
| srun: error: gpu-h100-node04: task 3: Out Of Memory | Task host RAM plus tmpfs (/dev/shm) and page cache attribution exceeded the Slurm job step's cgroup memory allocation. |
Which systems are affected
- Slurm GPU clusters enforcing task/cgroup host RAM limits
- Data-heavy PyTorch training, DeepSpeed ZeRO CPU offload, and FSDP checkpointing jobs
How to confirm this is the problem
Use this checklist to test the hypothesis against a small reproduction. No single line proves the root cause, so preserve the preceding events and compare one variable at a time.
- ✓Verify sacct MaxRSS stabilizes comfortably below ReqMem across full DataLoader epoch and checkpoint boundaries with zero cgroup oom_kill events.
Root cause
- Task host RAM plus tmpfs (/dev/shm) and page cache attribution exceeded the Slurm job step's cgroup memory allocation.
The fix and how to prevent it
How to fix it
- Query Slurm accounting on the step ID: sacct -j <jobid> --units=G --format=JobID,State,ExitCode,ReqMem,AllocTRES,MaxRSS,MaxRSSTask,MaxRSSNode to see which task and node hit the host limit.
- Check kernel logs on the reported node (dmesg -T or journalctl -k) for 'oom-kill' and cgroup memory.events / memory.peak attribution to verify which process (main trainer vs dataloader_worker) was killed.
- Raise #SBATCH --mem or --mem-per-gpu proportionally on future jobs if node physical RAM allows.
- Shrink host memory spikes by cutting DataLoader num_workers / persistent_workers, disabling pin_memory if pinned host buffers saturate RAM, or distributing checkpoint saves instead of gathering full FP32 weights onto rank 0 host RAM.
Step-by-step remediation
- 1Run sacct -j <jobid> --units=G --format=JobID,State,ExitCode,ReqMem,MaxRSS,MaxRSSTask,MaxRSSNode.
- 2Read dmesg or journalctl -k on the failing node to see the killed process name and anon vs shmem usage.
- 3Adjust --mem-per-gpu, DataLoader num_workers, or rank-0 checkpoint gathers and re-verify zero oom_kill events.
How to prevent it
- Request explicit #SBATCH --mem-per-gpu matching checkpoint gather and DataLoader footprints instead of relying on partition default memory
- Monitor per-rank host RSS alongside GPU VRAM in job telemetry
Save this diagnosis and catch the next crash automatically
All root cause, fix, and prevention steps above are free to read. Create a free account with any email or GitHub to keep your saved diagnosis history across the encyclopedia and run cloud checks, or use a work email below for the 30-day Team evaluation. No card required.
Or start a 30-day free Team trial (work email)
Verified work email unlocks all 14 fleet diagnostic tools, Slack alerts, and team history for 30 days. No card and no automatic charge.
Searchable error signature
slurmstepd: error: Detected 1 oom_kill event in StepId=491820.0. Some of the step tasks have been OOM Killed.
srun: error: gpu-h100-node04: task 3: Out Of Memory
srun: Terminating StepId=491820.0
slurmstepd: error: *** STEP 491820.0 ON gpu-h100-node04 CANCELLED AT 2026-11-25T04:19:02 ***Use this text as a lookup key in logs and upstream issue trackers. It is not presented as a captured customer log. Confirm the cause from your own preceding events, versions, configuration and the cited references.
Diagnose your own log automatically
The root cause and fix steps above stay free. Create a free account to analyze full job logs, attribute the first failed rank, and keep saved incident history.
Sign up free. Analyze your cluster logsNo credit card. Daily allowance follows verified trust tier. Instant access.
Why the recommended fix works
Checking sacct MaxRSS and kernel cgroup OOM kills proves the ceiling is host RAM rather than CUDA HBM so tuning targets DataLoader RAM, offload buffers, or --mem rather than shrinking GPU batch size needlessly.
Code examples
sacct -j 491820 --units=G --format=JobID,State,ExitCode,ReqMem,AllocTRES,MaxRSS,MaxRSSTask,MaxRSSNode
sudo journalctl -k -b --no-pager | grep -iE 'oom-kill|Out of memory|Killed process' | tail -n 30This snippet illustrates the entry-specific check. Verify the installed versions, permissions, target and workload context before using it. A command or API example is not proof of recovery.
Best practices by model family
| Model / Stack | Recommendation | Notes |
|---|---|---|
| Immediate triage | Run sacct MaxRSS + ReqMem comparison on failing StepId | Identifies host node, task rank, and requested vs peak host memory. |
| Host RAM reduction | Bound DataLoader num_workers and CPU offload pin_memory | Often cuts host RSS without reducing GPU micro-batch size. |
With the fix vs without the fix
| Dimension | With the fix | Without the fix |
|---|---|---|
| Fault domain | Verify host cgroup RAM via sacct + dmesg | Reducing GPU VRAM batch size while host RAM keeps leaking |
| Resource requests | Explicit --mem-per-gpu sized for dataloader + checkpointing | Relying on tiny partition default memory per CPU |
Diagnostic note
“/dev/shm allocations inside a Slurm step are charged to that step's Linux memory cgroup on modern kernels. Large PyTorch DataLoader queues or Ray Plasma stores in /dev/shm frequently push jobs over ReqMem even when Python process RSS looks moderate.”
Diagnose this failure in VS Code
Select the traceback or open the failed terminal, then run Denpex locally to inspect matched failure patterns, supporting evidence and next checks without uploading the log. Verify recommendations against your workload before changing production.
Install the free VS Code extensionSlurm GPU errors in context
Slurm GPU failures can occur before allocation, during cgroup creation or inside the workload. The hub joins job reason, GRES, memory, node-health and distributed-launch evidence.
Compare related slurm gpu errorsFrequently asked questions
Questions engineers and on-call staff commonly ask about this failure.
Why did Slurm kill task 3 for Out Of Memory when nvidia-smi showed 40 GB free GPU VRAM?
Why does MaxRSS sometimes look smaller than ReqMem on an OOM kill?
Don't just read the fix, diagnose your run
The encyclopedia explains documented failure patterns. Denpex investigates your logs, configuration and stack, shows the supporting evidence, and asks for missing details when needed.
Related Infrastructure errors
Dual ISP BGP Route Withdrawal Causing Complete GPU Cloud Region Outage
Infrastructure · critical
Routine UPS Maintenance Triggering Cascading Power and Cooling Failure Across GPU Cloud Region
Infrastructure · critical
Remediation Storm Prevention via Circuit Breaker Pattern in AutoClusters
Infrastructure · high
Network Storage Volume Causing Process Hangs on H100 GPU Nodes
Infrastructure · high