Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 symlinkJoin, 4 backendStdenv, 5 cudaOlder, 6 cudatoolkit-legacy-runfile, 7 cudaMajorMinorVersion, 8 cuda_cccl ? 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 getAllOutputs = p: [ 32 (lib.getBin p) 33 (lib.getLib p) 34 (lib.getDev p) 35 ]; 36 hostPackages = [ 37 cuda_cuobjdump 38 cuda_gdb 39 cuda_nvcc 40 cuda_nvdisasm 41 cuda_nvprune 42 ]; 43 targetPackages = [ 44 cuda_cccl 45 cuda_cudart 46 cuda_cupti 47 cuda_cuxxfilt 48 cuda_nvml_dev 49 cuda_nvrtc 50 cuda_nvtx 51 cuda_profiler_api 52 cuda_sanitizer_api 53 libcublas 54 libcufft 55 libcurand 56 libcusolver 57 libcusparse 58 libnpp 59 ]; 60 61 # This assumes we put `cudatoolkit` in `buildInputs` instead of `nativeBuildInputs`: 62 allPackages = (map (p: p.__spliced.buildHost or p) hostPackages) ++ targetPackages; 63in 64 65if cudaOlder "11.4" then 66 cudatoolkit-legacy-runfile 67else 68 symlinkJoin rec { 69 name = "cuda-merged-${cudaMajorMinorVersion}"; 70 version = cudaMajorMinorVersion; 71 72 paths = builtins.concatMap getAllOutputs allPackages; 73 74 passthru = { 75 cc = lib.warn "cudaPackages.cudatoolkit is deprecated, refer to the manual and use splayed packages instead" backendStdenv.cc; 76 lib = symlinkJoin { 77 inherit name; 78 paths = map (p: lib.getLib p) allPackages; 79 }; 80 }; 81 82 meta = with lib; { 83 description = "Wrapper substituting the deprecated runfile-based CUDA installation"; 84 license = licenses.nvidiaCuda; 85 }; 86 }