Skip to content

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.

Quick answer

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.
Infrastructure#slurm#slurmstepd#oom-kill#cgroup#host-memory#sacct

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.

Live diagnosis, no signup

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.

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

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.

SymptomPossible explanation
slurmstepd: error: Detected 1 oom_kill event in StepId=491820.0. Some of the step tasks have been OOM KilledTask 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 MemoryTask 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

  1. 1Run sacct -j <jobid> --units=G --format=JobID,State,ExitCode,ReqMem,MaxRSS,MaxRSSTask,MaxRSSNode.
  2. 2Read dmesg or journalctl -k on the failing node to see the killed process name and anon vs shmem usage.
  3. 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.

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.
Already have an account? Sign in

Searchable error signature

search key
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 logs

No 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

snippet
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 30

This 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 / StackRecommendationNotes
Immediate triageRun sacct MaxRSS + ReqMem comparison on failing StepIdIdentifies host node, task rank, and requested vs peak host memory.
Host RAM reductionBound DataLoader num_workers and CPU offload pin_memoryOften cuts host RSS without reducing GPU micro-batch size.

With the fix vs without the fix

DimensionWith the fixWithout the fix
Fault domainVerify host cgroup RAM via sacct + dmesgReducing GPU VRAM batch size while host RAM keeps leaking
Resource requestsExplicit --mem-per-gpu sized for dataloader + checkpointingRelying 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 extension

Slurm 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 errors

Frequently 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?
slurmstepd monitors the Linux host RAM memory cgroup, not GPU HBM. Host allocations from DataLoader forks, pinned offload memory, or /dev/shm exceeded the job's CPU memory limit.
Why does MaxRSS sometimes look smaller than ReqMem on an OOM kill?
tmpfs (/dev/shm) files, shared pages, and fast RSS spikes between Slurm's polling intervals can cross the cgroup hard ceiling before sacct polls a sample.

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.