Skip to content

nix-builder: use ptxas 13.4 for CUDA 13.0 builds on aarch64-linux - #952

Closed
drbh wants to merge 1 commit into
mainfrom
fix-cu130-aarch64-ptxas
Closed

drbh wants to merge 1 commit into
mainfrom
fix-cu130-aarch64-ptxas

Conversation

@drbh

@drbh drbh commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

ptxas 13.0.88 segfaults on aarch64-linux when compiling large sm90 kernels. flash-attn3's cu130 aarch64 build has failed on every run since 08-27 with 'ptxas' died due to signal 11 (Invalid memory reference) on flash_fwd_hdimall_bf16_sm90.cu and flash_fwd_hdimall_bf16_softcap_sm90.cu, while x86_64 builds the same variant fine, e.g.

this pr swaps in ptxas 13.4 for CUDA 13.0 builds on aarch64-linux only, using the existing ptxasVersion override (#671)

  • allow ptxasVersion in versions.nix to be a per-system attrset, e.g. ptxasVersion.aarch64-linux = "13.4". a plain string still applies to all systems
  • set that for the CUDA 13.0 entries (Torch 2.10 - 2.14)
  • fix the override for CUDA 13: nvvm is no longer in cuda_nvcc (it moved to libnvvm), so the cp .../nvvm/bin/* failed and broke the patched nvcc. now it only copies nvvm/bin when present, so for CUDA 13 just ptxas and nvlink are swapped and cicc stays at 13.0
  • add tests for both ptxasVersion forms in checks.nix

testing

compiled the two crashing flash-attn3 files with the CI nvcc flags on native aarch64-linux, using the builder's own package sets, where ptxas is the only difference between the two runs:

file ptxas 13.0 (main) ptxas 13.4 (this pr)
flash_fwd_hdimall_bf16_sm90.cu ptxas died due to signal 11 ok
flash_fwd_hdimall_bf16_softcap_sm90.cu ptxas died due to signal 11 ok

nix eval .#checks.x86_64-linux.default.drvPath passes (includes the new tests).

not yet tested: a full flash-attn3 build and GPU tests with this builder rev, I'll run a kernels-community stage build against this branch.

note: this rebuilds the aarch64 cu130 variant of every kernel with ptxas 13.4. if we'd rather limit the blast radius, the override could go only on the entries that kernels hitting this actually build

ptxas 13.0.88 segfaults on aarch64-linux when compiling large sm90
kernels, e.g. the flash-attn3 hdimall bf16 instantiations
(`'ptxas' died due to signal 11`). x86_64 is not affected.

- Allow `ptxasVersion` in versions.nix to be a per-system attrset, so
  the override can be limited to aarch64-linux.
- Set `ptxasVersion.aarch64-linux = "13.4"` for the CUDA 13.0 entries.
- Fix the ptxas override for CUDA 13: nvvm is no longer part of
  cuda_nvcc, so only copy nvvm/bin when it exists.
Comment thread nix-builder/versions.nix
@@ -30,6 +30,8 @@
{
torchVersion = "2.10";
cudaVersion = "13.0";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be done. This switches all 13.0 builds to ptxas 13.4. It is a hack and should only be done on kernels that really need it. See

https://github.com/huggingface/kernels-community/blob/4498ed972091eb7d087fdb3853417f706193df28/flash-attn3/flake.nix#L26

@drbh

drbh commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator Author

closing in favor of a more targeted fix huggingface/kernels-community#1285

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.

2 participants