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 ] );