mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-30 16:10:36 +00:00
ucc: gate building NCCL on unsupported systems (#574662)
This commit is contained in:
@@ -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 = ''
|
||||
|
||||
Reference in New Issue
Block a user