10 scope = makeScope pkgs.newScope (final: {
11 # Here we put package set configuration and utility functions.
13 cudaMajorVersion = versions.major final.cudaVersion;
14 cudaMajorMinorVersion = lib.versions.majorMinor final.cudaVersion;
17 addBuildInputs = drv: buildInputs: drv.overrideAttrs (oldAttrs: {
18 buildInputs = (oldAttrs.buildInputs or []) ++ buildInputs;
22 cutensorExtension = final: prev: let
25 buildCuTensorPackage = final.callPackage ../development/libraries/science/math/cutensor/generic.nix;
29 hash = "sha256-lU7iK4DWuC/U3s1Ct/rq2Gr3w4F2U7RYYgpmF05bibY=";
32 hash = "sha256-T96+lPC6OTOkIs/z3QWg73oYVSyidN0SVkBWmT9VRx0=";
36 inherit (final) cudaMajorMinorVersion cudaMajorVersion;
38 cutensor = buildCuTensorPackage rec {
39 version = if cudaMajorMinorVersion == "10.1" then "1.2.2.5" else "1.5.0.3";
40 inherit (cuTensorVersions.${version}) hash;
41 # This can go into generic.nix
42 libPath = "lib/${if cudaMajorVersion == "10" then cudaMajorMinorVersion else cudaMajorVersion}";
44 in { inherit cutensor; };
46 extraPackagesExtension = final: prev: {
48 nccl = final.callPackage ../development/libraries/science/math/nccl { };
50 autoAddOpenGLRunpathHook = final.callPackage ( { makeSetupHook, addOpenGLRunpath }:
52 name = "auto-add-opengl-runpath-hook";
56 } ../development/compilers/cudatoolkit/auto-add-opengl-runpath-hook.sh
61 composedExtension = composeManyExtensions ([
62 extraPackagesExtension
63 (import ../development/compilers/cudatoolkit/extension.nix)
64 (import ../development/compilers/cudatoolkit/redist/extension.nix)
65 (import ../development/compilers/cudatoolkit/redist/overrides.nix)
66 (import ../development/libraries/science/math/cudnn/extension.nix)
67 (import ../development/libraries/science/math/tensorrt/extension.nix)
68 (import ../test/cuda/cuda-samples/extension.nix)
69 (import ../test/cuda/cuda-library-samples/extension.nix)
73 in (scope.overrideScope' composedExtension)