nixpkgs/pkgs/development/cuda-modules/nccl-tests/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

83 lines
2.2 KiB
Nix
Raw Normal View History

# NOTE: Though NCCL tests is called within the cudaPackages package set, we avoid passing in
# the names of dependencies from that package set directly to avoid evaluation errors
# in the case redistributable packages are not available.
{
config,
cudaPackages,
fetchFromGitHub,
gitUpdater,
lib,
mpi,
mpiSupport ? false,
which,
2023-06-26 22:45:56 +00:00
}:
let
inherit (cudaPackages)
backendStdenv
cuda_cccl
cuda_cudart
cuda_nvcc
cudatoolkit
cudaVersion
nccl
;
in
backendStdenv.mkDerivation (finalAttrs: {
2023-06-26 22:45:56 +00:00
pname = "nccl-tests";
version = "2.13.9";
2023-06-26 22:45:56 +00:00
src = fetchFromGitHub {
owner = "NVIDIA";
repo = finalAttrs.pname;
rev = "v${finalAttrs.version}";
hash = "sha256-QYuMBPhvHHVo2ku14jD1CVINLPW0cyiXJkXxb77IxbE=";
};
2023-06-26 22:45:56 +00:00
strictDeps = true;
2023-06-26 22:45:56 +00:00
nativeBuildInputs =
[ which ]
++ lib.optionals (lib.versionOlder cudaVersion "11.4") [ cudatoolkit ]
++ lib.optionals (lib.versionAtLeast cudaVersion "11.4") [ cuda_nvcc ];
2023-08-16 20:18:27 +00:00
buildInputs =
[ nccl ]
++ lib.optionals (lib.versionOlder cudaVersion "11.4") [ cudatoolkit ]
++ lib.optionals (lib.versionAtLeast cudaVersion "11.4") [
cuda_nvcc.dev # crt/host_config.h
cuda_cudart
]
++ lib.optionals (lib.versionAtLeast cudaVersion "12.0") [
cuda_cccl.dev # <nv/target>
]
++ lib.optionals mpiSupport [ mpi ];
2023-06-26 22:45:56 +00:00
makeFlags =
[ "NCCL_HOME=${nccl}" ]
++ lib.optionals (lib.versionOlder cudaVersion "11.4") [ "CUDA_HOME=${cudatoolkit}" ]
++ lib.optionals (lib.versionAtLeast cudaVersion "11.4") [ "CUDA_HOME=${cuda_nvcc}" ]
++ lib.optionals mpiSupport [ "MPI=1" ];
2023-06-26 22:45:56 +00:00
enableParallelBuilding = true;
2023-06-26 22:45:56 +00:00
installPhase = ''
mkdir -p $out/bin
cp -r build/* $out/bin/
'';
2023-06-26 22:45:56 +00:00
passthru.updateScript = gitUpdater {
inherit (finalAttrs) pname version;
rev-prefix = "v";
};
meta = with lib; {
description = "Tests to check both the performance and the correctness of NVIDIA NCCL operations";
homepage = "https://github.com/NVIDIA/nccl-tests";
platforms = platforms.linux;
license = licenses.bsd3;
broken = !config.cudaSupport || (mpiSupport && mpi == null);
maintainers = with maintainers; [ jmillerpdt ] ++ teams.cuda.members;
};
})