Skip to content

ltx-kernels build fails on rolling-release toolchains (CUDA toolkit mismatch + -Werror on glibc/Python POSIX macro clash) #292

Description

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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions