Skip to content

Improve CUDA 13.1 compatibility with newer glibc - #31

Open
remer wants to merge 3 commits into
brontoguana:mainfrom
remer:fix/cuda-glibc-compat
Open

remer wants to merge 3 commits into
brontoguana:mainfrom
remer:fix/cuda-glibc-compat

Conversation

@remer

@remer remer commented Aug 21, 2026 •

Copy link
Copy Markdown

Summary

Make Krasis's Linux CUDA builds tolerate the CUDA 13.0/13.1 declaration
collision with newer glibc without patching the installed CUDA toolkit or
changing the system compiler.

  • pass -U_GNU_SOURCE -D_DEFAULT_SOURCE through the shared build.rs NVCC
    argument path;
  • apply the same contract to the independently compiled Marlin and
    FlashAttention package sidecars;
  • force-include a narrowly scoped compatibility header which disables the
    optional libstdc++ pthread clock-wait paths made unavailable when
    _GNU_SOURCE is hidden; and
  • include that header in the sidecar input hash so cached bundles cannot mask a
    compatibility-source change.

Windows behavior is unchanged. An explicitly selected KRASIS_NVCC_CCBIN is
still preserved.

Observed failures

With CUDA 13.1 and glibc 2.43, normal CUDA compilation failed with errors
equivalent to:

bits/mathcalls.h: error: exception specification is incompatible with that of previous function "rsqrt"
crt/math_functions.h: previous declaration of "rsqrt"

After the original compatibility flags were exercised through the release
sidecar builder, FlashAttention exposed the corresponding libstdc++ half of the
contract: its optional timed-mutex paths referenced GNU pthread clock APIs that
were intentionally no longer declared. The compatibility header handles both
sides in the affected translation unit.

RC10 validation (2026-09-02)

  • Base: v1.0.21-rc.10
    (716bf316fbc001c1f61ad607362e05c1cb323c50).
  • Three focused host-argument regression tests passed.
  • git diff --check and Rust formatting checks passed.
  • A complete Marlin regular + MoE sidecar build passed.
  • The complete packaged FlashAttention BF16 and BF16-query/FP8-KV matrix passed
    for head dimensions 64, 96, 128, 192, and 256, causal and non-causal.
  • Marlin and FlashAttention linked successfully; required exported symbols,
    manifest input hashes, artifact hashes, and build IDs all passed the
    builder's post-build contract.
  • The resulting sidecar bundle was restored from its content-derived cache key
    and revalidated, proving the new header participates in cache identity.
  • A completely fresh-target RC10 integration wheel completed against Python
    3.13; both packaged sidecars loaded from that wheel and 29 wheel-backed
    DeepSeek Vision/model-configuration tests passed.

The DeepSeek-only canary does not require Krasis's separate Flash Linear
Attention sidecars, so this validation does not claim a full multi-model
release-wheel matrix.

Compatibility scope

The observed CUDA 13.1/new-glibc combination is outside CUDA 13.1's validated
distribution matrix, so this is a portability improvement rather than a claim
that Krasis is defective on a supported CUDA configuration. NVIDIA's
cuda-samples PR #403 documents the same feature-macro workaround:
NVIDIA/cuda-samples#403

No credentials, account names, hostnames, network addresses, private paths, or
raw request/generated content are included in this change or PR body.

RC11 alignment — 2026-09-08

Merged upstream v1.0.21-rc.11 (9d25fb3a490499f1be78952079d361acfdb5c05c) without rewriting this
branch's history. The feature diff is unchanged; RC11 contributes its 13
context-default/launcher/manager/version/test files. Previous head preserved
at remer/krasis:preserve/pre-rc11-20260908/pr31.

The combined integration/rc11-ai-box tree
d8656f9577a7d469a7b0e2e987b61b14e258e1d5 builds a fresh release wheel.
Its targeted Rust suites pass: D-Spark 30/30, chat template 16/16, server 31/31.
Python model/configuration/vision/cache-gate contracts pass. One launcher parser
case assumes two visible GPUs; it passes with an isolated two-GPU inventory
fixture (parser-only, not a claim of multi-GPU runtime testing).

Live RC11 Vision qualification is pending. Historical RC6/RC10 throughput and
quality measurements are not RC11 Vision results. Session-cache operational
and D-Spark promotion gates remain live-test obligations.

@remer
remer force-pushed the fix/cuda-glibc-compat branch from 0ee1b0d to 6963514 Compare September 2, 2026 20:23

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant