Skip to main content
skill Claude Code CX Codex Cursor

spark-training-gotchas — Claude Code skill: setup and gotchas

Diagnoses ten known ML training failure modes on NVIDIA DGX Spark GB10. It catches memory leaks, power throttling, and CUDA mismatches early.

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add wshobson/agents
/plugin install dgx-spark-ops@claude-code-workflows
Open on GitHub

What spark-training-gotchas does

The skill organizes ten recurring hardware and software failure modes (labeled G1 through G10) on the DGX Spark GB10 chip. It flags CUDA 12 and CUDA 13 ABI mismatches, power throttling around 100W, and bandwidth bottlenecks.

It guides checks against references/gotcha-checks.md before long runs start. The guide details why unified memory triggers out-of-memory errors below the 128GB limit and how dropping page caches needs root permissions. It also steers you away from bare pip setups toward NGC containers.

Use this skill before launching multi-hour jobs on DGX Spark. You do not need it on other hardware.

What it helps with

  • catch out-of-memory errors that occur below the 128GB limit
  • resolve CUDA 12 and CUDA 13 ABI mismatch errors
  • detect thermal throttling when power hits the 100W sustained ceiling
  • configure DDP or FSDP parallelism across two DGX Spark systems

Example prompts for the agent

  • Run preflight checks on DGX Spark before starting the training job
  • Why does my training run crash with an OOM error when free memory remains?
  • Check if my dual DGX Spark cluster can support tensor parallelism

How to install spark-training-gotchas

1Plugin marketplace

/plugin marketplace add wshobson/agents
/plugin install dgx-spark-ops@claude-code-workflows

This installs the whole dgx-spark-ops plugin with all its skills

2Skills CLI (Vercel)

npx skills add wshobson/agents --skill spark-training-gotchas -a claude-code

3Manually: put the files in place

~/.claude/skills/spark-training-gotchas/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/spark-training-gotchas/

From the same set213

The whole set →
typescript-advanced-types Seth Hobson Guides an agent through advanced TypeScript types, from generics to conditional and mapped types. Use it for typed libraries, API clients, or strict configuration objects. Claude Code CX Codex Cursor 92,169installs tailwind-design-system Seth Hobson Helps build design systems with Tailwind CSS v4, from theme tokens to component variants. Use it when a project needs shared UI patterns. Claude Code CX Codex Cursor 70,180installs brand-landingpage Travis D. Elliott This skill interviews you about the product and its visual direction, then builds a landing page through Stitch. Use it when there’s no established design yet. Claude Code CX Codex Cursor 39,476installs python-testing-patterns Seth Hobson This skill guides Python testing with pytest, fixtures and mocks. Use it when building a test suite or tracking down failing checks. Claude Code CX Codex Cursor 36,943installs python-performance-optimization Seth Hobson This skill profiles Python code to locate CPU and memory bottlenecks. Use it when an application responds slowly or consumes too many resources. Claude Code CX Codex Cursor 35,675installs nextjs-app-router-patterns Seth Hobson This skill covers Next.js App Router patterns for rendering, routing, and data fetching. Use it when starting an App Router project or moving from Pages Router. Claude Code CX Codex Cursor 32,529installs api-design-principles Seth Hobson Use this skill to plan or review REST and GraphQL APIs. It helps when writing a specification or setting API conventions for a team. Claude Code CX Codex Cursor 30,348installs code-review-excellence Seth Hobson This skill guides pull request reviews, catches logic and security issues, and helps teams give specific feedback. Use it for review standards or developer mentoring. Claude Code CX Codex Cursor 30,193installs

Similar

gke-ai-troubleshooting-node-unresponsive-timeout official google Diagnoses unresponsive GKE TPU and GPU nodes stuck in NodeStatusUnknown. Pinpoints kernel panics and missing kubelet heartbeats when node auto-repair is disabled. Claude Code Gemini CLI CX Codex 810installs gke-ai-troubleshooting-tpu-performance-degradation official google This skill investigates Cloud TPU training slowdowns in GKE and separates hardware or network limits from workload resource bottlenecks. Use it when jobs keep running but training steps take longer. Claude Code Gemini CLI CX Codex 691installs from-the-other-side-vega official github Behavioral patterns and principles from an AI partnership to guide agent interaction. It teaches the agent to match creative pace, push back, and admit gaps. GitHub Copilot 746installs api-gateway-mcp-server official google Configures Google Cloud API Gateway as a remote MCP server over HTTP. It exposes REST APIs as tools for AI agents using annotated OpenAPI 3.x specs. Claude Code Gemini CLI CX Codex 499installs skill-creator official anthropics Creates and refines skills, then tests them with prompts, evaluations, and performance checks. Claude Code Claude.ai 414,180installs writing-for-agents Matt Pocock Guidance for writing skills and agent-facing documents. Use it when editing AGENTS.md, CLAUDE.md, or reference files reached from them. Claude Code 466,719installs media-use heygen-com Finds or generates media for HyperFrames videos, including voiceovers, music, cutouts, and color grades. Stores files locally in assets. Claude Code CX Codex Cursor +1 1,100,000installs mcp-builder official anthropics This skill walks through building an MCP server in TypeScript or Python, from reading the protocol spec to writing tests and evaluation questions. Claude Code Claude.ai 130,949installs

Questions about spark-training-gotchas

How do I install spark-training-gotchas in Claude Code?

Run /plugin marketplace add wshobson/agents and then /plugin install dgx-spark-ops@claude-code-workflows. Alternatively, run npx skills add wshobson/agents --skill spark-training-gotchas -a claude-code.

What does spark-training-gotchas do?

It audits DGX Spark setups across ten known issues before ML runs fail. It spots ABI bugs, thermal limits, and memory contention.

Why does tensor parallelism hang across two DGX Spark machines?

ConnectX-7 networking handles gradient synchronization in DDP or FSDP cleanly. It lacks the throughput needed for fine-grained tensor parallel traffic, which causes runs to stall.

Source text

SKILL.md · MIT
---
name: spark-training-gotchas
description: 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.
---

# 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:

```bash
python3 -c "import torch; print(torch.version.cuda)"  # expect 13.x (G1); NGC builds have no +cu130 tag — that's not a failure
```

```python
import torch; print(torch.cuda.get_device_capability())  # expect (12, 1) (G7)
```

```bash
{ [ -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.

© Seth Hobson · MIT · wshobson/agents

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor