Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

llama-pascal

A repeatable pipeline that builds the latest llama.cpp release — CPU/OpenBLAS + CUDA sm_60 (P100) — on GitHub-hosted runners, and packages it two ways: a binaries tarball and a llama-cpp-pascal Debian package.

Why it exists: CUDA 13 dropped Pascal (sm_60). No stock or upstream llama.cpp binary runs on P100s, so this repo is the source of that build.

Older NVidia Tesla / P100 GPUs are widely available 2nd hand (see: newegg.com) for relatively low $/vram costs and are better than CPU inference.

Custom/community build. This is a personal, community-maintained build of upstream llama.cpp for one specific use case: Pascal (P100) GPUs on a Debian trixie home fleet. It is not an official llama.cpp distribution; it tracks upstream releases rather than carrying patches. It should run on any reasonably modern Debian trixie x86-64 host, but the tested-on infrastructure is the tree below.

Tested on

  • Proxmox VE 9.x host, x86-64-v3 CPU (test host: Intel i9-14900K — AVX2 + AVX-VNNI + BF16, no AVX-512).
  • Debian 13 (trixie) LXC containers with GPU passthrough — a working sample config is in docs/lxc.conf.sample.
  • 2× NVIDIA Tesla P100 (Pascal, sm_60, 16 GB each).
  • Original GGUF test target: Qwen3.8-27B (unsloth GGUFs). The best quant tested that runs well in the 128k-256k context: Q4-6.

Target platform supported

  • CPU: any x86-64-v3 (AVX2/FMA floor) Linux glibc ≥ 2.39 (floor = the build host's glibc, Ubuntu 24.04 — glibc is forward-compatible, R41); OpenBLAS expected at runtime (libopenblas0).
  • GPU: NVIDIA Pascal sm_60 with a 580-series driver (verified on 580.178.04). The driver branch MUST match the CUDA toolkit the build was made with — this build uses CUDA 12.9, whose branch is 580.x. A 535-series driver does not work with it (older 12.x driver branches are not forward-compatible with newer 12.x runtimes; see REASONING.md R35).
  • CUDA 12.x only — 13.x cannot target sm_60.
  • Build host (CI): GitHub-hosted ubuntu-24.04 with the CUDA 12.9 toolkit — a compiler source only; the build machine needs no GPU. A GPU is needed to run CUDA inference, never to build.

Building

gh workflow run build                 # latest upstream release (bNNNN)
gh workflow run build -f llama_tag=bNNNN   # pinned tag

The build workflow is check→build→publish. On green, the build's release is published in the run itself as a versioned prerelease:

  • Release tag nightly-bNNNN (prerelease, never latest), --target this repo's build commit, notes carry the upstream tag + commit + source tarball sha256.
  • Four assets, bare names so sha256sum -c works next to any of them: llama-cpp-pascal_0.0.bNNNN-1_amd64.deb, .deb.sha256, llama-bins-bNNNN-cuda.tar.gz, .tar.gz.sha256.
  • Retention: only the 3 newest nightly-b* releases are kept; the prune is prefix-guarded so a final llama-cpp-b* release can never be touched.

A green build run automatically triggers release-latest, which promotes the fresh nightly-bNNNN to a final llama-cpp-bNNNN release. You can still dispatch release-latest manually for backfills or to promote a specific nightly.

Promoting a build

gh workflow run release-latest                     # newest nightly-b*
gh workflow run release-latest -f tag=nightly-bNNNN  # a specific one

The release-latest workflow promotes the nightly to a final llama-cpp-bNNNN release: it downloads the nightly's 4 assets, verifies every checksum (sha256sum -c — the one real verification step in the pipeline), re-publishes them under the final tag, and keeps only the 3 newest llama-cpp-b* (older finals are pruned; same prefix-guarded retention as the nightly lane). It never rebuilds and never touches the nightly. Auto-promotion runs on a weekly schedule (Sunday 04:00 UTC) and can be triggered manually; the check job skips if upstream hasn't moved.

Release API writes run under a repo-scoped PAT secret; everything else under the default token (see docs/nightly-release-design.md and REASONING.md R27–R30 for why).

Installing

Tarball

sha256sum -c llama-bins-bNNNN-cuda.tar.gz.sha256
tar xzf llama-bins-bNNNN-cuda.tar.gz
./llama-cli -m model.gguf -p "hi" -n 32 -st   # bounded CLI invocation

The tarball is a shared-library build: the tools plus libllama.so/libggml*.so and the CUDA runtime all sit flat at the top of the archive, and RUNPATH=$ORIGIN makes them run in place. Host requirements (apt packages, driver) are in share/doc/llama-cpp-pascal/dependencies.md inside the archive — the same doc the .deb installs.

GPU vs CPU at runtime: -ngl 99 (all layers to GPU) vs -ngl 0.

The CUDA stub story — the binary links (not dlopen's) the driver API, so libcuda.so.1 must be resolvable at load, even for --version, on every execution of the unified binary:

  • On a GPU box, the 580-series driver provides libcuda.so.1 and everything just works.
  • On a GPU-less box, the CUDA toolkit's …/lib64/stubs/libcuda.so provides it: the file name is unsuffixed but its SONAME is libcuda.so.1, so no plain path setting can satisfy the loader — you must symlink it to libcuda.so.1 somewhere on the search path. The stub is a valid no-op shared object: every CUDA call fails cleanly, ggml_cuda_init logs and returns, and CPU/OpenBLAS inference and --version work perfectly (-ngl > 0 is the only thing that needs a real driver). This is exactly how the CI build host itself runs the unified binary — no fabricating any stub, only the toolkit's own.
  • The .deb does not ship a driver stub (the NVIDIA stub is proprietary, so we can't redistribute it either). On a box with no NVIDIA driver libs at all it will fail at load — add a libcuda.so.1 symlink yourself (e.g. to the toolkit stub above) or this box can still CPU-infer fine.

Debian package (.deb)

Installs the full toolset of thin binaries in /usr/bin/, the shared libraries (libllama/libggml*) + vendored libcudart.so.12 in /usr/lib/llama-cpp/, a llama system user, a llama-cpp systemd service (enabled; state in /var/lib/llama-cpp/{models,cache}), and the runtime-dep doc at /usr/share/doc/llama-cpp-pascal/dependencies.md — the install host needs no NVIDIA apt repo (Depends: pulls libstdc++6/libgomp1/OpenBLAS automatically):

apt install ./llama-cpp-pascal_0.0.bNNNN-1_amd64.deb
systemctl status llama-cpp

Verified end-to-end on a no-GPU Debian 13 LXC (install / reinstall / remove / purge all behave; the service starts as llama, auto-discovers *.gguf from the models dir on scan, serves completions — CPU inference confirmed). The only open gap is the no-driver libcuda.so.1 load case (stub story above). Details: REASONING.md R12/R13/R25.

Testing

  • scripts/test.py — smoke: a 0.5B model must answer "What is the capital of France?" with Paris (up to 3 attempts per mode); CPU (-ngl 0) must always pass; CUDA (-ngl 99) must show real tensor offload, or SKIPs loudly while no GPU is present. Model pin: models/TINY-GGUF.md.
  • No CI validation lane. GPU validation is not a CI job — it happens on the operator's live fleet (the Debian 13 LXC on Proxmox with passthrough P100s, see "Tested on"); the hosted build workflow is self-sufficient.
  • All workflow runs are manual (workflow_dispatch) or scheduled, concurrency: 1.

Repository layout

scripts/       build.py (The Build), nightly_check.py, test.py, sanity.py
deb-src/       deb staging TREE for --with-deb (see deb-src/README.md)
models/        smoke model pin
.github/       build.yaml (build lane), release-latest.yaml (promotion lane)

Credits

Where to read

Doc For
README.md (this file) What/why/how, humans
REASONING.md Persistent findings, build lessons, failure signatures — grep before exploring
docs/nightly-release-design.md Release design + the token fix
docs/dependencies.md Runtime deps + install notes; ships inside BOTH distributions

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages