mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #601] Linux build fails on Ubuntu 26.04 (glibc 2.43) with CUDA 12.9 (nvcc host-math conflict) #281
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#281
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @zimuhuan-code on GitHub (Oct 3, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/601
Environment
ldd --version→ 2.43-2ubuntu2.3)/usr/local/cuda-12.8,/usr/local/cuda-12.9;/usr/local/cuda→ 12.9)g++= 15)db4f91a, Linux source tree. (v0.1.38 came out the same day; itsfind_nvcc()is byte-identical to 0.1.37's, so this should still reproduce there.)Problem 1 — default gcc is too new for the CUDA headers
Workaround:
CXX=/usr/bin/g++-14 CUDAHOSTCXX=/usr/bin/g++-14 ./setup.sh …(a successful run prints
[ok] build tools present (CUDA 12.8)and later[ok] engine compiled: …)Problem 2 — CUDA 12.9 host-math declarations conflict with glibc 2.43 (appears once #1 is fixed)
… same for
sinpi,rsqrt,cospif,sinpif,rsqrtf⇒6 errors detected in the compilation of "t.cu".CMake's compiler probe is itself the first CUDA compile, so it fails there —
Compiling the CUDA compiler identification source file "CMakeCUDACompilerId.cu" failed— i.e. nothing of Strata is compiled.Minimal reproduction — no Strata code needed:
Tried and it did not help:
-D__GLIBC_USE_IEC_60559_FUNCS_EXT_C23=0(glibc re-defines that macro in
bits/libc-header-start.hL96–102, so a command-line define is overwritten).Why the obvious workaround fails
find_nvcc()(v0.1.37,setup.pyL701–722) builds its candidate list fromshutil.which("nvcc")plus every toolkit under
/usr/local/cuda*and/opt/cuda*, then keeps the highest version(the loop comment says "every toolkit found; the newest wins"). So pointing
PATHat 12.8 does nothelp — 12.8 is found and evaluated, but loses the version comparison to 12.9.
Workaround we used (patch shown as an illustration, applied to v0.1.37's
find_nvcc()):then
STRATA_NVCC=/usr/local/cuda-12.8/bin/nvcc CUDAHOSTCXX=/usr/bin/g++-14 CXX=/usr/bin/g++-14 ./setup.sh …Suggestion (any of these would unblock new Linux distros)
--nvcc <path>(or honourSTRATA_NVCC) — the codebase already filters toolkits by version for thePascal/Volta path (
find_nvcc(below=(13, 0))), so a user-facing override fits the existing design.(
CUDA_HOMEis not read — only Windows-styleCUDA_PATH— so on Linux there is currently no way in.)third_party/llama.cpp/docs/build.md§"Fixing Compatibility Issues with Old CUDA and New glibc" (L231–259)shows the same
cospi/math_functions.herror and patches the CUDA headers to addnoexcept (true)to
cospi/cospif/sinpi/… Strata pins llama.cpp3cf03257f219…(setup.pyL92), so the conflict and itsupstream-sanctioned workaround are already in the dependency tree — worth linking from TROUBLESHOOTING.
@Niko1221 commented on GitHub (Oct 4, 2026):
Thanks for the minimal reproduction. In 0.1.39
STRATA_NVCC=/usr/local/cuda-12.8/bin/nvcc ./setup.sh ...makes setup use that toolkit and only that one, andCUDA_HOMEis now looked at too. TROUBLESHOOTING.md covers both errors: gcc newer than 14 needsCXX=g++-14 CUDAHOSTCXX=g++-14, and with glibc 2.43, CUDA 12.9's math headers do not compile, so use 12.8 or 13.x.