diff options
Diffstat (limited to 'pkgs/development/python-modules/cupy/default.nix')
-rw-r--r-- | pkgs/development/python-modules/cupy/default.nix | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/pkgs/development/python-modules/cupy/default.nix b/pkgs/development/python-modules/cupy/default.nix index 6311a7d099e79..8435c1e988dda 100644 --- a/pkgs/development/python-modules/cupy/default.nix +++ b/pkgs/development/python-modules/cupy/default.nix @@ -1,8 +1,8 @@ { lib, buildPythonPackage, - fetchPypi, - cython, + fetchFromGitHub, + cython_0, fastrlock, numpy, wheel, @@ -10,16 +10,15 @@ mock, setuptools, cudaPackages, - addOpenGLRunpath, + addDriverRunpath, pythonOlder, symlinkJoin, + fetchpatch }: let inherit (cudaPackages) cudnn cutensor nccl; - cudatoolkit-joined = symlinkJoin { - name = "cudatoolkit-joined-${cudaPackages.cudaVersion}"; - paths = with cudaPackages; [ + outpaths = with cudaPackages; [ cuda_cccl # <nv/target> cuda_cudart cuda_nvcc # <crt/host_defines.h> @@ -35,21 +34,35 @@ let # Missing: # cusparselt - ]; + ]; + cudatoolkit-joined = symlinkJoin { + name = "cudatoolkit-joined-${cudaPackages.cudaVersion}"; + paths = outpaths ++ lib.concatMap (f: lib.map f outpaths) [lib.getLib lib.getDev (lib.getOutput "static") (lib.getOutput "stubs")]; }; in buildPythonPackage rec { pname = "cupy"; - version = "13.0.0"; + version = "13.2.0"; format = "setuptools"; disabled = pythonOlder "3.7"; - src = fetchPypi { - inherit pname version; - hash = "sha256-LwTnhX9pKnEzYNycOwZwmAarhAT8o5ta+XIcBKKXmq4="; + src = fetchFromGitHub { + owner = "cupy"; + repo = "cupy"; + rev = "v13.2.0"; + hash = "sha256-vZAtpIZztmsYeJeuq7yl7kgZse2azrIM3efHDmUswJI="; + fetchSubmodules = true; }; + patches = [ + (fetchpatch { + url = + "https://github.com/cfhammill/cupy/commit/67526c756e4a0a70f0420bf0e7f081b8a35a8ee5.patch"; + hash = "sha256-WZgexBdM9J0ep5s+9CGZriVq0ZidCRccox+g0iDDywQ="; + }) + ]; + # See https://docs.cupy.dev/en/v10.2.0/reference/environment.html. Seting both # CUPY_NUM_BUILD_JOBS and CUPY_NUM_NVCC_THREADS to NIX_BUILD_CORES results in # a small amount of thrashing but it turns out there are a large number of @@ -63,8 +76,8 @@ buildPythonPackage rec { nativeBuildInputs = [ setuptools wheel - addOpenGLRunpath - cython + addDriverRunpath + cython_0 cudaPackages.cuda_nvcc ]; @@ -77,7 +90,6 @@ buildPythonPackage rec { NVCC = "${lib.getExe cudaPackages.cuda_nvcc}"; # FIXME: splicing/buildPackages CUDA_PATH = "${cudatoolkit-joined}"; - LDFLAGS = "-L${cudaPackages.cuda_cudart}/lib/stubs"; propagatedBuildInputs = [ fastrlock @@ -95,7 +107,7 @@ buildPythonPackage rec { postFixup = '' find $out -type f \( -name '*.so' -or -name '*.so.*' \) | while read lib; do - addOpenGLRunpath "$lib" + addDriverRunpath "$lib" done ''; |