spark-environment-setup

Configure ML training environments on NVIDIA DGX Spark with CUDA 13 aarch64 containers and pinned wheels.

39.3k|4.2k|Updated Jul 24, 2025
One-click install
npx skills add https://github.com/wshobson/agents --skill spark-environment-setup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spark-environment-setup
Source: https://github.com/wshobson/agents/tree/main/plugins/dgx-spark-ops/skills/spark-environment-setup
Command: npx skills add https://github.com/wshobson/agents --skill spark-environment-setup

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Setting up PyTorch, Unsloth, TRL, or vLLM on NVIDIA DGX Spark (GB10, aarch64, CUDA 13) frequently fails with libcudart ABI mismatches, broken wheels, or silent CPU fallbacks because the aarch64 + CUDA 13 wheel ecosystem is still young. This Skill provides verified container images, pinned install sequences, and diagnostic steps to get a working training or inference environment.

Core Features & Use Cases

  • Container-First Setup: Uses the verified NGC PyTorch container (nvcr.io/nvidia/pytorch:25.09-py3) or the Unsloth DGX Spark image with digest pinning for reproducible runs.
  • ABI Mismatch Diagnosis: Detects and fixes CUDA 12/13 wheel mismatches, the most common failure mode, using torch.version.cuda checks and cu130 wheel sources.
  • Pinned Bare-Pip Fallback: Provides the exact NVIDIA playbook install sequence with load-bearing version pins (transformers 5.13.1, unsloth 2026.7.2, torchao 0.17.0) when containers do not fit.
  • Use Case: You just unboxed a DGX Spark and pip install unsloth produced an ImportError: undefined symbol on the first .cuda() call. This Skill walks you through confirming the ABI mismatch, switching to the NGC container, and verifying GPU visibility before training.

Quick Start

Set up a working PyTorch training environment on my DGX Spark and verify the GPU is visible to CUDA 13.

Frequently Asked Questions about spark-environment-setup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up PyTorch on NVIDIA DGX Spark?

Use the NGC PyTorch container `nvcr.io/nvidia/pytorch:25.09-py3` with `docker run --runtime=nvidia --gpus all`, which ships a CUDA 13-matched torch build verified on GB10 hardware. Bare pip is a fallback requiring cu130 wheels from download.pytorch.org.

Why does my DGX Spark install fail with libcudart or undefined symbol errors?

This is a CUDA 12/13 ABI mismatch: a wheel built against libcudart.so.12 loaded on a CUDA 13-only system. Check `torch.version.cuda`; if it does not start with 13, reinstall cu130-tagged wheels or use an NGC container.

Should I use NGC containers or bare pip on DGX Spark?

Default to containers: NGC PyTorch for general work, the Unsloth DGX Spark image for Unsloth fine-tuning. Use bare pip only when containers genuinely do not fit, and then follow the pinned NVIDIA playbook sequence exactly with `--no-deps` for Unsloth.

Does flash-attn work on DGX Spark GB10?

No. flash-attn has no sm_121 kernels shipped or buildable yet, so skip the pip build. PyTorch's SDPA backend is faster on this hardware anyway, and the NGC container bundles a working alternative.

Why does torch.cuda.is_available() return False inside my container?

Check `nvidia-smi` inside the container first. Missing `--runtime=nvidia --gpus all` flags, an explicitly empty CUDA_VISIBLE_DEVICES, or /dev/nvidia* permission issues are more likely causes than an ABI mismatch.

How do I make Unsloth runs reproducible on DGX Spark?

The `unsloth/unsloth:dgxspark-latest` tag moves, so resolve it with `docker inspect` and run by the pinned `@sha256:` digest. Re-resolve the digest whenever picking up a new blessed release.