Skip to content

Run frontier MoE models on hardware you already own β€” pure C, zero deps, experts streamed from disk. Tiny engine, immense model. 🐦

C
1.7 KB
Raw Blame

Building the CUDA backend on glibc β‰₯ 2.41 (Debian trixie and newer)

Author: Peter Groom Β· 2026-07-18

Symptom: make glm CUDA=1 fails with four errors like

mathcalls.h(79): error: exception specification is incompatible with that of
previous function "cospi" (declared at ... crt/math_functions.h)

Cause: glibc 2.41 added C23 sinpi/cospi/sinpif/cospif with exception specs that clash with CUDA ≀ 12.9's math_functions.h declarations. CUDA 13.x headers fix it.

Recipe that needs neither root-owned toolkits nor distro driver packages (safe next to a .run-installed or dkms driver β€” important in LXC setups where userland must match the host kernel module version):

# micromamba (single static binary) + NVIDIA's conda channel = complete nvcc
curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xj -C /opt bin/micromamba
/opt/bin/micromamba create -y -p /opt/cuda13 -c nvidia -c conda-forge cuda-nvcc=13 cuda-cudart-dev=13
ln -s /opt/cuda13/lib /opt/cuda13/lib64      # Makefile expects lib64; conda ships lib

make glm CUDA=1 CUDA_ARCH=sm_86 CUDA_HOME=/opt/cuda13   # your arch here

The binary links libcudart.so.13 dynamically β€” ship it next to the binary and run with LD_LIBRARY_PATH, or drop it in /usr/local/lib. Driver β‰₯ the runtime's minimum is the only host requirement (any recent driver runs CUDA 13 binaries).

Dead ends, for the record: Debian's nvidia-cuda-toolkit hard-depends on Debian's driver userland (version-clashes a .run/dkms driver β€” and its nvidia-installer-cleanup postinst will try to delete your hand-installed userland); pip's nvidia-cuda-nvcc-cu12 wheel ships only ptxas, not the compiler frontend.