Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Set up a working ML training/inference environment on NVIDIA DGX Spark (GB10, aarch64, CUDA 13). Use when installing PyTorch/Unsloth/TRL/vLLM on DGX Spark, hitting libcudart or wheel-ABI errors on aarch64, or choosing between NGC containers and bare pip installs.
.claude/skills/wshobson-spark-environment-setup/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 44% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 52% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 24% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 30% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 40% | 0% |
DGX Spark ships a GB10 Grace Blackwell chip: aarch64 CPU, SM121 GPU, 128GB unified memory, CUDA 13. This is a narrower and younger platform than a standard x86 CUDA 12 box, so package selection and ABI matching matter more than usual — the wheel ecosystem for aarch64 + CUDA 13 is still filling in.
libcudart, a missingsymbol, or a wheel that "installed fine but won't load."
fails, hangs, or silently falls back to CPU.
base-image update, needing to re-verify from scratch.
Each of these accepts the same general fix: match the container/wheel combination to CUDA 13 and SM121, don't fight the ABI.
Quick decision, before the detail below:
the pinned Triton/xformers/transformers combination already validated for that path).
→ bare pip, following the exact sequence further down.
Default to a container. Use nvcr.io/nvidia/pytorch:25.09-py3 as the base for general work — the newest tag confirmed working on this hardware; pull a newer blessed tag if locally available rather than hard-blocking on 25.11-py3. NGC's tag is dated, so running it directly is fine:
bashdocker run --runtime=nvidia --gpus all -it --rm \ nvcr.io/nvidia/pytorch:25.09-py3
unsloth/unsloth:dgxspark-latest is a moving tag by contrast — resolve and pin its digest before running it for anything reproducible; the bare tag is a discovery step only, not the default invocation. Full pull-inspect-pin sequence and flag rationale/volume mounts for finetuning/ run dirs: references/container-workflow.md. Treat bare pip as the exception.
The reason for the container-first stance is pinning, not convenience. Triton, xformers, and transformers versions interact narrowly with GB10's SM121 target and CUDA 13; a container locks all of them together against a combination already validated on this hardware. Bare pip leaves that resolution to you, one broken import at a time.
When bare pip is warranted, follow the NVIDIA playbook's install sequence verbatim and in order:
bashpip install "transformers==5.13.1" "peft==0.19.1" "hf_transfer==0.1.9" "datasets==4.3.0" "trl==1.8.0" pip install --no-deps "unsloth==2026.7.2" "unsloth_zoo==2026.7.2" "bitsandbytes==0.49.2" pip install -U "torchao==0.17.0"
The second command's --no-deps flag is not optional — letting pip re-resolve Unsloth's dependency tree on aarch64 is a common way to pull in an incompatible torch or triton build. The third line is not optional either: the NGC base image's bundled torchao is too old for current peft's LoRA-attach path (ImportError: ... torchao ... only versions above 0.16.0 are supported) — a hard blocker, not a warning. Every == pin above is load-bearing, taken from the dated known-good version matrix in references/stack-matrix.md (its Last verified date governs staleness) — an unpinned install resolves current PyPI versions well outside what this Unsloth release supports.
Pull a fresh tag when a new blessed release is announced. Rebuild locally from one of the two bases only when a project needs an extra system package layered in — not to "upgrade" a component the image already pins. Details on both paths: references/container-workflow.md.
One more preflight: official DGX Spark playbooks have shipped broken before. Check recent issues on github.com/NVIDIA/dgx-spark-playbooks (and the other resources in references/stack-matrix.md) before trusting a recipe verbatim for a long run.
The single most common failure on Spark is a CUDA 12/13 ABI mismatch: a wheel built against libcudart.so.12 loaded on a system that only has libcudart.so.13. The install usually succeeds; the failure surfaces later as a missing-symbol error or a segfault that doesn't obviously point at CUDA.
Fix: pull wheels from download.pytorch.org/whl/cu130 (the cu130-tagged aarch64 builds), or use one of the containers above, which already carry a matched build. Before chasing a stack trace that mentions a CUDA symbol, check which CUDA tag the installed wheel was built against:
bashpython3 -c "import torch; print(torch.version.cuda)"
If that output doesn't start with 13, the ABI mismatch is the first thing to fix. NGC container builds (e.g. nvcr.io/nvidia/pytorch:25.09-py3) build torch internally against CUDA 13 with no +cu130 wheel tag — pip show torch won't say cu130 there, and that absence alone is not a failure.
Typical symptoms:
ImportError: undefined symbol referencing a CUDA runtimefunction.
.cuda() call, no useful traceback.pip's resolver doesn't check CUDA ABI, only version constraints.
has a cu130 wheel, the other a cu121/cu124 leftover.
The fix is the same regardless of symptom: match the wheel's CUDA tag to the system, or use a container that already does.
Condensed status for the components most likely to come up. Full table with wheel URLs, build flags, the sm_121 vs sm_121a distinction, and the dated known-good version matrix: references/stack-matrix.md.
| Component | Status | |---|---| | PyTorch | ✅ official cu130 aarch64 wheels | | bitsandbytes | ✅ works out of the box | | Triton | ✅ needs the TRITON_PTXAS_PATH parameter set | | flash-attn | ❌ skip pip build; NGC bundles a working one — see spark-training-gotchas G2 | | xformers | source build only (TORCH_CUDA_ARCH_LIST=12.1) | | vLLM | nightly wheels only | | TransformerEngine / NVFP4 train | container-only |
Everything else — Unsloth, Axolotl, TRL, PEFT — installs cleanly through the container-first path above. LLaMA-Factory and NeMo are fragile on Spark; check upstream issues first.
Confirm the environment can actually see the GPU before running anything expensive:
pythonimport torch print(torch.cuda.is_available(), torch.version.cuda)
This call returns two values; the exact output format is one line, <bool> <cuda-version>:
textTrue 13.0
If it prints False instead, don't jump straight to a wheel reinstall — ABI mismatch is one cause among several:
| Hypothesis | Quick check | |---|---| | Runtime/flags | nvidia-smi fails in-container too | | Device visibility | echo $CUDA_VISIBLE_DEVICES | | Permissions | ls -l /dev/nvidia* | | CUDA init state | wedged process; retry fresh shell/container | | ABI mismatch (usual culprit) | torch.version.cuda not 13.x |
Check nvidia-smi first — if it doesn't show the GPU, it's one of the first three, not ABI. Reinstall a wheel only once ABI is confirmed. Per-hypothesis detail: references/stack-matrix.md. Run right after the container starts, before installing project-specific packages.
One more check: if Triton kernel compilation fails once training starts, set TRITON_PTXAS_PATH=/usr/local/cuda/bin/ptxas and retry — see references/stack-matrix.md for the full workaround list.
A verified environment is only the starting point. See also: spark-training-gotchas for failure preflights before a training run, and spark-memory-thermal-ops for unified-memory OOMs and thermal throttling during long ones.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-05 | pass→pass | 22,140 | 19,447 | -12% | 1 | 1 | 0% | 4,639 | 6,331 | +36% | 0 | 0 | — |
case-06 | pass→pass | 10,441 | 6,937 | -34% | 1 | 1 | 0% | 1,985 | 3,580 | +80% | 0 | 0 | — |
case-01 | fail→pass | 16,832 | 10,572 | -37% | 1 | 1 | 0% | 3,051 | 4,393 | +44% | 0 | 0 | — |
case-02 | fail→pass | 15,862 | 11,428 | -28% | 1 | 1 | 0% | 2,799 | 4,266 | +52% | 0 | 0 | — |
case-03 | fail→pass | 15,294 | 7,290 | -52% | 1 | 1 | 0% | 3,042 | 3,763 | +24% | 0 | 0 | — |
case-04 | pass→pass | 16,141 | 13,679 | -15% | 1 | 1 | 0% | 2,835 | 4,433 | +56% | 0 | 0 | — |
case-07 | fail→pass | 11,216 | 3,432 | -69% | 1 | 1 | 0% | 2,201 | 2,856 | +30% | 0 | 0 | — |
case-08 | fail→pass | 25,586 | 4,713 | -82% | 1 | 1 | 0% | 2,212 | 3,087 | +40% | 0 | 0 | — |
case-09 | pass→pass | 11,468 | 4,870 | -58% | 1 | 1 | 0% | 2,033 | 3,210 | +58% | 0 | 0 | — |
case-10 | pass→pass | 14,467 | 8,017 | -45% | 1 | 1 | 0% | 2,619 | 3,679 | +40% | 0 | 0 | — |
case-11 | fail→pass | 10,317 | 3,248 | -69% | 1 | 1 | 0% | 1,999 | 2,878 | +44% | 0 | 0 | — |
case-12 | fail→pass | 9,763 | 2,860 | -71% | 1 | 1 | 0% | 1,791 | 2,729 | +52% | 0 | 0 | — |
case-13 | pass→pass | 13,777 | 6,422 | -53% | 1 | 1 | 0% | 2,459 | 3,401 | +38% | 0 | 0 | — |
case-14 | pass→pass | 17,113 | 2,538 | -85% | 1 | 1 | 0% | 1,332 | 2,698 | +103% | 0 | 0 | — |
case-15 | fail→pass | 5,442 | 2,638 | -52% | 1 | 1 | 0% | 1,138 | 2,706 | +138% | 0 | 0 | — |
case-16 | pass→pass | 4,878 | 3,184 | -35% | 1 | 1 | 0% | 867 | 2,712 | +213% | 0 | 0 | — |
case-17 | fail→pass | 13,557 | 5,721 | -58% | 1 | 1 | 0% | 2,457 | 3,239 | +32% | 0 | 0 | — |
case-18 | fail→pass | 13,976 | 51,803 | +271% | 1 | 1 | 0% | 2,523 | 3,141 | +24% | 0 | 0 | — |
case-19 | fail→pass | 18,308 | 9,186 | -50% | 1 | 1 | 0% | 3,255 | 3,944 | +21% | 0 | 0 | — |
case-20 | pass→pass | 9,948 | 3,567 | -64% | 1 | 1 | 0% | 1,818 | 2,860 | +57% | 0 | 0 | — |
case-21 | fail→pass | 13,058 | 4,185 | -68% | 1 | 1 | 0% | 2,308 | 3,010 | +30% | 0 | 0 | — |
case-22 | fail→pass | 8,412 | 1,798 | -79% | 1 | 1 | 0% | 1,533 | 2,464 | +61% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +59 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.