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. *_infer* libraries only
43 # NOTE: Versions from CUDNN releases have four components.
45 strings.optionalString
47 strings.versionAtLeast finalAttrs.version "8.0.5.0"
48 && strings.versionOlder finalAttrs.version "9.0.0.0"
51 ${meta.getExe patchelf} $lib/lib/libcudnn.so --add-needed libcudnn_cnn_infer.so
52 ${meta.getExe patchelf} $lib/lib/libcudnn_ops_infer.so --add-needed libcublas.so --add-needed libcublasLt.so
55 passthru.useCudatoolkitRunfile = strings.versionOlder cudaVersion "11.3.999";
57 meta = prevAttrs.meta // {
58 homepage = "https://developer.nvidia.com/cudnn";
60 prevAttrs.meta.maintainers
61 ++ (with maintainers; [
67 shortName = "cuDNN EULA";
68 fullName = "NVIDIA cuDNN Software License Agreement (EULA)";
69 url = "https://docs.nvidia.com/deeplearning/sdk/cudnn-sla/index.html#supplement";
71 redistributable = !finalAttrs.passthru.useCudatoolkitRunfile;