Skip to content

cudaPackages: use patched patchelf to fix build failures - #575979

Merged
ConnorBaker merged 1 commit into
NixOS:masterfrom
GaetanLepage:fix/cudaPackages.libcufile
Oct 19, 2026
Merged

ConnorBaker merged 1 commit into
NixOS:masterfrom
GaetanLepage:fix/cudaPackages.libcufile

Conversation

@GaetanLepage

@GaetanLepage GaetanLepage commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Things done

#569010 updated patchelf to 0.19.2 and broke several cuda builds:

autoFixElfFiles: using addDriverRunpath to fix /nix/store/rl7n8mx6794l9pbcj16qhpsh6vpzvz78-cuda13.4-libcufile-1.19.1.55/tools/gdsio
patchelf: patchelf.cc:547: void ElfFile<Elf_Ehdr, Elf_Phdr, Elf_Shdr, Elf_Nhdr, Elf_Addr, Elf_Off, Elf_Dyn, Elf_Sym, Elf_Versym, Elf_Verdef, Elf_Verdaux, Elf_Verneed, Elf_Vernaux, Elf_Rel, Elf_Rela, ElfClass>::shiftFile(unsigned int, size_t, size_t) [with Elf_Ehdr = Elf64_Ehdr; Elf_Phdr = Elf64_Phdr; Elf_Shdr = Elf64_Shdr; Elf_Nhdr = Elf64_Nhdr; Elf_Addr = long unsigned int; Elf_Off = long unsigned int; Elf_Dyn = Elf64_Dyn; Elf_Sym = Elf64_Sym; Elf_Versym = short unsigned int; Elf_Verdef = Elf64_Verdef; Elf_Verdaux = Elf64_Verdaux; Elf_Verneed = Elf64_Verneed; Elf_Vernaux = Elf64_Vernaux; Elf_Rel = Elf64_Rel; Elf_Rela = Elf64_Rela; unsigned int ElfClass = 64; size_t = long unsigned int]: Assertion `splitIndex == -1' failed.
/nix/store/c9fggk6arh8c1x8fbama99crqng8wcmx-add-driver-runpath-hook/nix-support/setup-hook: line 23:   379 Aborted                    (core dumped) patchelf --set-rpath "/run/opengl-driver/lib:$origRpath" ${forceRpath:+--force-rpath} "$file"

A revert was merged in staging-next (#574271).
In the meantime, this fixes the impacted cudaPackages.

See also:

cc @nixos/cuda-maintainers

@nixpkgs-ci
nixpkgs-ci Bot requested review from a team, ConnorBaker, mdaiter and samuela October 19, 2026 12:21
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 6.topic: cuda Parallel computing platform and API labels Oct 19, 2026
@ConnorBaker ConnorBaker self-assigned this Oct 19, 2026
@ConnorBaker
ConnorBaker added this pull request to the merge queue Oct 19, 2026
@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels Oct 19, 2026
Merged via the queue into NixOS:master with commit e995b84 Oct 19, 2026
36 checks passed
@github-project-automation github-project-automation Bot moved this from New to ✅ Done in CUDA Team Oct 19, 2026
@GaetanLepage
GaetanLepage deleted the fix/cudaPackages.libcufile branch October 19, 2026 19:34
attilaolah added a commit to attilaolah/dotfiles that referenced this pull request Oct 20, 2026
Backport //github.com/NixOS/nixpkgs/pull/575979 to fix CUDA builds.
attilaolah added a commit to attilaolah/dotfiles that referenced this pull request Oct 20, 2026
Backport //github.com/NixOS/nixpkgs/pull/575979 to fix CUDA builds.
attilaolah added a commit to attilaolah/dotfiles that referenced this pull request Oct 20, 2026
Backport //github.com/NixOS/nixpkgs/pull/575979 to fix CUDA builds.
basnijholt added a commit to basnijholt/dotfiles that referenced this pull request Oct 20, 2026
nixpkgs 09063bd (current nixos-unstable) ships patchelf 0.19.2, which
aborts in shiftFile while patching CUDA redists (cuda_sanitizer_api
fails on pc) and produces segfaulting nvidia-smi/nvidia-powerd
binaries, breaking pc's nvidia-undervolt service.

Fixes are NixOS/nixpkgs#575979 (merged to master, not yet in
nixos-unstable) and NixOS/nixpkgs#576397 (open). Update again once
both reach nixos-unstable.
attilaolah added a commit to attilaolah/dotfiles that referenced this pull request Oct 20, 2026
Backport //github.com/NixOS/nixpkgs/pull/575979 to fix CUDA builds.
basnijholt added a commit to basnijholt/dotfiles that referenced this pull request Oct 20, 2026
Re-apply the flake input update held back in the previous commit
(nixpkgs 09063bd) and fix what it breaks on pc:

- patchelf 0.19.2 aborts in shiftFile while patching CUDA redists and
  writes segfaulting nvidia-smi/nvidia-powerd binaries. Pin CUDA redists
  (via _cuda.extensions) and the NVIDIA driver to patchelf 0.15.2, like
  NixOS/nixpkgs#575979; NixOS/nixpkgs#576397 is still open. Each pin
  disables itself with a warning once its upstream fix is in nixpkgs.
- Build CUDA kernels for sm_86 only (cudaCapabilities = [ "8.6" ]); the
  CUDA 12.9 -> 13.4 default bump otherwise compiles opencv and friends
  for ten architectures locally.
- llama-cpp b11756 already contains the patch nixpkgs backports, and its
  new test-llama-context-model pulls in the network-only
  test-download-model fixture, so drop the patch and disable the test.
- whisper-cpp now links llama-cpp's ggml; our llama-cpp drops
  GGML_BACKEND_DL so that link needs libcuda.so.1. Use the cached CPU
  whisper-cpp on stock llama-cpp (only ffmpeg-full uses it).
- Drop HandBrake's A15 pgssubdec ffmpeg patch, which no longer applies
  to ffmpeg 8.1.3 (NixOS/nixpkgs#576333, fix in NixOS/nixpkgs#576407).
attilaolah added a commit to attilaolah/dotfiles that referenced this pull request Oct 21, 2026
* chore(deps): update flake

* chore(deps): update flake

* feat: install some formatters to the env

* fix(llama-cpp): disable tests that are timing out consistently

* chore(deps): update flake, disable failing llama-cpp tests

* fix: backport patchelf fix

Backport //github.com/NixOS/nixpkgs/pull/575979 to fix CUDA builds.

* chore: update NixOS/nixpkgs#574836 patch

PR is now merged so the URL will remain stable.

* chore: add missing PR comment

* fix: hplip build failure

Backport NixOS/nixpkgs#575319.

* chore(deps): update flake

* chore(deps): update flake, remove applied patches
Ramblurr added a commit to Ramblurr/nixcfg that referenced this pull request Nov 22, 2026
personal-unstable now builds on flox/nixpkgs unstable, the revisions Flox
builds CUDA packages for, so the default CUDA 13 stack and onnxruntime
substitute from cache.flox.dev. The CUDA 12.9 pins existed for the
patchelf crash that NixOS/nixpkgs#575979 fixed, and they forced local
ollama-cuda and onnxruntime builds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: cuda Parallel computing platform and API 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages.

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants