From e5d60b297ed77b55c35171a950033bcacfc5faeb Mon Sep 17 00:00:00 2001 From: 81reap Date: Thu, 15 Oct 2026 21:08:55 -0400 Subject: [PATCH] ucc: gate building NCCL on unsupported systems NVIDIA does not support NCCL on pre-Thor Jetson devices (ie :: Jetson Orin and Jetson Xavier), so `cudaPackages.nccl` fails to evaluate and also fails downstream comusmers like `ucc` and `openmpi`. Now we have an `enableNccl` flag that gates if NCCL is available, simmilar to how onnxruntime does. It is accessible via `--with-nccl`/`--without-nccl`. Builds wihtout CUDA are unaffected. Assisted-By: Claude-Code --- pkgs/by-name/uc/ucc/package.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 = ''