You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ltx-kernels build fails on rolling-release toolchains (CUDA toolkit mismatch + -Werror on glibc/Python POSIX macro clash) #292
ltx-kernels fails to build on rolling-release toolchains (CachyOS/Arch)
Environment
OS: CachyOS (Arch-based), GCC 16, glibc with _POSIX_C_SOURCE defaulting to 202405L
Python: 3.12.13, built with pyconfig.h pinning _POSIX_C_SOURCE to 200809L
uv sync --group kernels on a clean checkout
Issue 1: wrong CUDA toolkit picked up when CUDA_HOME/CUDA_PATH is preset
packages/ltx-kernels/setup.py only auto-selects the pip-installed nvidia-cuda-nvcc
toolchain when CUDA_HOME/CUDA_PATH are unset. Distros that export CUDA_PATH
globally (e.g. CachyOS points it at /opt/cuda) cause the build to silently use the
system CUDA toolkit instead, which can be a different minor version than the pinned nvidia-cuda-nvcc==13.2.* / nvidia-cuda-cccl==13.2.* dependency group. Result:
/usr/include/cccl/cuda/std/__cccl/cuda_toolkit.h:41:8: error: #error
"CUDA compiler and CUDA toolkit headers are incompatible, please check your include paths"
Workaround: explicitly point CUDA_HOME/CUDA_PATH at the venv's bundled toolkit
before syncing:
Issue 2: -Werror fatal on a harmless glibc/Python POSIX macro mismatch
all2all.cpp includes ATen headers (which pull in glibc's <features.h>, defining _POSIX_C_SOURCE 202405L) before pybind11's Python.h (which defines _POSIX_C_SOURCE 200809L). On newer glibc these values differ, producing:
pyconfig.h:1877:9: error: '_POSIX_C_SOURCE' redefined [-Werror]
pyconfig.h:1898:9: error: '_XOPEN_SOURCE' redefined [-Werror]
cc1plus: all warnings being treated as errors
This diagnostic has no named -W group (no [-Werror=...] tag), so it can't be
selectively silenced under -Werror via -Wno-error=<name>. all2all_args in setup.py hard-codes -Werror, making this fatal on any toolchain where glibc and
CPython disagree on the POSIX feature-test level.
Workaround applied locally: drop -Werror from all2all_args in packages/ltx-kernels/setup.py (keeping -Wall -Wextra).
Thanks for the clear write-up, it made both of these quick to track down. I've opened #313 with fixes at the cause rather than the workarounds:
setup.py: a bare CUDA_PATH (as Arch/CachyOS export globally) no longer vetoes the pip nvidia-cuda-nvcc toolkit. An explicit CUDA_HOME is still honoured.
all2all.cpp: <torch/python.h> now leads the include list so <Python.h> precedes glibc's <features.h>. torch's wrapper push/undef/pops _POSIX_C_SOURCE / _XOPEN_SOURCE around <Python.h>; pybind11's wrapper doesn't, and it was landing first. -Werror stays.
I reproduced the exact diagnostics with a minimal include-order matrix on GCC 16.2 / glibc 2.43 (details in the PR), but I don't have a CachyOS host with an NVIDIA card. If you get a chance, a plain uv sync --group kernels on that branch, with no CUDA_HOME / CUDA_PATH overrides and -Werror still in place, would confirm it end to end:
Activity
fix(kernels): build on rolling-release toolchains (CUDA_PATH veto, PO…
ManuelFCastillo commentedon Sep 14, 2026
Thanks for the clear write-up, it made both of these quick to track down. I've opened #313 with fixes at the cause rather than the workarounds:
setup.py: a bareCUDA_PATH(as Arch/CachyOS export globally) no longer vetoes the pipnvidia-cuda-nvcctoolkit. An explicitCUDA_HOMEis still honoured.all2all.cpp:<torch/python.h>now leads the include list so<Python.h>precedes glibc's<features.h>. torch's wrapper push/undef/pops_POSIX_C_SOURCE/_XOPEN_SOURCEaround<Python.h>; pybind11's wrapper doesn't, and it was landing first.-Werrorstays.I reproduced the exact diagnostics with a minimal include-order matrix on GCC 16.2 / glibc 2.43 (details in the PR), but I don't have a CachyOS host with an NVIDIA card. If you get a chance, a plain
uv sync --group kernelson that branch, with noCUDA_HOME/CUDA_PATHoverrides and-Werrorstill in place, would confirm it end to end: