Skip to content

[Bug] A failed llama.cpp prebuilt install silently falls back to a CPU-only build on a CUDA host #9255

Closed

Description

@HughScott2002

When the prebuilt llama.cpp cannot be installed, the installer compiles from source; with no nvcc present that build is CPU-only, and the install still reports success. GPU inference is lost with no warning.

Environment

Where are you using Unsloth?

  • Studio desktop application
  • Studio web UI (unsloth studio)
  • Unsloth CLI
  • Python package or notebook
  • Colab or Kaggle

Installed with the developer/source flow: ./install.sh --local.

Operating system and version:
NixOS 25.11 (kernel 6.12.93)

GPU model(s) and accelerator backend:
NVIDIA GeForce RTX 4070 Laptop GPU (sm_89), CUDA 13.0, driver 580.142

Versions:

  • Unsloth 2026.8.18 (repo commit 6e5360ca9)
  • Python 3.13.12, torch 2.11.0+cu130
  • llama.cpp prebuilt (after the problem was worked around): b10472-mix-4b653db

What happened?

Steps to reproduce:

Any failure of the prebuilt install path reproduces this. I hit it via two
independent triggers on the same machine:

  1. Download failure. The installer's Python cannot verify TLS, so every
    release lookup fails. Equivalent to being behind a TLS-inspecting proxy,
    offline, or a GitHub outage.
  2. Binary preflight failure. The prebuilt downloads and its sha256 verifies,
    then the extracted binaries fail the preflight because three shared libraries
    are not on the preflight's LD_LIBRARY_PATH.

Then, on a host with the NVIDIA driver present but no nvcc on PATH, run
./install.sh --local and let the source-build fallback complete.

Expected behavior:

Falling back from a GPU-capable prebuilt to a CPU-only source build is a major
capability regression, so it should be loud: a prominent warning at the end of
the install stating that GPU acceleration is unavailable and why, or a hard
failure with instructions, rather than being reported as a normal success.

Actual behavior:

The fallback happens quietly. The only hint is a single parenthetical mid-log,
and the run finishes with the standard success banner and exit code 0:

[llama-prebuilt] prebuilt install path failed; falling back to source build
...
                 building (CPU, CUDA driver found but nvcc missing)...
...
  llama.cpp      built
  ────────────────────────────────────────────────────
  Unsloth Studio Installed

Note the wording CUDA driver found but nvcc missing — the installer has
already determined that this is a CUDA machine and that it is about to produce a
build that cannot use it, but that conclusion is not surfaced to the user. The
resulting llama-server reports Available devices: (none) on a working 4070.

Because the install "succeeded", the natural next step is to start Studio and
use it, at which point GGUF inference runs on the CPU indefinitely with nothing
indicating the GPU was dropped. The source build is also missing OpenMP
(OpenMP not found during cmake), so it is not merely CPU — it is CPU without
thread-level parallelism.

Model and operation involved:

Installation, and subsequently any GGUF / llama.cpp inference.

Diagnostics and logs

Trigger 1 — release lookup fails, straight to source build:

[llama-prebuilt] no existing llama.cpp install detected at /home/<user>/.unsloth/llama.cpp; performing fresh prebuilt install
[llama-prebuilt] fetch failed (1/4) for https://api.github.com/repos/unslothai/llama.cpp/releases?per_page=100&page=1: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] ...>; retrying
[llama-prebuilt] prebuilt install path failed; falling back to source build
[llama-prebuilt] prebuilt fallback reason: failed to inspect published releases in unslothai/llama.cpp: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] ...>
                 building (CPU, CUDA driver found but nvcc missing)...

Trigger 2 — archive downloads and verifies, then preflight rejects it:

[llama-prebuilt] verified prebuilt archive app-b10472-mix-4b653db-linux-x64-cuda13-older.tar.gz sha256=7c1cc220...
[llama-prebuilt] prebuilt install path failed; falling back to source build
[llama-prebuilt] prebuilt fallback reason: linux extracted binary preflight failed:
llama-server: missing=libstdc++.so.6,libssl.so.3,libcrypto.so.3 ld_library_path=<staging>/build/bin,<staging>,<venv>/torch/lib
llama-quantize: missing=libstdc++.so.6,libssl.so.3,libcrypto.so.3 ld_library_path=<staging>/build/bin,<staging>,<venv>/torch/lib

Both selected the correct asset beforehand, so this is purely a fallback-path
problem, not a selection problem:

linux_cuda_selection: detected_sms=89
linux_cuda_selection: compatible_runtime_lines=cuda13
linux_cuda_selection: accept ...cuda13-older.tar.gz coverage=75-89 supported=75,80,86,89
selected app-b10472-mix-4b653db-linux-x64-cuda13-older.tar.gz

Resulting CPU-only binary on a working GPU:

$ llama-server --list-devices
Available devices:
  (none)

After installing the prebuilt successfully, the same command on the same machine:

$ llama-server --list-devices
Available devices:
  CUDA0: NVIDIA GeForce RTX 4070 Laptop GPU (7805 MiB, 7626 MiB free)

Additional context

Closely related precedent: #7208 ([ROCm] llama-server silently falls back to CPU on native Linux AMD) — same failure class, different trigger, treated as a bug
and fixed. This is the CUDA/source-build-fallback instance of it.

Suggested fix, roughly in order of value:

  1. When the source-build fallback is selected on a host where a GPU was
    detected, print a clearly-marked warning in the final summary — not only
    mid-log — stating that GPU acceleration is unavailable and giving the
    fallback reason.
  2. Record the degraded state so Studio can surface it in the UI, the way an
    uncovered-GPU prebuilt is surfaced.
  3. Consider making it opt-in: fail with an explanation and let the user pass a
    flag (--allow-cpu-build or similar) to accept a CPU-only build, since on a
    CUDA host it is rarely what the user wants.

Not NixOS-specific. Trigger 1 is reachable by anyone behind a corporate proxy or
TLS-inspecting firewall, installing offline, or hitting a GitHub outage.

Activity

  1. S-ABISHEAK commented on Aug 19, 2026

    @S-ABISHEAK

    Hi, I'd like to work on this.

    Went through studio/setup.sh to see why this doesn't warn. The banner at the end ("limited: llama.cpp unavailable") is gated on _LLAMA_CPP_DEGRADED, and that only gets flipped when there's no llama-server binary produced at all i.e. a hard build failure. In your case the build actually succeeds, just without CUDA, so that flag never fires.

    _BUILD_DESC="building (CPU, CUDA driver found but nvcc missing)"
    so it's correctly detected a GPU driver with no nvcc, and set a message saying exactly that. Problem is _BUILD_DESC only feeds one substep log line mid-install, then just gets overwritten later. Nothing carries that info forward to the footer.

    Fix I'm going with:

    New flag, something like _LLAMA_CPP_GPU_LOST, set next to _BUILD_DESC in both the CUDA and ROCm "driver present, compiler missing" branches.
    Have the footer check that flag too (same place _LLAMA_CPP_DEGRADED is checked), so you actually get the "(limited: ...)" banner with a reason like "GPU detected but nvcc missing CPU-only build".
    Keeping the --allow-cpu-build / hard-fail idea out of this PR so the diff stays small can do it as a follow-up if maintainers want it.

    Will link a PR here shortly.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions