From d893175673bfcfd8f2cf5604443c2a9b52508dfa Mon Sep 17 00:00:00 2001 From: Ari Lotter Date: Tue, 16 Dec 2025 10:55:58 -0500 Subject: [PATCH] cudaPackages.cudnn: add nvrtc to runpath 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 #461334) closes #461334 --- pkgs/development/cuda-modules/packages/cudnn.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/cuda-modules/packages/cudnn.nix b/pkgs/development/cuda-modules/packages/cudnn.nix index dfe581b72dab..594b94daa414 100644 --- a/pkgs/development/cuda-modules/packages/cudnn.nix +++ b/pkgs/development/cuda-modules/packages/cudnn.nix @@ -4,6 +4,7 @@ buildRedist, lib, libcublas, + cuda_nvrtc, patchelf, zlib, }: @@ -42,6 +43,12 @@ buildRedist ( ${lib.getExe patchelf} ''${!outputLib:?}/lib/libcudnn_ops_infer.so --add-needed libcublas.so --add-needed libcublasLt.so ''; + # CuDNN depends on libnvrtc.so at runtime, as mentioned here in one small error description + # https://docs.nvidia.com/deeplearning/cudnn/backend/latest/api/cudnn-graph-library.html + appendRunpaths = [ + "${lib.getLib cuda_nvrtc}/lib" + ]; + # NOTE: # With cuDNN forward compatiblity, all non-natively supported compute capabilities JIT compile PTX kernels. #