Skip to content

cudaPackages.cudnn: add missing nvrtc runtime dependency - #471394

Merged
ConnorBaker merged 1 commit into
NixOS:masterfrom
ethernet8023:cuda-nvrtc-runpath
Jan 26, 2026
Merged

ConnorBaker merged 1 commit into
NixOS:masterfrom
ethernet8023:cuda-nvrtc-runpath

Conversation

@ethernet8023

@ethernet8023 ethernet8023 commented Dec 16, 2025 •

Copy link
Copy Markdown
Contributor

cudnn uses nvrtc at runtime. this dependency wasn't specified anywhere, so this would fail unless nvrtc was injected into your runpath somewhere else. this is only triggered for specific operations on specific hardware.

This closes #461334

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 6.topic: cuda Parallel computing platform and API labels Dec 16, 2025
@ConnorBaker

Copy link
Copy Markdown
Contributor

Thank you for troubleshooting this, sorry I wasn’t able to help.

Any ideas for which versions of cuDNN this occurs or for which hardware? I ask because I need to make sure changes to package expressions don’t break out of tree consumers (the most important being https://github.com/nixos-cuda/cuda-legacy).

@ConnorBaker ConnorBaker self-assigned this Dec 16, 2025
@SomeoneSerge

Copy link
Copy Markdown
Contributor

cudnn dlopens nvrtc at runtime.

This might be true, but at least that doesn't happen in your logs: https://gist.github.com/arilotter/0993568341df8df1cc9aa422b6735cfd#file-gistfile1-txt-L2130-L2144

H'm, and you've already confirmed this change solves your problem?

@ethernet8023

Copy link
Copy Markdown
Contributor Author

cudnn dlopens nvrtc at runtime.

This might be true, but at least that doesn't happen in your logs: https://gist.github.com/arilotter/0993568341df8df1cc9aa422b6735cfd#file-gistfile1-txt-L2130-L2144

H'm, and you've already confirmed this change solves your problem?

yeah you're right. huh. I'm even more confused now.
i can confirm the change does solve my issue, and my repro script from the linked issue passes after this change.

I'm so confused 😭

@SomeoneSerge

Copy link
Copy Markdown
Contributor

yeah you're right. huh. I'm even more confused now.
i can confirm the change does solve my issue, and my repro script from the linked issue passes after this change.

Cool... could you gist the fixed version's LD_DEBUG=libs log too?

Comment on lines +48 to +50
patchelfFlagsArray = [
"--set-rpath"
"${lib.getLib cuda_nvrtc}/lib:\$ORIGIN"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Better use appendRunpaths (--add-rpath), which is more composable

@ethernet8023

ethernet8023 commented Dec 22, 2025 •

Copy link
Copy Markdown
Contributor Author

cudnn uses nvrtc at runtime on some hardware (e.g. H100). without this
runpath, we fail when triggering cudnn runtime compilation from pytorch
(see issue NixOS#461334)

closes NixOS#461334
@ethernet8023

Copy link
Copy Markdown
Contributor Author

updated to simply add it to the runpath instead of setting runpath. i can confirm this fixes the issue in #461334 from my end

@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 Jan 25, 2026
@GaetanLepage

Copy link
Copy Markdown
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 471394
Commit: d893175673bfcfd8f2cf5604443c2a9b52508dfa


x86_64-linux

✅ 39 packages built:
  • cudaPackages.cudnn
  • cudaPackages.cudnn-frontend
  • cudaPackages.cudnn-frontend.legacy_samples
  • cudaPackages.cudnn-frontend.samples
  • cudaPackages.cudnn-frontend.tests
  • cudaPackages.cudnn.dev
  • cudaPackages.cudnn.include
  • cudaPackages.cudnn.lib
  • cudaPackages.cudnn.static
  • katagoWithCuda
  • opensplatWithCuda
  • python313Packages.cupy
  • python313Packages.cupy.dist
  • python313Packages.jax-cuda12-pjrt
  • python313Packages.jax-cuda12-plugin
  • python313Packages.tensorflowWithCuda
  • python313Packages.tensorflowWithCuda.dist
  • python313Packages.torchWithCuda
  • python313Packages.torchWithCuda.cxxdev
  • python313Packages.torchWithCuda.dev
  • python313Packages.torchWithCuda.dist
  • python313Packages.torchWithCuda.lib
  • python313Packages.torchaudio-bin
  • python313Packages.torchaudio-bin.dist
  • python313Packages.torchvision-bin
  • python313Packages.torchvision-bin.dist
  • python314Packages.cupy
  • python314Packages.cupy.dist
  • python314Packages.jax-cuda12-pjrt
  • python314Packages.jax-cuda12-plugin
  • python314Packages.torchWithCuda
  • python314Packages.torchWithCuda.cxxdev
  • python314Packages.torchWithCuda.dev
  • python314Packages.torchWithCuda.dist
  • python314Packages.torchWithCuda.lib
  • python314Packages.torchaudio-bin
  • python314Packages.torchaudio-bin.dist
  • python314Packages.torchvision-bin
  • python314Packages.torchvision-bin.dist

aarch64-linux

✅ 36 packages built:
  • cudaPackages.cudnn
  • cudaPackages.cudnn-frontend
  • cudaPackages.cudnn-frontend.legacy_samples
  • cudaPackages.cudnn-frontend.samples
  • cudaPackages.cudnn-frontend.tests
  • cudaPackages.cudnn.dev
  • cudaPackages.cudnn.include
  • cudaPackages.cudnn.lib
  • cudaPackages.cudnn.static
  • opensplatWithCuda
  • python313Packages.cupy
  • python313Packages.cupy.dist
  • python313Packages.jax-cuda12-pjrt
  • python313Packages.jax-cuda12-plugin
  • python313Packages.torchWithCuda
  • python313Packages.torchWithCuda.cxxdev
  • python313Packages.torchWithCuda.dev
  • python313Packages.torchWithCuda.dist
  • python313Packages.torchWithCuda.lib
  • python313Packages.torchaudio-bin
  • python313Packages.torchaudio-bin.dist
  • python313Packages.torchvision-bin
  • python313Packages.torchvision-bin.dist
  • python314Packages.cupy
  • python314Packages.cupy.dist
  • python314Packages.jax-cuda12-pjrt
  • python314Packages.jax-cuda12-plugin
  • python314Packages.torchWithCuda
  • python314Packages.torchWithCuda.cxxdev
  • python314Packages.torchWithCuda.dev
  • python314Packages.torchWithCuda.dist
  • python314Packages.torchWithCuda.lib
  • python314Packages.torchaudio-bin
  • python314Packages.torchaudio-bin.dist
  • python314Packages.torchvision-bin
  • python314Packages.torchvision-bin.dist

@ConnorBaker

Copy link
Copy Markdown
Contributor

Thank you for including the link to the error message describing the missing library!

I looked through the docs all the way back to 8.5 and it seems like it's always needed it (at least for that code path you hit), so it's good to add this without being conditioned on some version.

@ConnorBaker

Copy link
Copy Markdown
Contributor

Thank you for the fix -- I've marked it for backport as well. Apologies this took so long to get reviewed and merged.

@ConnorBaker
ConnorBaker added this pull request to the merge queue Jan 26, 2026
@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Jan 26, 2026
Merged via the queue into NixOS:master with commit 3922461 Jan 26, 2026
2 of 4 checks passed
@github-project-automation github-project-automation Bot moved this from New to ✅ Done in CUDA Team Jan 26, 2026
@nixpkgs-ci

nixpkgs-ci Bot commented Jan 26, 2026

Copy link
Copy Markdown
Contributor

Successfully created backport PR for release-25.11:

@github-actions github-actions Bot added the 8.has: port to stable This PR already has a backport to the stable release. label Jan 26, 2026
@ethernet8023
ethernet8023 deleted the cuda-nvrtc-runpath branch February 6, 2026 16:32
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 8.has: port to stable This PR already has a backport to the stable release. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 12.approvals: 2 This PR was reviewed and approved by two persons. 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.

pythonPackages.torch: cudnn runtime compilation fails - libnvrtc not in runpath

4 participants