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:
CUDA_HOME=$(pwd)/.venv/lib/python3.12/site-packages/nvidia/cu13 \
CUDA_PATH=$(pwd)/.venv/lib/python3.12/site-packages/nvidia/cu13 \
uv sync --group kernels
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).
ltx-kernelsfails to build on rolling-release toolchains (CachyOS/Arch)Environment
_POSIX_C_SOURCEdefaulting to202405Lpyconfig.hpinning_POSIX_C_SOURCEto200809Luv sync --group kernelson a clean checkoutIssue 1: wrong CUDA toolkit picked up when
CUDA_HOME/CUDA_PATHis presetpackages/ltx-kernels/setup.pyonly auto-selects the pip-installednvidia-cuda-nvcctoolchain when
CUDA_HOME/CUDA_PATHare unset. Distros that exportCUDA_PATHglobally (e.g. CachyOS points it at
/opt/cuda) cause the build to silently use thesystem 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:Workaround: explicitly point
CUDA_HOME/CUDA_PATHat the venv's bundled toolkitbefore syncing:
Issue 2:
-Werrorfatal on a harmless glibc/Python POSIX macro mismatchall2all.cppincludes ATen headers (which pull in glibc's<features.h>, defining_POSIX_C_SOURCE 202405L) before pybind11'sPython.h(which defines_POSIX_C_SOURCE 200809L). On newer glibc these values differ, producing:This diagnostic has no named
-Wgroup (no[-Werror=...]tag), so it can't beselectively silenced under
-Werrorvia-Wno-error=<name>.all2all_argsinsetup.pyhard-codes-Werror, making this fatal on any toolchain where glibc andCPython disagree on the POSIX feature-test level.
Workaround applied locally: drop
-Werrorfromall2all_argsinpackages/ltx-kernels/setup.py(keeping-Wall -Wextra).