From c26df0c165ac0340d030cae36d6f7de7315f776c Mon Sep 17 00:00:00 2001 From: Conroy Cheers Date: Fri, 25 Oct 2024 17:21:46 +1100 Subject: [PATCH] python3Packages.cupy: make cuda_nvprof, cutensor and nccl optional --- pkgs/development/python-modules/cupy/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/cupy/default.nix b/pkgs/development/python-modules/cupy/default.nix index 525b593f23e5..1d7cf072fbcc 100644 --- a/pkgs/development/python-modules/cupy/default.nix +++ b/pkgs/development/python-modules/cupy/default.nix @@ -1,5 +1,6 @@ { lib, + stdenv, buildPythonPackage, fetchFromGitHub, cython_0, @@ -17,7 +18,15 @@ }: let - inherit (cudaPackages) cudnn cutensor nccl; + inherit (cudaPackages) cudnn; + + shouldUsePkg = pkg: if pkg != null && lib.meta.availableOn stdenv.hostPlatform pkg then pkg else null; + + # some packages are not available on all platforms + cuda_nvprof = shouldUsePkg (cudaPackages.nvprof or null); + cutensor = shouldUsePkg (cudaPackages.cutensor or null); + nccl = shouldUsePkg (cudaPackages.nccl or null); + outpaths = with cudaPackages; [ cuda_cccl # cuda_cudart