Spark Training Gotchas
DGX Spark's GB10 chip (Grace Blackwell, SM121, 128GB unified
memory, aarch64) has ten recurring failure modes across
launch, memory, thermals, bandwidth, and precision. Each is
named G1–G10 so it can be checked by number — the numbering
is load-bearing for tooling that runs these checks. Read this
before a long run, not after hour six.
When to Use This Skill
- A training run fails to start, with an import error or a
segfault that doesn't point at the real cause.
- A run OOMs while
nvidia-smi still shows headroom.
- Throughput degrades partway through a run that started fine.
- Before any multi-hour or multi-epoch job on GB10.
- Wiring two Sparks together, before picking a parallelism
strategy.
- Choosing between FP8 and NVFP4 for a Spark-hosted run.
Common Issues Quick Reference
| # |
Symptom |
Fix |
| G1 |
undefined symbol / segfault |
cu130 wheel or container |
| G2 |
flash-attn wrong backend used |
skip pip build; monkeypatch on NGC |
| G3 |
OOM despite headroom |
drop page cache |
| G4 |
throughput drop / reboot |
expect ~100W sustained cap |
| G5 |
memory-bound step slow |
budget 180–192 GB/s |
| G6 |
cache evicted mid-run |
one GPU server at a time |
| G7 |
NVFP4 slower than FP8 |
stay FP8 unless sm_121a |
| G8 |
playbook fails outright |
check upstream issues |
| G9 |
env breaks after install |
use a container |
| G10 |
2-Spark TP hangs |
DDP/FSDP only, never TP |
The Ten Gotchas
G1: CUDA 12/13 ABI Mismatch
- SYMPTOM:
ImportError: undefined symbol naming a CUDA
function, or a segfault on the first .cuda() call.
- CAUSE: most PyPI wheels link
libcudart.so.12; Spark
ships CUDA 13. pip never checks CUDA ABI, so it surfaces
only at import or first kernel launch.
- CHECK:
references/gotcha-checks.md G1 — the wheel's
CUDA build tag.
- FIX: reinstall from
download.pytorch.org/whl/cu130 or
use a matched container.
G2: flash-attn — Skip the pip Build, Watch Unsloth's Auto-Detect
- SYMPTOM:
pip install flash-attn still fails/hangs.
Unsloth may also silently train flash-attn over an
explicitly requested SDPA.
- CAUSE: no aarch64/sm_121 wheel for bare pip — but NGC
containers ship a working SM121 flash-attn, and Unsloth
auto-prefers it, dropping
attn_implementation="sdpa".
- CHECK:
references/gotcha-checks.md G2 — is flash-attn
already present and working.
- FIX: bare pip — skip flash-attn, use SDPA (unchanged). On
NGC — the only reliable override is the monkeypatch in
references/gotcha-checks.md G2.
G3: UMA OOM Below 128GB
- SYMPTOM: OOM during model load/training while
nvidia-smi still reports free memory under the 128GB cap
— or, on some setups, [N/A] outright instead of a number.
- CAUSE: mmap and the CUDA allocator double-count pages
during safetensors load; QLoRA can OOM earlier than bf16
since dequantization adds transient allocs.
- CHECK:
references/gotcha-checks.md G3 — read free -g
and /proc/meminfo, not nvidia-smi.
- FIX: drop the page cache with
sync; echo 3 > /proc/sys/vm/drop_caches — needs root, a
between-run reset, not a mid-training step.
G4: Thermal Throttling
- SYMPTOM: throughput drops partway through a multi-hour
run, or the box spontaneously reboots under sustained load.
- CAUSE: sustained power draw caps around 100W versus the
240W rated figure; long runs push into that ceiling and
throttle or, sometimes, reboot.
- CHECK:
references/gotcha-checks.md G4 — sample
nvidia-smi --query-gpu=temperature.gpu,power.draw.
- FIX: if power plateaus under 240W while temperature
climbs, treat throttling as the cause; improve cooling or
cap run length.
G5: Bandwidth Ceiling
- SYMPTOM: memory-bound workloads, decode-heavy RL loops
especially, plateau well below expected throughput.
- CAUSE: 273 GB/s is a spec ceiling, not sustained;
measured bandwidth runs 180–192 GB/s.
- CHECK:
references/gotcha-checks.md G5 — observed step
time vs. the measured range, not spec.
- FIX: budget throughput from 180–192 GB/s; revise a plan
built on the 273 GB/s figure.
G6: Global UMA Resource Contention
- SYMPTOM: a process's KV cache/weights get evicted
mid-run silently, no OOM in its own logs.
- CAUSE: unified memory is
one global pool; an uncapped
or near-capacity process
competes with anything else
and can evict it. A small,
bounded workload doesn't — a
<4GB LoRA coexists fine
alongside vLLM capped at
gpu-memory-utilization<=0.5.
- CHECK:
references/gotcha-checks.md
G6 — other GPU-resident
processes and whether
capped.
- FIX: the one-heavy-job
rule applies to uncapped or
near-capacity workloads —
cap or stop unrelated servers
first. A small, capped
workload need not
stop.
G7: NVFP4 Slower Than FP8 on SM121
- SYMPTOM: switching an inference workload from FP8 to
NVFP4 on Spark makes it slower, not faster.
- CAUSE: SM121 lacks
cvt.e2m1x2 unless kernels target
sm_121a; NVFP4 runs ~32% slower without it.
- CHECK:
references/gotcha-checks.md G7 — capability
reports (12, 1); does the build target sm_121a?
- FIX: stay on FP8 unless the build targets
sm_121a.
G8: Stale Official Playbooks
- SYMPTOM: following an official DGX Spark playbook still
fails, with no local misconfiguration explaining it.
- CAUSE: official playbooks have shipped broken before;
the stack moves faster than the docs.
- CHECK:
references/gotcha-checks.md G8 — the playbook
repo's recent issues.
- FIX: check
github.com/NVIDIA/dgx-spark-playbooks issues
before trusting a recipe for an expensive run.
G9: Container-First, Not Bare Pip
- SYMPTOM: a bare-pip environment that worked yesterday
breaks after an unrelated
pip install, or two "identical"
environments behave differently.
- CAUSE: bare pip lets Triton, xformers, and transformers
drift independently; nothing pins them to GB10's SM121
target.
- CHECK:
references/gotcha-checks.md
G9 — container or bare pip?
- FIX: prefer an NGC container (see
spark-environment-setup
for tag guidance) or Unsloth's container. If bare pip is
unavoidable, follow the NVIDIA install order, including
--no-deps on Unsloth.
G10: Dual-Spark Is DDP/FSDP Only
- SYMPTOM: a tensor-parallel launch across two Sparks
hangs, runs far slower than single-Spark, or errors out.
- CAUSE: ConnectX-7 is fast enough for gradient/parameter
sync (DDP, FSDP) but too thin for TP's fine-grained traffic.
- CHECK:
references/gotcha-checks.md G10 — the
configured parallelism strategy.
- FIX: on a two-Spark setup, choose DDP or FSDP, never
tensor parallelism — TP is single-node only here.
Fast Triage
The cheapest checks to run before anything else:
python3 -c "import torch; print(torch.version.cuda)" # expect 13.x (G1); NGC builds have no +cu130 tag — that's not a failure
import torch; print(torch.cuda.get_device_capability()) # expect (12, 1) (G7)
{ [ -f /.dockerenv -o -f /run/.containerenv ] || grep -qE 'docker|containerd' /proc/1/cgroup; } 2>/dev/null && echo container || echo unknown # G9
assets/preflight.sh runs G1, G3, G4, G7, G9 and produces one
output line per gotcha in a fixed format: G-number first, then
PASS/FAIL/WARN where automatable, SKIP when unavailable, or
INFO: for a raw reading (G3, G4). Full commands:
references/gotcha-checks.md. See also
spark-environment-setup for the environment assumed working.
Source: wshobson/agents → plugins/dgx-spark-ops/skills/spark-training-gotchas/SKILL.md
1---2name: spark-training-gotchas3description: "Preflight and diagnose the ten known failure modes for ML training on NVIDIA DGX Spark. Use when a training run on DGX Spark fails to start, OOMs below the 128GB limit, slows down mid-run, or before any multi-hour training job on GB10."4category: data-science-and-ml5source_repo: wshobson/agents6source_path: "plugins/dgx-spark-ops/skills/spark-training-gotchas/SKILL.md"7source_url: https://github.com/wshobson/agents/blob/HEAD/plugins/dgx-spark-ops/skills/spark-training-gotchas/SKILL.md8---91011# Spark Training Gotchas1213DGX Spark's GB10 chip (Grace Blackwell, SM121, 128GB unified14memory, aarch64) has ten recurring failure modes across15launch, memory, thermals, bandwidth, and precision. Each is16named G1–G10 so it can be checked by number — the numbering17is load-bearing for tooling that runs these checks. Read this18before a long run, not after hour six.1920## When to Use This Skill2122- A training run fails to start, with an import error or a23 segfault that doesn't point at the real cause.24- A run OOMs while `nvidia-smi` still shows headroom.25- Throughput degrades partway through a run that started fine.26- Before any multi-hour or multi-epoch job on GB10.27- Wiring two Sparks together, before picking a parallelism28 strategy.29- Choosing between FP8 and NVFP4 for a Spark-hosted run.3031## Common Issues Quick Reference3233| # | Symptom | Fix |34|---|---|---|35| G1 | undefined symbol / segfault | cu130 wheel or container |36| G2 | flash-attn wrong backend used | skip pip build; monkeypatch on NGC |37| G3 | OOM despite headroom | drop page cache |38| G4 | throughput drop / reboot | expect ~100W sustained cap |39| G5 | memory-bound step slow | budget 180–192 GB/s |40| G6 | cache evicted mid-run | one GPU server at a time |41| G7 | NVFP4 slower than FP8 | stay FP8 unless `sm_121a` |42| G8 | playbook fails outright | check upstream issues |43| G9 | env breaks after install | use a container |44| G10 | 2-Spark TP hangs | DDP/FSDP only, never TP |4546## The Ten Gotchas4748### G1: CUDA 12/13 ABI Mismatch4950- **SYMPTOM:** `ImportError: undefined symbol` naming a CUDA51 function, or a segfault on the first `.cuda()` call.52- **CAUSE:** most PyPI wheels link `libcudart.so.12`; Spark53 ships CUDA 13. pip never checks CUDA ABI, so it surfaces54 only at import or first kernel launch.55- **CHECK:** `references/gotcha-checks.md` G1 — the wheel's56 CUDA build tag.57- **FIX:** reinstall from `download.pytorch.org/whl/cu130` or58 use a matched container.5960### G2: flash-attn — Skip the pip Build, Watch Unsloth's Auto-Detect6162- **SYMPTOM:** `pip install flash-attn` still fails/hangs.63 Unsloth may also silently train flash-attn over an64 explicitly requested SDPA.65- **CAUSE:** no aarch64/sm_121 wheel for bare pip — but NGC66 containers ship a working SM121 flash-attn, and Unsloth67 auto-prefers it, dropping `attn_implementation="sdpa"`.68- **CHECK:** `references/gotcha-checks.md` G2 — is flash-attn69 already present and working.70- **FIX:** bare pip — skip flash-attn, use SDPA (unchanged). On71 NGC — the only reliable override is the monkeypatch in72 `references/gotcha-checks.md` G2.7374### G3: UMA OOM Below 128GB7576- **SYMPTOM:** OOM during model load/training while77 `nvidia-smi` still reports free memory under the 128GB cap78 — or, on some setups, `[N/A]` outright instead of a number.79- **CAUSE:** mmap and the CUDA allocator double-count pages80 during safetensors load; QLoRA can OOM *earlier* than bf1681 since dequantization adds transient allocs.82- **CHECK:** `references/gotcha-checks.md` G3 — read `free -g`83 and `/proc/meminfo`, not `nvidia-smi`.84- **FIX:** drop the page cache with85 `sync; echo 3 > /proc/sys/vm/drop_caches` — needs root, a86 between-run reset, not a mid-training step.8788### G4: Thermal Throttling8990- **SYMPTOM:** throughput drops partway through a multi-hour91 run, or the box spontaneously reboots under sustained load.92- **CAUSE:** sustained power draw caps around 100W versus the93 240W rated figure; long runs push into that ceiling and94 throttle or, sometimes, reboot.95- **CHECK:** `references/gotcha-checks.md` G4 — sample96 `nvidia-smi --query-gpu=temperature.gpu,power.draw`.97- **FIX:** if power plateaus under 240W while temperature98 climbs, treat throttling as the cause; improve cooling or99 cap run length.100101### G5: Bandwidth Ceiling102103- **SYMPTOM:** memory-bound workloads, decode-heavy RL loops104 especially, plateau well below expected throughput.105- **CAUSE:** 273 GB/s is a spec ceiling, not sustained;106 measured bandwidth runs 180–192 GB/s.107- **CHECK:** `references/gotcha-checks.md` G5 — observed step108 time vs. the measured range, not spec.109- **FIX:** budget throughput from 180–192 GB/s; revise a plan110 built on the 273 GB/s figure.111112### G6: Global UMA Resource Contention113114- **SYMPTOM:** a process's KV cache/weights get evicted115 mid-run silently, no OOM in its own logs.116- **CAUSE:** unified memory is117 one global pool; an uncapped118 or near-capacity process119 competes with anything else120 and can evict it. A small,121 bounded workload doesn't — a122 <4GB LoRA coexists fine123 alongside vLLM capped at124 `gpu-memory-utilization<=0.5`.125- **CHECK:** `references/gotcha-checks.md`126 G6 — other GPU-resident127 processes and whether128 capped.129- **FIX:** the one-heavy-job130 rule applies to **uncapped or131 near-capacity** workloads —132 cap or stop unrelated servers133 first. A small, capped134 workload need not135 stop.136137### G7: NVFP4 Slower Than FP8 on SM121138139- **SYMPTOM:** switching an inference workload from FP8 to140 NVFP4 on Spark makes it slower, not faster.141- **CAUSE:** SM121 lacks `cvt.e2m1x2` unless kernels target142 `sm_121a`; NVFP4 runs ~32% slower without it.143- **CHECK:** `references/gotcha-checks.md` G7 — capability144 reports `(12, 1)`; does the build target `sm_121a`?145- **FIX:** stay on FP8 unless the build targets `sm_121a`.146147### G8: Stale Official Playbooks148149- **SYMPTOM:** following an official DGX Spark playbook still150 fails, with no local misconfiguration explaining it.151- **CAUSE:** official playbooks have shipped broken before;152 the stack moves faster than the docs.153- **CHECK:** `references/gotcha-checks.md` G8 — the playbook154 repo's recent issues.155- **FIX:** check `github.com/NVIDIA/dgx-spark-playbooks` issues156 before trusting a recipe for an expensive run.157158### G9: Container-First, Not Bare Pip159160- **SYMPTOM:** a bare-pip environment that worked yesterday161 breaks after an unrelated `pip install`, or two "identical"162 environments behave differently.163- **CAUSE:** bare pip lets Triton, xformers, and transformers164 drift independently; nothing pins them to GB10's SM121165 target.166- **CHECK:** `references/gotcha-checks.md`167 G9 — container or bare pip?168- **FIX:** prefer an NGC container (see `spark-environment-setup`169 for tag guidance) or Unsloth's container. If bare pip is170 unavoidable, follow the NVIDIA install order, including171 `--no-deps` on Unsloth.172173### G10: Dual-Spark Is DDP/FSDP Only174175- **SYMPTOM:** a tensor-parallel launch across two Sparks176 hangs, runs far slower than single-Spark, or errors out.177- **CAUSE:** ConnectX-7 is fast enough for gradient/parameter178 sync (DDP, FSDP) but too thin for TP's fine-grained traffic.179- **CHECK:** `references/gotcha-checks.md` G10 — the180 configured parallelism strategy.181- **FIX:** on a two-Spark setup, choose DDP or FSDP, never182 tensor parallelism — TP is single-node only here.183184## Fast Triage185186The cheapest checks to run before anything else:187188```bash189python3 -c "import torch; print(torch.version.cuda)" # expect 13.x (G1); NGC builds have no +cu130 tag — that's not a failure190```191192```python193import torch; print(torch.cuda.get_device_capability()) # expect (12, 1) (G7)194```195196```bash197{ [ -f /.dockerenv -o -f /run/.containerenv ] || grep -qE 'docker|containerd' /proc/1/cgroup; } 2>/dev/null && echo container || echo unknown # G9198```199200`assets/preflight.sh` runs G1, G3, G4, G7, G9 and produces one201output line per gotcha in a fixed format: G-number first, then202PASS/FAIL/WARN where automatable, SKIP when unavailable, or203`INFO:` for a raw reading (G3, G4). Full commands:204`references/gotcha-checks.md`. See also205`spark-environment-setup` for the environment assumed working.206207---208209**Source:** [`wshobson/agents`](https://github.com/wshobson/agents) → `plugins/dgx-spark-ops/skills/spark-training-gotchas/SKILL.md`