From 0fc63e4b7cf7d359c136e8d4cbee18e87de2b373 Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Fri, 17 Oct 2025 06:42:25 +0000 Subject: [PATCH] python3Packages.cupy: fix cuda_cudart stub linking Signed-off-by: Connor Baker --- pkgs/development/python-modules/cupy/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/python-modules/cupy/default.nix b/pkgs/development/python-modules/cupy/default.nix index 507e54f74e1a..e41a1b6cba11 100644 --- a/pkgs/development/python-modules/cupy/default.nix +++ b/pkgs/development/python-modules/cupy/default.nix @@ -63,6 +63,11 @@ buildPythonPackage rec { fetchSubmodules = true; }; + env.LDFLAGS = toString [ + # Fake libcuda.so (the real one is deployed impurely) + "-L${lib.getOutput "stubs" cudaPackages.cuda_cudart}/lib/stubs" + ]; + # See https://docs.cupy.dev/en/v10.2.0/reference/environment.html. Setting 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