python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / top-level / cuda-packages.nix
blobc57e486406e1fa0cea4a7b90067602d19acec674
1 { lib
2 , pkgs
3 , cudaVersion
4 }:
6 with lib;
8 let
10   scope = makeScope pkgs.newScope (final: {
11     # Here we put package set configuration and utility functions.
12     inherit cudaVersion;
13     cudaMajorVersion = versions.major final.cudaVersion;
14     cudaMajorMinorVersion = lib.versions.majorMinor final.cudaVersion;
15     inherit lib pkgs;
17     addBuildInputs = drv: buildInputs: drv.overrideAttrs (oldAttrs: {
18       buildInputs = (oldAttrs.buildInputs or []) ++ buildInputs;
19     });
20   });
22   cutensorExtension = final: prev: let
23     ### CuTensor
25     buildCuTensorPackage = final.callPackage ../development/libraries/science/math/cutensor/generic.nix;
27     cuTensorVersions = {
28       "1.2.2.5" = {
29         hash = "sha256-lU7iK4DWuC/U3s1Ct/rq2Gr3w4F2U7RYYgpmF05bibY=";
30       };
31       "1.5.0.3" = {
32         hash = "sha256-T96+lPC6OTOkIs/z3QWg73oYVSyidN0SVkBWmT9VRx0=";
33       };
34     };
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}";
43     };
44   in { inherit cutensor; };
46   extraPackagesExtension = final: prev: {
48     nccl = final.callPackage ../development/libraries/science/math/nccl { };
50     autoAddOpenGLRunpathHook = final.callPackage ( { makeSetupHook, addOpenGLRunpath }:
51       makeSetupHook {
52         name = "auto-add-opengl-runpath-hook";
53         deps = [
54           addOpenGLRunpath
55         ];
56       } ../development/compilers/cudatoolkit/auto-add-opengl-runpath-hook.sh
57     ) {};
59   };
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)
70     cutensorExtension
71   ]);
73 in (scope.overrideScope' composedExtension)