nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 85 lines 1.9 kB view raw
1{ 2 lib, 3 symlinkJoin, 4 backendStdenv, 5 cudaAtLeast, 6 cudaMajorMinorVersion, 7 cuda_cccl ? null, 8 cuda_crt ? null, 9 cuda_cudart ? null, 10 cuda_cuobjdump ? null, 11 cuda_cupti ? null, 12 cuda_cuxxfilt ? null, 13 cuda_gdb ? null, 14 cuda_nvcc ? null, 15 cuda_nvdisasm ? null, 16 cuda_nvml_dev ? null, 17 cuda_nvprune ? null, 18 cuda_nvrtc ? null, 19 cuda_nvtx ? null, 20 cuda_profiler_api ? null, 21 cuda_sanitizer_api ? null, 22 libcublas ? null, 23 libcufft ? null, 24 libcurand ? null, 25 libcusolver ? null, 26 libcusparse ? null, 27 libnpp ? null, 28}: 29 30let 31 # Retrieve all the outputs of a package except for the "static" output. 32 getAllOutputs = 33 p: lib.concatMap (output: lib.optionals (output != "static") [ p.${output} ]) p.outputs; 34 35 hostPackages = [ 36 cuda_cuobjdump 37 cuda_gdb 38 cuda_nvcc 39 cuda_nvdisasm 40 cuda_nvprune 41 ]; 42 targetPackages = [ 43 cuda_cccl 44 cuda_cudart 45 cuda_cupti 46 cuda_cuxxfilt 47 cuda_nvml_dev 48 cuda_nvrtc 49 cuda_nvtx 50 cuda_profiler_api 51 cuda_sanitizer_api 52 libcublas 53 libcufft 54 libcurand 55 libcusolver 56 libcusparse 57 libnpp 58 ] 59 ++ lib.optionals (cudaAtLeast "13") [ 60 cuda_crt 61 ]; 62 63 # This assumes we put `cudatoolkit` in `buildInputs` instead of `nativeBuildInputs`: 64 allPackages = (map (p: p.__spliced.buildHost or p) hostPackages) ++ targetPackages; 65in 66symlinkJoin rec { 67 name = "cuda-merged-${cudaMajorMinorVersion}"; 68 version = cudaMajorMinorVersion; 69 70 paths = builtins.concatMap getAllOutputs allPackages; 71 72 passthru = { 73 cc = lib.warn "cudaPackages.cudatoolkit is deprecated, refer to the manual and use splayed packages instead" backendStdenv.cc; 74 lib = symlinkJoin { 75 inherit name; 76 paths = map (p: lib.getLib p) allPackages; 77 }; 78 }; 79 80 meta = { 81 description = "Wrapper substituting the deprecated runfile-based CUDA installation"; 82 license = lib.licenses.nvidiaCudaRedist; 83 teams = [ lib.teams.cuda ]; 84 }; 85}