1 # NOTE: Though NCCL is called within the cudaPackages package set, we avoid passing in
2 # the names of dependencies from that package set directly to avoid evaluation errors
3 # in the case redistributable packages are not available.
11 # passthru.updateScript
15 inherit (cudaPackages)
26 backendStdenv.mkDerivation (finalAttrs: {
30 src = fetchFromGitHub {
33 rev = "v${finalAttrs.version}";
34 hash = "sha256-IF2tILwW8XnzSmfn7N1CO7jXL95gUp02guIW5n1eaig=";
37 __structuredAttrs = true;
51 ++ lib.optionals (cudaOlder "11.4") [ cudatoolkit ]
52 ++ lib.optionals (cudaAtLeast "11.4") [ cuda_nvcc ];
55 lib.optionals (cudaOlder "11.4") [ cudatoolkit ]
56 ++ lib.optionals (cudaAtLeast "11.4") [
57 cuda_nvcc # crt/host_config.h
60 # NOTE: CUDA versions in Nixpkgs only use a major and minor version. When we do comparisons
61 # against other version, like below, it's important that we use the same format. Otherwise,
62 # we'll get incorrect results.
63 # For example, lib.versionAtLeast "12.0" "12.0.0" == false.
64 ++ lib.optionals (cudaAtLeast "12.0") [ cuda_cccl ];
66 env.NIX_CFLAGS_COMPILE = toString [ "-Wno-unused-function" ];
69 patchShebangs ./src/device/generate.py
75 "NVCC_GENCODE=${cudaFlags.gencodeString}"
77 ++ lib.optionals (cudaOlder "11.4") [
78 "CUDA_HOME=${cudatoolkit}"
79 "CUDA_LIB=${lib.getLib cudatoolkit}/lib"
80 "CUDA_INC=${lib.getDev cudatoolkit}/include"
82 ++ lib.optionals (cudaAtLeast "11.4") [
83 "CUDA_HOME=${cuda_nvcc}"
84 "CUDA_LIB=${lib.getLib cuda_cudart}/lib"
85 "CUDA_INC=${lib.getDev cuda_cudart}/include"
88 enableParallelBuilding = true;
91 moveToOutput lib/libnccl_static.a $dev
94 passthru.updateScript = gitUpdater {
95 inherit (finalAttrs) pname version;
100 description = "Multi-GPU and multi-node collective communication primitives for NVIDIA GPUs";
101 homepage = "https://developer.nvidia.com/nccl";
102 license = licenses.bsd3;
103 platforms = platforms.linux;
104 # NCCL is not supported on Jetson, because it does not use NVLink or PCI-e for inter-GPU communication.
105 # https://forums.developer.nvidia.com/t/can-jetson-orin-support-nccl/232845/9
106 badPlatforms = lib.optionals cudaFlags.isJetsonBuild [ "aarch64-linux" ];
113 ++ teams.cuda.members;