From d70f62973b03bd7eaa168d7dc0b4988a5ca4eac0 Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Thu, 28 Aug 2025 23:17:39 +0000 Subject: [PATCH] onnxruntime: properly condition ncclSupport Signed-off-by: Connor Baker --- pkgs/by-name/on/onnxruntime/package.nix | 11 +++-------- .../python-modules/onnxruntime/default.nix | 2 ++ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/on/onnxruntime/package.nix b/pkgs/by-name/on/onnxruntime/package.nix index dcbea042fe7d..05ecb2453419 100644 --- a/pkgs/by-name/on/onnxruntime/package.nix +++ b/pkgs/by-name/on/onnxruntime/package.nix @@ -23,7 +23,7 @@ darwinMinVersionHook, pythonSupport ? true, cudaSupport ? config.cudaSupport, - ncclSupport ? config.cudaSupport, + ncclSupport ? cudaSupport && cudaPackages.nccl.meta.available, withFullProtobuf ? false, cudaPackages ? { }, }@inputs: @@ -154,12 +154,7 @@ effectiveStdenv.mkDerivation rec { cudnn # cudnn.h cuda_cudart ] - ++ lib.optionals (cudaSupport && ncclSupport) ( - with cudaPackages; - [ - nccl - ] - ) + ++ lib.optionals ncclSupport [ nccl ] ) ++ lib.optionals effectiveStdenv.hostPlatform.isDarwin [ (darwinMinVersionHook "13.3") @@ -270,7 +265,7 @@ effectiveStdenv.mkDerivation rec { ''; passthru = { - inherit cudaSupport cudaPackages; # for the python module + inherit cudaSupport cudaPackages ncclSupport; # for the python module inherit protobuf; tests = lib.optionalAttrs pythonSupport { python = python3Packages.onnxruntime; diff --git a/pkgs/development/python-modules/onnxruntime/default.nix b/pkgs/development/python-modules/onnxruntime/default.nix index dbd2db24232b..4d2ed826d456 100644 --- a/pkgs/development/python-modules/onnxruntime/default.nix +++ b/pkgs/development/python-modules/onnxruntime/default.nix @@ -68,6 +68,8 @@ buildPythonPackage { libcufft # libcufft.so.XX cudnn # libcudnn.soXX cuda_cudart # libcudart.so.XX + ] + ++ lib.optionals onnxruntime.passthru.ncclSupport [ nccl # libnccl.so.XX ] );