nixpkgs/pkgs/development/python-modules/cupy/default.nix

66 lines
1.3 KiB
Nix
Raw Normal View History

{ lib, buildPythonPackage
, fetchPypi, isPy3k, cython
, fastrlock, numpy, six, wheel, pytestCheckHook, mock, setuptools
, cudatoolkit, cudnn, cutensor, nccl
, addOpenGLRunpath
2017-12-28 16:42:53 +00:00
}:
buildPythonPackage rec {
pname = "cupy";
version = "8.5.0";
disabled = !isPy3k;
2017-12-28 16:42:53 +00:00
src = fetchPypi {
inherit pname version;
sha256 = "fb3f8d3b3454beb249b9880502a45fe493c5a44efacc4c72914cbe1a5dbdf803";
2017-12-28 16:42:53 +00:00
};
preConfigure = ''
export CUDA_PATH=${cudatoolkit}
2020-08-25 03:07:09 +01:00
'';
nativeBuildInputs = [
addOpenGLRunpath
cython
];
LDFLAGS = "-L${cudatoolkit}/lib/stubs";
2017-12-28 16:42:53 +00:00
propagatedBuildInputs = [
cudatoolkit
cudnn
cutensor
2017-12-28 16:42:53 +00:00
nccl
fastrlock
numpy
six
setuptools
2017-12-28 16:42:53 +00:00
wheel
];
checkInputs = [
pytestCheckHook
mock
];
# Won't work with the GPU, whose drivers won't be accessible from the build
# sandbox
doCheck = false;
postFixup = ''
find $out -type f \( -name '*.so' -or -name '*.so.*' \) | while read lib; do
addOpenGLRunpath "$lib"
done
'';
2017-12-28 16:42:53 +00:00
enableParallelBuilding = true;
meta = with lib; {
2017-12-28 16:42:53 +00:00
description = "A NumPy-compatible matrix library accelerated by CUDA";
homepage = "https://cupy.chainer.org/";
2017-12-28 16:42:53 +00:00
license = licenses.mit;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ hyphon81 ];
};
}