Resolving CUDA Version Mismatch | Generated by AI
π¦ Driver Upgrade Review: 570 β 580
Problem
llama.cpp compiled against CUDA 13.2 toolkit, but driver 570 only supports CUDA 12.8. Every GPU init call failed with:
ggml_cuda_init: failed to initialize CUDA: CUDA driver version is insufficient for CUDA runtime version
What I Did
1. Diagnosed the mismatch
nvidia-smiβ driver 570.211.01, CUDA 12.8nvcc --versionβ CUDA 13.2.51- The runtime (
libcudart.so.13) checks driver version atcuInit()and bails because driver 570βslibcuda.sodoesnβt support the 13.x ABI
2. Attempted link-time workarounds (failed)
- LD_PRELOAD with CUDA 12.2βs
libcudart.so.12β didnβt work because thelibggml-cuda.sohas hardcodedNEEDEDentries forlibcudart.so.13,libcublas.so.13,libcublasLt.so.13. The dynamic linker resolves those before checking LD_PRELOAD - patchelf to swap
*.so.13β*.so.12β got past the soname check but hitversion 'libcudart.so.13' not foundbecause the binary has symbol version bindings from the 13.x ABI that donβt exist in 12.x. Compile-time ABI mismatch, canβt be shimmed
3. Clean fix: upgrade the driver
- Checked
apt-cache searchβnvidia-driver-580available in the repo - Dry-run showed clean upgrade path replacing all 570 packages
- Hit one file conflict:
libnvidia-extra-570owned/usr/lib/x86_64-linux-gnu/gbm/nvidia-drm_gbm.sowhich 580βslibnvidia-gl-580also wanted. Purged the leftover 570 package, ranapt install -fto complete - DKMS built kernel modules for 6.8.0-107
4. Ready for reboot
- Driver 580 supports CUDA 13.x β no more version mismatch
- llama.cpp needs a clean rebuild after reboot (cmake configure is already done)
- Single
make -j$(nproc) llama-serverand launch with-ngl 99
Why 580 Instead of Rebuilding with CUDA 12?
- CUDA 12.2 runtime libs were present but no nvcc 12.2 compiler β only nvcc 13.2 installed
- Installing nvcc 12.2 would require
cuda-nvcc-12-2package + full rebuild, and weβd still be on an older toolkit long-term - Driver upgrade is a one-time fix that makes the existing CUDA 13.2 toolkit work permanently
Current State
| Item | Status |
|---|---|
| nvidia-driver-580 packages | β Installed |
| DKMS modules (6.8.0-107) | β Built |
| CMake configure | β Done |
| Kernel module loaded | β³ Needs reboot |
| llama-server built | β³ After reboot |
| GPU inference | β³ After reboot |