19 finalAttrs: prevAttrs: {
20 src = fetchurl { inherit (package) url hash; };
22 # Useful for inspecting why something went wrong.
25 cudaTooOld = strings.versionOlder cudaVersion package.minCudaVersion;
27 (package.maxCudaVersion != null) && strings.versionOlder package.maxCudaVersion cudaVersion;
29 prevAttrs.brokenConditions
31 "CUDA version is too old" = cudaTooOld;
32 "CUDA version is too new" = cudaTooNew;
38 ++ lists.optionals finalAttrs.passthru.useCudatoolkitRunfile [ final.cudatoolkit ]
39 ++ lists.optionals (!finalAttrs.passthru.useCudatoolkitRunfile) [ final.libcublas.lib ];
41 # Tell autoPatchelf about runtime dependencies.
42 # NOTE: Versions from CUDNN releases have four components.
43 postFixup = strings.optionalString (strings.versionAtLeast finalAttrs.version "8.0.5.0") ''
44 ${meta.getExe' patchelf "patchelf"} $lib/lib/libcudnn.so --add-needed libcudnn_cnn_infer.so
45 ${meta.getExe' patchelf "patchelf"} $lib/lib/libcudnn_ops_infer.so --add-needed libcublas.so --add-needed libcublasLt.so
48 passthru.useCudatoolkitRunfile = strings.versionOlder cudaVersion "11.3.999";
50 meta = prevAttrs.meta // {
51 homepage = "https://developer.nvidia.com/cudnn";
53 prevAttrs.meta.maintainers
54 ++ (with maintainers; [
60 shortName = "cuDNN EULA";
61 fullName = "NVIDIA cuDNN Software License Agreement (EULA)";
62 url = "https://docs.nvidia.com/deeplearning/sdk/cudnn-sla/index.html#supplement";
64 redistributable = !finalAttrs.passthru.useCudatoolkitRunfile;