diff --git a/pkgs/by-name/uc/ucc/package.nix b/pkgs/by-name/uc/ucc/package.nix index 4e55618df4b3..23937dba5dc8 100644 --- a/pkgs/by-name/uc/ucc/package.nix +++ b/pkgs/by-name/uc/ucc/package.nix @@ -11,13 +11,14 @@ inputs@{ # Configuration options enableAvx ? stdenv.hostPlatform.avxSupport, enableCuda ? config.cudaSupport, + enableNccl ? enableCuda && cudaPackages.nccl.meta.available, enableSse41 ? stdenv.hostPlatform.sse4_1Support, enableSse42 ? stdenv.hostPlatform.sse4_2Support, }: let inherit (lib.attrsets) getOutput; inherit (lib.lists) optionals; - inherit (lib.strings) concatStringsSep; + inherit (lib.strings) concatStringsSep withFeature; inherit (cudaPackages) cccl @@ -80,8 +81,8 @@ effectiveStdenv.mkDerivation (finalAttrs: { cccl cuda_cudart cuda_nvml_dev - nccl - ]; + ] + ++ optionals enableNccl [ nccl ]; # NOTE: With `__structuredAttrs` enabled, `LDFLAGS` must be set under `env` so it is assured to be a string; # otherwise, we might have forgotten to convert it to a string and Nix would make LDFLAGS a shell variable @@ -106,6 +107,7 @@ effectiveStdenv.mkDerivation (finalAttrs: { ++ optionals enableCuda [ "--with-cuda=${cuda_nvcc}" "--with-nvcc-gencode=${concatStringsSep " " flags.gencode}" + (withFeature enableNccl "nccl") ]; postInstall = ''