Skip to content

Report: the arm64 Studio Docker image runs llama.cpp on the CPU on a DGX Spark (no code changes) - #10491

Closed
danielhanchen wants to merge 1 commit into
mainfrom
report/docker-image-dgx-spark
Closed

danielhanchen wants to merge 1 commit into
mainfrom
report/docker-image-dgx-spark

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Empty diff. This is a report on running the published unsloth/unsloth images on a DGX Spark, following docker/DOCKERHUB.md as written. Two machines, GB10 / sm_121a / aarch64, driver 580.173.02, CUDA 13, 121.69 GiB unified. All runtime work on one node under a GPU lock; images and containers cleaned up afterwards.

The headline: the arm64 latest and studio images ship a CPU-only llama.cpp, and Studio does not say so

Four independent proofs, in order of how hard they are to argue with.

  1. find / -name "libggml-cuda*" inside latest returns nothing. core has it, 206 MB. latest's own UNSLOTH_PREBUILT_INFO.json reads backend: cpu, supported_sms: [], force_cpu: false. Nobody asked for CPU; it is what shipped.
  2. llama-server --list-devices with --gpus all: core prints CUDA0: NVIDIA GB10, latest prints Available devices: (none).
  3. Same 1.2 GB GGUF, -ngl 99, both images: core holds 1524 MiB on the GPU and runs at 135.35 tok/s; latest shows no GPU process at all and runs at 60.54 tok/s. A 2.2x loss.
  4. Through Studio itself: it logs Hardware detected: CUDA -- NVIDIA GB10, returns "backend": "cuda" from its API, reports GPUs free: [(0, 81760)], selects GPU 0 and passes -ngl -1. The engine it then launches takes zero GPU memory. A real chat generated 128 tokens with GPU utilisation flat at 0 percent across 25 consecutive samples.

So on the tag the README points most users to, GGUF inference and Studio chat on a Spark run on the CPU while the UI reports CUDA. It is silent, which is the part that makes it worth fixing rather than documenting.

The mechanism is visible in the layers: core's base records "platform": "linux-arm64-cuda", "bundle_profile": "cuda13-portable", supported_sms including 121, all correct. The Studio layer then installs a linux-arm64-cpu bundle over the same path and carries explicit whiteouts for opt/unsloth/llama.cpp/.wh.libggml-cuda.so and build/bin/.wh.libggml-cuda.so, leaving only libggml-cpu-armv8* and armv9*. Dockerfile.studio line 84 comments that build time "would land on cpu/cu126". Training is unaffected.

What does work

  • core GPU detection: sm_121 bf16=True, torch reports NVIDIA GB10 at capability (12,1), and mem_get_info gives the correct 121.69 GiB total even though nvidia-smi --query-gpu=memory.* returns [N/A] on this part, which is a property of the hardware rather than a container fault.
  • Notebook: the shipped Llama3.2_(1B_and_3B)-Conversational.ipynb ran end to end under nbconvert, 21 cells, 0 errors, the 3B model doing 60 steps in 17.87 minutes at 5110 MiB resident, with correct inference afterwards.
  • Studio serves: HTTP 200 on :8000 and 302 on :8888, 35 seconds after the documented docker run.
  • The cu12.8 versus CUDA 13 mismatch is handled well. The build bakes cuda-nvrtc-13-0 and cuda-nvcc-13-0, and entrypoint.sh's select_cuda_jit_tools() matches compute capability 12.1 and switches to CUDA 13 ptxas and libnvrtc.so.12.cu13. Two things I expected to break did not: NVIDIA_REQUIRE_CUDA stopping at driver<566 does not block on driver 580, and install_nvidia_toolkit.sh is not needed for --gpus all, since the container hook works without the nvidia runtime being registered with the daemon.

dgxspark-latest exists, is better here, and nothing points to it

It is arm64-only, built TORCH_CUDA_ARCH_LIST=12.1a, so native sm_121a rather than PTX JIT, plus PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True. The same 5-step LoRA ran roughly 3x faster per step than on core, 0.08 s against 0.24 s. Indicative rather than a benchmark, but the direction is not subtle.

The string dgxspark appears zero times in DOCKERHUB.md and zero times in the 1.77 MB docs export. The DGX Spark blog page tells readers to build their own image from nvcr.io/nvidia/pytorch:25.09-py3 instead. So a Spark user has three published routes and none of them is the Spark image that already exists on the registry. It is also about seven months behind latest (pt2.10.0 and transformers 4.57.1 against 2.11 and 5.5.0).

Two rough edges on that tag: its entrypoint ignores an appended command, so a container sat up for 15 minutes doing nothing, and it runs as uid 1001, which makes the documented cache mount fail.

Smaller findings

  • No xformers and no flash-attn in arm64 core or latest. Both raise ModuleNotFoundError, and Unsloth's own banner prints FA [Xformers = None. FA2 = False]. The README lists xformers in every image. dgxspark-latest has xformers 0.0.33.post1 and flash_attn 2.7.4.post1.
  • The generic image's TORCH_CUDA_ARCH_LIST tops out at 12.0+PTX, so sm_121 runs by PTX JIT and never a native cubin. The README's "Compiled for ... GB10 (DGX Spark)" overstates that.
  • Notebooks are not baked in; they are fetched from GitHub on every start, and are absent entirely with UNSLOTH_SKIP_NOTEBOOK_SYNC=1. Every notebook's first cell then runs !pip install unsloth over the image's pinned venv.
  • The documented HF cache mount leaves root-owned files in the user's cache, since the container runs as root. This showed up during cleanup rather than in use.
  • The docs link in DOCKERHUB.md redirects to a 404 (docs.unsloth.ai/get-started/install-and-update/docker), so the Hub README is the only working guide.
  • latest and studio are byte-identical, index sha256:981740e0..., arm64 child sha256:967df570..., 13.1 GB over 41 layers. core is sha256:12bbd7c0..., 7.8 GB over 20 layers, and those 20 are exactly the first 20 of latest. Both configs report architecture: arm64. latest also carries a second, divergent Studio venv: same torch and transformers, but TRL 0.23.1 and PEFT 0.18.1 against the main venv's 0.24.0 and 0.20.0.

Suggested order of fixing

  1. The CPU-only llama.cpp in the arm64 Studio layer. It is a silent 2.2x on GGUF and it makes the UI report a backend it is not using.
  2. Point Spark users at dgxspark-latest, or fold its 12.1a arch and its xformers and flash-attn into the generic arm64 image and retire the separate tag. Three published routes and none of them the right one is the real problem.
  3. The 404 documentation link.
  4. The missing xformers and flash-attn on arm64, which the README claims are present.

Happy to re-run any of this, or to test a fix on this hardware.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-09T01:38:55.811826Z d4fc754 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@danielhanchen

Copy link
Copy Markdown
Member Author

Follow-ups from this report:

Still open: whether to route Spark users to dgxspark-latest or fold its 12.1a arch and the xformers and flash-attn wheels into the generic arm64 image, and the missing xformers and flash-attn on arm64, which needs a source build or a cu130 arm64 stack rather than a README change.

danielhanchen added a commit that referenced this pull request Sep 8, 2026
…onical docs link (#10492)

* Docker Hub README: xformers is amd64 only, GB10 runs through PTX, canonical docs link

The Hub page claimed xformers in every image; the arm64 images carry
none because there is no cu128 aarch64 wheel. It also listed GB10 among
the compiled targets while TORCH_CUDA_ARCH_LIST stops at 12.0+PTX, so
sm_121 runs through PTX JIT. The docs link now points at the canonical
Docker page. Reported in #10491.

* Docker Hub README: GB10 runs sm_120 SASS through forward compatibility, only JIT paths need CUDA 13
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 8, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: d4fc754bda

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 9, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

The red check on this PR is Analyze (rust) (CodeQL), conclusion CANCELLED, in run 34217981789. It is a queue timeout, not a finding, and nothing here is blocked by it. Leaving it red deliberately rather than churning CI to turn it green.

It was not a failure. The job log shows rust extraction completing normally: it found studio/src-tauri/Cargo.toml, extracted in 2m39s with only benign macro-expansion warnings, finalized the database (relations: 256.99 MiB, TRAP import complete (30.6s)), and had loaded 26 of 36 query packs when ##[error]The operation was canceled. arrived. The trailing CodeQL job status was configuration error is the action classifying an external cancellation, not something it found in the repository.

Why it was cancelled. The run was created at 10:55:29Z and its jobs did not start until 13:25:00Z, a two and a half hour queue wait. The three sibling analyses are fast and finished by 13:26:31Z; rust takes nine to ten minutes and was the only one still running when the run hit its wall-clock deadline measured from creation, at 13:29:05Z. It was killed for being last, not for anything about this branch.

Not pre-existing, and not supersession. Analyze (rust) succeeds on main: run 33935930077 in 9m47s and run 33929539951 in 9m18s. And this is not a newer push cancelling a concurrency group, which cancels all four analyses at the same instant (as on the recent PR 10301 runs); here only rust died while its three siblings passed, on a single run with run_attempt=1.

It cannot be re-run. This is CodeQL default setup (event: dynamic), so all three retry routes are refused:

POST .../actions/runs/34217981789/rerun-failed-jobs -> 403 "This workflow run cannot be retried"
POST .../actions/runs/34217981789/rerun             -> 403 "This workflow run cannot be retried"
POST .../actions/jobs/102034175014/rerun            -> 403 "Jobs in this workflow run cannot be re-run"

The only way to clear it is a new commit, and this PR is deliberately an empty diff, so there is nothing to push.

Nothing is blocked. main has zero required status checks (required_status_checks returns {"checks":[],"contexts":[]}), so this check gates nothing. Only four workflow runs fired here out of 78 active workflows, because the rest are paths-filtered and an empty diff matches no paths; that is expected and also blocks nothing.

Reopening would fire roughly two dozen workflows into an already saturated queue to turn a cosmetic red green on a PR that gates nothing, so it is not worth it. The durable fix is unrelated to this PR: the Actions queue is oversubscribed enough to push a default-setup CodeQL run past its deadline while it waits, and rust is always the job that pays for it.

@LeoBorcherding

Copy link
Copy Markdown
Collaborator

checked the amd64 side of this on docker desktop (windows, rtx 5060 ti), cant do the arm64 half without a spark. leaving an update, will test more later

@danielhanchen

Copy link
Copy Markdown
Member Author

Reconciling this report against what has actually shipped since. Keeping the PR open deliberately: two of the four items are still open and this is the tracker for them.

1. CPU-only llama.cpp in the arm64 Studio layer: fixed and published

#10495 merged as 0d5743c4e. The published unsloth/unsloth:latest index now resolves to arm64 child sha256:d4c78db65d682b75174083b83bee7ccfdd411bb5c500fe6c96a0c07829397822, built from revision 7bdace6155acbdc404e2c4e9a480b914fee4629f (org.opencontainers.image.revision, created 2026-09-13), and 0d5743c4e is an ancestor of it.

That build cannot ship without the CUDA bundle, because docker/Dockerfile.studio at that revision fails the build outright if either path is missing after install.sh:

for CUDA_SO in /opt/unsloth/llama.cpp/libggml-cuda.so \
               /opt/unsloth/llama.cpp/build/bin/libggml-cuda.so; do
    [ -f "$CUDA_SO" ] || { echo "ERROR: $CUDA_SO is missing after install.sh; ..."; exit 1; }
done

So the whiteouts this report found (opt/unsloth/llama.cpp/.wh.libggml-cuda.so) can no longer appear in a published image. What that does not establish is the Spark runtime result: the 135 vs 60 tok/s and the flat-zero GPU utilisation were measured on GB10 hardware that is not reachable from here. Re-running proof 3 of this report against the digest above is the remaining confirmation, and the offer at the end of the report is the best way to get it.

2. Spark image strategy: still open

Nothing merged decides which image a Spark user should be pointed at. dgxspark-latest still exists, is still arm64-only with TORCH_CUDA_ARCH_LIST=12.1a, and dgxspark still appears nowhere in DOCKERHUB.md. Three published routes and no recommendation is unchanged. This needs a product decision: maintain and document the dedicated tag, fold its 12.1a arch and its accelerators into the generic arm64 image, or retire it with migration guidance. Its two rough edges (the entrypoint ignoring an appended command, uid 1001 breaking the documented cache mount) only matter if the answer is "keep it".

3. The 404 documentation link: fixed and live on Hub

#10492 merged as 7e931e984 and the correction has reached the registry. The live Hub description now reads https://docs.unsloth.ai/get-started/install/docker, which returns 200 with the real page (Install Unsloth via Docker | Unsloth Documentation). The old install-and-update/docker path now redirects to the same page rather than a 404.

The published description is otherwise identical to docker/DOCKERHUB.md on main except for the CPU-start paragraph, which is newer than the last publish and will sync on the next one.

4. Missing xformers and flash-attn on arm64: still open

#10492 corrected the claim ("plus xformers on linux/amd64", live on Hub) but did not add either package to the arm64 images. The gap itself is unchanged, and it is tied to item 2: dgxspark-latest has xformers 0.0.33.post1 and flash_attn 2.7.4.post1, the generic arm64 images have neither.

Summary

item state
1. CPU-only llama.cpp fixed by #10495, present in the published arm64 digest, Spark runtime re-check outstanding
2. Spark image strategy open, needs a decision
3. Docs link fixed by #10492, verified live on Docker Hub
4. arm64 xformers / flash-attn open, only the claim was corrected

Leaving this open as the tracker for items 2 and 4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants