-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
cudaPackages: split outputs #224533
Comments
I find this writing a split derivation. We add the outputs = [ "out" "static" ];
nativeBuildInputs = [
autoPatchelfHook
# This hook will make sure libcuda can be found
# in typically /lib/opengl-driver by adding that
# directory to the rpath of all ELF binaries.
# Check e.g. with `patchelf --print-rpath path/to/my/binary
autoAddOpenGLRunpathHook
];
dontBuild = true;
# TODO: choose whether to install static/dynamic libs
installPhase = ''
runHook preInstall
rm LICENSE
mkdir -p $out $static/lib
mv * $out
runHook postInstall
''; What about other libraries, headers and so on that are not needed in the runtime closure? Should we separate those as well? For example: Now how do we actually move those static libraries in the
I see for example at Issue #164141 that these static libraries are a general problem, and not so trivial it seems. I am looking for the possible ways to move those static libraries into the static directory. I find that using # TODO: choose whether to install static/dynamic libs
installPhase = ''
runHook preInstall
rm LICENSE
mkdir -p $out $static/lib
mv * $out
find $out -name "*.a" -exec mv {} $static/lib/ \;
runHook postInstall
''; Now when I try to save the file I do not have permissions to do so: Failed to save 'build-cuda-redist-package.nix': Unable to write file '/nix/store/26d6xg6m11gp22al1gxr1h8zdfmf9j94-source/pkgs/development/compilers/cudatoolkit/redist/build-cuda-redist-package.nix' (Unknown (FileSystemError): Error: EROFS: read-only file system, open '/nix/store/26d6xg6m11gp22al1gxr1h8zdfmf9j94-source/pkgs/development/compilers/cudatoolkit/redist/build-cuda-redist-package.nix') I'm doing something dumb with the environment. I haven't understood the way one enters the nix shell or if this is needed here as well. First I did nix eval --impure --expr "<nixpkgs>"
/nix/store/26d6xg6m11gp22al1gxr1h8zdfmf9j94-source I have to investigate more. Reading the nixpkgs manual and watching Nixpkgs - Adding a package to unstable/master branch by Jon Ringer |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/cuda-team-roadmap-and-call-for-sponsors/29495/1 |
I'll be working on this. #229758 seems important for what we aim to do. I'll correspond with the author to see what their thoughts are. |
Closed by #240498. |
Issue description
A tracking issue, redirected from #217780
Currently our
build-cuda-redist-package.nix
puts static archives, executables, and headers with shared libraries into the same output. This means we cannot meaningfully separatebuildInputs
fromnativeBuildInputs
, and that CUDAToolkit's static archives end up in runtime closures for packages like jax and pytorch.Splitting the outputs should be trivial: add an output in
build-cuda-redist-package.nix
, move.a
files to the new output.There is a chance of breaking discovery for downstream packages though, which may take time to fix
CC @NixOS/cuda-maintainers
The text was updated successfully, but these errors were encountered: