11{
22 lib ,
3- stdenv ,
43 buildPythonPackage ,
54 fetchFromGitHub ,
5+
6+ # build-system
67 cython ,
7- fastrlock ,
8- numpy ,
9- pytestCheckHook ,
10- mock ,
118 setuptools ,
9+
10+ # nativeBuildInputs
1211 cudaPackages ,
13- addDriverRunpath ,
1412 symlinkJoin ,
13+ addDriverRunpath ,
14+
15+ # dependencies
16+ numpy ,
17+ cuda-pathfinder ,
18+
19+ # tests
20+ pytest-mock ,
21+ pytestCheckHook ,
1522} :
1623
1724let
3946 libcurand
4047 libcusolver
4148 libcusparse
42- # NOTE: libcusparse_lt is too new for CuPy, so we must do without.
43- # libcusparse_lt
49+ libcusparse_lt # cusparseLt.h
4450 ]
4551 ) ;
4652 cudatoolkit-joined = symlinkJoin {
4955 outpaths ++ lib . concatMap ( outpath : lib . map ( output : outpath . ${ output } ) outpath . outputs ) outpaths ;
5056 } ;
5157in
52- buildPythonPackage . override { stdenv = cudaPackages . backendStdenv ; } rec {
58+ buildPythonPackage . override { stdenv = cudaPackages . backendStdenv ; } ( finalAttrs : {
5359 pname = "cupy" ;
54- version = "13.6.0 " ;
60+ version = "14.0.1 " ;
5561 pyproject = true ;
5662
5763 src = fetchFromGitHub {
5864 owner = "cupy" ;
5965 repo = "cupy" ;
60- tag = "v${ version } " ;
61- hash = "sha256-nU3VL0MSCN+mI5m7C5sKAjBSL6ybM6YAk5lJiIDY0ck=" ;
66+ tag = "v${ finalAttrs . version } " ;
6267 fetchSubmodules = true ;
68+ hash = "sha256-TaEJ0BveUCXCRrNq9L49Tfbu0334+cANcVm5qnSOE1Q=" ;
6369 } ;
6470
71+ postPatch = ''
72+ substituteInPlace pyproject.toml \
73+ --replace-fail \
74+ "Cython>=3.1,<3.2" \
75+ "Cython"
76+ '' ;
77+
6578 env = {
6679 LDFLAGS = toString [
6780 # Fake libcuda.so (the real one is deployed impurely)
@@ -83,7 +96,7 @@ buildPythonPackage.override { stdenv = cudaPackages.backendStdenv; } rec {
8396
8497 build-system = [
8598 cython
86- fastrlock
99+ # fastrlock
87100 setuptools
88101 ] ;
89102
@@ -100,13 +113,13 @@ buildPythonPackage.override { stdenv = cudaPackages.backendStdenv; } rec {
100113 ] ;
101114
102115 dependencies = [
103- fastrlock
116+ cuda-pathfinder
104117 numpy
105118 ] ;
106119
107120 nativeCheckInputs = [
121+ pytest-mock
108122 pytestCheckHook
109- mock
110123 ] ;
111124
112125 # Won't work with the GPU, whose drivers won't be accessible from the build
@@ -124,12 +137,12 @@ buildPythonPackage.override { stdenv = cudaPackages.backendStdenv; } rec {
124137 meta = {
125138 description = "NumPy-compatible matrix library accelerated by CUDA" ;
126139 homepage = "https://cupy.chainer.org/" ;
127- changelog = "https://github.com/cupy/cupy/releases/tag/${ src . tag } " ;
140+ changelog = "https://github.com/cupy/cupy/releases/tag/${ finalAttrs . src . tag } " ;
128141 license = lib . licenses . mit ;
129142 platforms = [
130143 "aarch64-linux"
131144 "x86_64-linux"
132145 ] ;
133146 maintainers = with lib . maintainers ; [ GaetanLepage ] ;
134147 } ;
135- }
148+ } )
0 commit comments