nixpkgs/pkgs/development/libraries/science/math/nccl/default.nix

49 lines
1.2 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitHub, which, cudatoolkit, addOpenGLRunpath }:
2017-12-28 16:40:28 +00:00
2019-02-10 01:20:04 +00:00
stdenv.mkDerivation rec {
name = "nccl-${version}-cuda-${cudatoolkit.majorVersion}";
version = "2.4.2-1";
src = fetchFromGitHub {
owner = "NVIDIA";
repo = "nccl";
rev = "v${version}";
sha256 = "0aa4gv51nbmmdhx6vp40l249m4arp30sijrn6kwxdfi1k9kajiq5";
2017-12-28 16:40:28 +00:00
};
2019-02-10 01:20:04 +00:00
outputs = [ "out" "dev" ];
2017-12-28 16:40:28 +00:00
nativeBuildInputs = [ which addOpenGLRunpath ];
2019-02-10 01:20:04 +00:00
buildInputs = [ cudatoolkit ];
preConfigure = ''
patchShebangs src/collectives/device/gen_rules.sh
'';
makeFlags = [
"CUDA_HOME=${cudatoolkit}"
"PREFIX=$(out)"
];
postFixup = ''
moveToOutput lib/libnccl_static.a $dev
# Set RUNPATH so that libnvidia-ml in /run/opengl-driver(-32)/lib can be found.
# See the explanation in addOpenGLRunpath.
addOpenGLRunpath $out/lib/lib*.so
2019-02-10 01:20:04 +00:00
'';
NIX_CFLAGS_COMPILE = [ "-Wno-unused-function" ];
enableParallelBuilding = true;
2017-12-28 16:40:28 +00:00
2019-02-10 01:20:04 +00:00
meta = with stdenv.lib; {
description = "Multi-GPU and multi-node collective communication primitives for NVIDIA GPUs";
homepage = https://developer.nvidia.com/nccl;
license = licenses.bsd3;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ mdaiter orivej ];
2017-12-28 16:40:28 +00:00
};
}