RUNLOCALAIv38
->Will it run?Best GPUCompareTroubleshootStartLearnPulseModelsHardwareToolsBench
Run check
RUNLOCALAI

Independently operated catalog for local-AI hardware and software. Hand-written verdicts. Source-cited claims. Reproducible commands when we have them.

OP·Eruo Fredoline
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
TOOLS
  • Will it run?
  • Compare hardware
  • Cost vs cloud
  • Choose my GPU
  • Prompting kits
  • Quick answers
REF
  • All buyer guides
  • Learn local AI
  • Methodology
  • Glossary
  • Errors KB
  • Trust
EDITOR
  • About
  • Author
  • How we make money
  • Editorial policy
  • Contact
LEGAL
  • Privacy
  • Terms
  • Sitemap
MAIL · MONTHLY DIGEST
Get monthly local AI changes
Monthly recap. No spam.
DISCLOSURE

Some links on this site are affiliate links (Amazon Associates and other first-class retailers). When you buy through them, we earn a small commission at no extra cost to you. Affiliate links do not influence our verdicts — there are cards we rate highly that we don't have affiliate relationships with, and cards that sell well that we refuse to recommend. Read more →

© 2026 runlocalai.coIndependently operated
RUNLOCALAI · v38
Errors / Build / compile failures / llama.cpp CUDA build: unsupported GNU version! gcc versions later than X are not supported
Build / compile failures

llama.cpp CUDA build: unsupported GNU version! gcc versions later than X are not supported

error: unsupported GNU version! gcc versions later than 13 are not supported
By Eruo Fredoline · Last verified May 8, 2026

Cause

Each CUDA toolkit version supports a bounded range of host compilers. CUDA 12.4 supports gcc up to 13; CUDA 12.6 supports up to 14. Modern distros (Ubuntu 24.04, Fedora 40) ship gcc 14 by default, which fails against an older CUDA toolkit.

Solution

1. Install a supported gcc version side-by-side:

# Ubuntu
sudo apt install gcc-12 g++-12

# Fedora
sudo dnf install gcc-toolset-12

2. Point the build at it:

# CMake
cmake -B build -DGGML_CUDA=ON \
  -DCMAKE_C_COMPILER=gcc-12 \
  -DCMAKE_CXX_COMPILER=g++-12 \
  -DCMAKE_CUDA_HOST_COMPILER=g++-12

# Make
make GGML_CUDA=1 \
  CC=gcc-12 CXX=g++-12 \
  NVCCFLAGS="-ccbin g++-12" -j

3. Or update CUDA to a newer toolkit that supports your default gcc. CUDA 12.6+ supports gcc 14.

4. Quick override if you don't want to change the system gcc:

export NVCC_PREPEND_FLAGS='-allow-unsupported-compiler'

This is a hack — works often, fails on subtle ABI incompatibilities. Prefer a real fix.

Related errors

  • llama.cpp build fails: nvcc not found
  • llama.cpp build fails: nvcc not found / CUDA toolkit missing
  • exllamav2 ImportError: cannot import name 'ExLlamaV2' / undefined symbol
  • flash-attn install fails on Windows / no precompiled wheel

Did this fix it?

If your case was different, email Contact support with what you saw and we'll update the page. If it worked but took different commands on your platform, we want to know that too.