8e800cedaf
cudaPackages.cuda_compat: ignore missing libs provided at runtime cudaPackages.gpus: Jetson should never build by default cudaPackages.flags: don't build Jetson capabilities by default cudaPackages: re-introduce filter for pre-existing CUDA redist packages in overrides cudaPackages: only recurseIntoAttrs for the latest of each major version cudaPackages.nvccCompatabilities: use GCC 10 through CUDA 11.5 to avoid a GLIBC incompatability cudaPackages.cutensor: acquire libcublas through cudatoolkit prior to 11.4 cudaPackages.cuda_compat: mark as broken on aarch64-linux if not targeting Jetson cudaPackages.cutensor_1_4: fix build cudaPackages: adjust use of autoPatchelfIgnoreMissingDeps cudaPackages.cuda_nvprof: remove unecessary override to add addOpenGLRunpath cudaPackages: use getExe' to avoid patchelf warning about missing meta.mainProgram cudaPackages: fix evaluation with Nix 2.3 cudaPackages: fix platform detection for Jetson/non-Jetson aarch64-linux python3Packages.tensorrt: mark as broken if required packages are missing Note: evaluating the name of the derivation will fail if tensorrt is not present, which is why we wrap the value in `lib.optionalString`. cudaPackages.flags.getNixSystem: add guard based on jetsonTargets cudaPackages.cudnn: use explicit path to patchelf cudaPackages.tensorrt: use explicit path to patchelf
70 lines
1.9 KiB
Nix
70 lines
1.9 KiB
Nix
{
|
|
cudaVersion,
|
|
fetchurl,
|
|
final,
|
|
lib,
|
|
package,
|
|
patchelf,
|
|
zlib,
|
|
...
|
|
}:
|
|
let
|
|
inherit (lib)
|
|
lists
|
|
maintainers
|
|
meta
|
|
strings
|
|
;
|
|
in
|
|
finalAttrs: prevAttrs: {
|
|
src = fetchurl {inherit (package) url hash;};
|
|
|
|
# Useful for inspecting why something went wrong.
|
|
brokenConditions =
|
|
let
|
|
cudaTooOld = strings.versionOlder cudaVersion package.minCudaVersion;
|
|
cudaTooNew =
|
|
(package.maxCudaVersion != null) && strings.versionOlder package.maxCudaVersion cudaVersion;
|
|
in
|
|
prevAttrs.brokenConditions
|
|
// {
|
|
"CUDA version is too old" = cudaTooOld;
|
|
"CUDA version is too new" = cudaTooNew;
|
|
};
|
|
|
|
buildInputs =
|
|
prevAttrs.buildInputs
|
|
++ [zlib]
|
|
++ lists.optionals finalAttrs.passthru.useCudatoolkitRunfile [final.cudatoolkit]
|
|
++ lists.optionals (!finalAttrs.passthru.useCudatoolkitRunfile) [final.libcublas.lib];
|
|
|
|
# Tell autoPatchelf about runtime dependencies.
|
|
# NOTE: Versions from CUDNN releases have four components.
|
|
postFixup = strings.optionalString (strings.versionAtLeast finalAttrs.version "8.0.5.0") ''
|
|
${meta.getExe' patchelf "patchelf"} $lib/lib/libcudnn.so --add-needed libcudnn_cnn_infer.so
|
|
${meta.getExe' patchelf "patchelf"} $lib/lib/libcudnn_ops_infer.so --add-needed libcublas.so --add-needed libcublasLt.so
|
|
'';
|
|
|
|
passthru.useCudatoolkitRunfile = strings.versionOlder cudaVersion "11.3.999";
|
|
|
|
meta = prevAttrs.meta // {
|
|
homepage = "https://developer.nvidia.com/cudnn";
|
|
maintainers =
|
|
prevAttrs.meta.maintainers
|
|
++ (
|
|
with maintainers; [
|
|
mdaiter
|
|
samuela
|
|
connorbaker
|
|
]
|
|
);
|
|
license = {
|
|
shortName = "cuDNN EULA";
|
|
fullName = "NVIDIA cuDNN Software License Agreement (EULA)";
|
|
url = "https://docs.nvidia.com/deeplearning/sdk/cudnn-sla/index.html#supplement";
|
|
free = false;
|
|
redistributable = !finalAttrs.passthru.useCudatoolkitRunfile;
|
|
};
|
|
};
|
|
}
|