-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cupy: Move cudatoolkit to propagatedNativeBuildInputs to fix Thrust #77708
base: master
Are you sure you want to change the base?
Conversation
The nvcc binary needs to be found in PATH at build time for Thrust support to be enabled. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
@@ -18,8 +18,11 @@ buildPythonPackage rec { | |||
mock | |||
]; | |||
|
|||
propagatedBuildInputs = [ | |||
propagatedNativeBuildInputs = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it's just for nvcc to be on the path, this makes sense. Is there more that cudatoolkit provides?
My main concern is for cross compilation, in which it will get a binary of the wrong architecture.
However, seeing as linuxPackages.nvidia_x11
gets propagated as well, this expression probably isn't very cross compilation friendly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cudatoolkit
has both nvcc
used at build time and libraries linked at runtime. I have no idea whether it might support cross compilation. But the question is entirely moot at this time, as we only package it for Linux x86-64.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cudatoolkit
has bothnvcc
used at build time and libraries linked at runtime.
If cudatoolkit
doesn't contain any python libraries then it should not be in propagated
. Now for libraries to link it should be in buildInputs
. I believe, there is some strange thing that may be specific to python derivations, where binaries may not be visible unless they are also in nativeBuildInputs
[1]. I never dug into this, but it seems like a bug in nixpkgs, so you might need to also have it in nativeBuildInputs
as a workaround.
[1] #64047 (comment)
@andersk Could you please rebase. |
I marked this as stale due to inactivity. → More info |
Motivation for this change
The
nvcc
binary needs to be found inPATH
at build time for Thrust support to be enabled.Test case: check the
cupy.cuda.thrust_enabled
boolean, or try to usecupy.sort
, which doesn’t work without Thrust.Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)cc @hyphon81