From 879d6402acf5eba2fcf9455fab16e4768a3ca4b2 Mon Sep 17 00:00:00 2001 From: Jason Miller Date: Mon, 26 Jun 2023 22:45:56 +0000 Subject: [PATCH 1/3] nccl-tests: init at 2.13.6 --- .../libraries/science/math/nccl/tests.nix | 54 +++++++++++++++++++ pkgs/top-level/cuda-packages.nix | 2 + 2 files changed, 56 insertions(+) create mode 100644 pkgs/development/libraries/science/math/nccl/tests.nix diff --git a/pkgs/development/libraries/science/math/nccl/tests.nix b/pkgs/development/libraries/science/math/nccl/tests.nix new file mode 100644 index 000000000000..48be5eb22c3a --- /dev/null +++ b/pkgs/development/libraries/science/math/nccl/tests.nix @@ -0,0 +1,54 @@ +{ lib +, stdenv +, fetchFromGitHub +, which +, cudaPackages +, mpiSupport ? false +, mpi +}: + +assert mpiSupport -> mpi != null; + +with cudaPackages; + +cudaPackages.backendStdenv.mkDerivation rec { + + pname = "nccl-tests"; + version = "2.13.6"; + + src = fetchFromGitHub { + owner = "NVIDIA"; + repo = pname; + rev = "v${version}"; + hash = "sha256-3gSBQ0g6mnQ/MFXGflE+BqqrIUoiBgp8+fWRQOvLVkw="; + }; + + nativeBuildInputs = [ which cuda_nvcc ]; + + buildInputs = [ + cuda_cudart + nccl + ] ++ lib.optional mpiSupport mpi; + + makeFlags = [ + "CUDA_HOME=${cudatoolkit}" + "NCCL_HOME=${nccl}" + ] ++ lib.optionals mpiSupport [ + "MPI=1" + ]; + + enableParallelBuilding = true; + + installPhase = '' + mkdir -p $out/bin + cp -r build/* $out/bin/ + ''; + + 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 = [ "x86_64-linux" ]; + license = licenses.bsd3; + maintainers = with maintainers; [ jmillerpdt ]; + }; +} diff --git a/pkgs/top-level/cuda-packages.nix b/pkgs/top-level/cuda-packages.nix index 2044d74cab79..81ea053651b6 100644 --- a/pkgs/top-level/cuda-packages.nix +++ b/pkgs/top-level/cuda-packages.nix @@ -47,6 +47,8 @@ let nccl = final.callPackage ../development/libraries/science/math/nccl { }; + nccl-tests = final.callPackage ../development/libraries/science/math/nccl/tests.nix { }; + autoAddOpenGLRunpathHook = final.callPackage ( { makeSetupHook, addOpenGLRunpath }: makeSetupHook { name = "auto-add-opengl-runpath-hook"; From e3682a9fddd457d468c04b91de758e368ee245d9 Mon Sep 17 00:00:00 2001 From: Jason Miller Date: Tue, 27 Jun 2023 19:15:07 +0000 Subject: [PATCH 2/3] maintainers: add jmillerpdt --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 47d418ba77bc..dcc05289c8c6 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -7753,6 +7753,12 @@ githubId = 2308444; name = "Joshua Gilman"; }; + jmillerpdt = { + email = "jcmiller@pdtpartners.com"; + github = "jmillerpdt"; + githubId = 54179289; + name = "Jason Miller"; + }; jnsgruk = { email = "jon@sgrs.uk"; github = "jnsgruk"; From c19e4174fbda5531cfd23fe4a99b403e20c7c9b3 Mon Sep 17 00:00:00 2001 From: Jason Miller Date: Wed, 16 Aug 2023 20:18:27 +0000 Subject: [PATCH 3/3] apply pr comments --- .../libraries/science/math/nccl/tests.nix | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/pkgs/development/libraries/science/math/nccl/tests.nix b/pkgs/development/libraries/science/math/nccl/tests.nix index 48be5eb22c3a..69e45a6aee09 100644 --- a/pkgs/development/libraries/science/math/nccl/tests.nix +++ b/pkgs/development/libraries/science/math/nccl/tests.nix @@ -1,38 +1,40 @@ -{ lib -, stdenv -, fetchFromGitHub -, which +{ config , cudaPackages +, fetchFromGitHub +, lib , mpiSupport ? false , mpi +, stdenv +, which }: -assert mpiSupport -> mpi != null; - -with cudaPackages; - -cudaPackages.backendStdenv.mkDerivation rec { +cudaPackages.backendStdenv.mkDerivation (finalAttrs: { pname = "nccl-tests"; version = "2.13.6"; src = fetchFromGitHub { owner = "NVIDIA"; - repo = pname; - rev = "v${version}"; + repo = finalAttrs.pname; + rev = "v${finalAttrs.version}"; hash = "sha256-3gSBQ0g6mnQ/MFXGflE+BqqrIUoiBgp8+fWRQOvLVkw="; }; - nativeBuildInputs = [ which cuda_nvcc ]; + strictDeps = true; + + nativeBuildInputs = [ + cudaPackages.cuda_nvcc + which + ]; buildInputs = [ - cuda_cudart - nccl + cudaPackages.cuda_cudart + cudaPackages.nccl ] ++ lib.optional mpiSupport mpi; makeFlags = [ - "CUDA_HOME=${cudatoolkit}" - "NCCL_HOME=${nccl}" + "CUDA_HOME=${cudaPackages.cuda_nvcc}" + "NCCL_HOME=${cudaPackages.nccl}" ] ++ lib.optionals mpiSupport [ "MPI=1" ]; @@ -45,10 +47,11 @@ cudaPackages.backendStdenv.mkDerivation rec { ''; meta = with lib; { - description = "Tests to check both the performance and the correctness of NVIDIA NCCL operations."; + description = "Tests to check both the performance and the correctness of NVIDIA NCCL operations"; homepage = "https://github.com/NVIDIA/nccl-tests"; platforms = [ "x86_64-linux" ]; license = licenses.bsd3; + broken = !config.cudaSupport || (mpiSupport && mpi == null); maintainers = with maintainers; [ jmillerpdt ]; }; -} +})