-
-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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: overhaul of how we package cuda packages #167016
Conversation
pkgs/development/compilers/cudatoolkit/redist/build-cuda-redist-package.nix
Outdated
Show resolved
Hide resolved
libcusolver = final.addBuildInputs prev.libcusolver [ | ||
prev.libcublas | ||
]; | ||
|
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.
TODO: nsight depends on Qt
In 163704#1086739688 I tried to start with a description of a hypothetical public interface that I feel wouldn't block any of our purposes. IIUC, the scope of the PR at hand is specifically to split cudatoolkit into smaller packages. In particular, how do you see (now and in the following PRs) the downstream derivations should consume cuda-related pieces; how does a maintainer handle a derivation in a package set that suddenly requires a custom combination of cuda packages; how does the end-user achieve the same in an overlay? |
This PR packages all the cudatoolkit parts in small packages. Some packages will need to be fixed with overrides. Try e.g. $ NIXPKGS_ALLOW_UNFREE=1 nix-build -A cudaToolkitPackages.libcusolver
A package needing one or more Cuda packages has as parameter buildInputs = ... ++ (with cudaToolkitPackages; [ cudnn ]); |
7322a38
to
bd120df
Compare
pkgs/development/compilers/cudatoolkit/redist/build-cuda-redist-package.nix
Show resolved
Hide resolved
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.
This is really great stuff @FRidh! Thanks for taking a stab at this! It really is a brave endeavor.
I mostly have a bunch of questions:
- Where are the JSON manifests coming from? How do we retrieve these? It would be great if we could also have a script to generate them, or at minimum some documentation as to how to build these for new releases, etc.
- Is there a reason to not collect all of the disparate packages as they exist today into a new folder structure a la
python-modules
? In other words, derivations are spread out today: cudatoolkit is in one directory, cuDNN is in another, same for cuTENSOR, etc. Could we collect all of those things into a commoncuda-packages
directory? - IIUC this abandons the old runfile way of building
cudatoolkit
in favor of the redist tarballs? If so, that's awesome! - I haven't tested this out locally yet... What do you see as the major blockers to moving forward with this?
Ok, I have a million questions but I'll stop here for now!
Echoing @SomeoneSerge's comment re API: It would be great to get some example code as to how packages can switch to this new package set. Obv this is draft-stage and all, but just something that we should document for future users as this PR matures and eventually lands! Might even be wiki-worthy material |
AFAIU right now only a single version of cudnn is supported per cudaPackages set. In order to workaround this, I'd suggest simply including every cudnn version in every cudaPackages set. The |
pkgs/development/compilers/cudatoolkit/redist/build-cuda-redist-package.nix
Show resolved
Hide resolved
I'm a dumdum it's |
FWIW I've found that this is the package set to build on linux:
Other things don't really are windows-only, or just aren't relevant to build. |
|
We could add a |
Awesome, I'm working on
Perhaps we should start a TODO list:
Perhaps other things I'm forgetting? |
Waiting for tests https://hercules-ci.com/github/SomeoneSerge/nixpkgs-unfree/jobs/221. |
|
||
meta = { | ||
description = attrs.name; | ||
license = lib.licenses.unfree; |
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.
Oh, by the way, we need licenses.unfreeRedistributable
! I don't remember if I have filters for meta.license.redistributable
, but numtide/nixpkgs-unfree iirc does
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.
From the previous discussions I understood that redistributable is something we desire, but seems isn't reality.
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.
We're literally downloading stuff from .../redist/...
URL.
Again, the only part that is not redistributable is libcuda.so
, which lives in nvidia_x11
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.
But! I thought I pointed at one of the expressions that were new. The cudatoolkit
has had unfree
license in previous revisions, so let's have that discussion in a separate PR
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.
I think the question is whether or not patchelf constitutes modification or not... but IANAL. We can always change the licenses in the future as necessary. I'm not sure how to get a definitive answer on these kinds of things.
🙃 I would |
https://hercules-ci.com/github/SomeoneSerge/nixpkgs-unfree/jobs/225 - the rebuld with cuda 11.5 - has finished.
EDIT2: let
cfg = { config.allowUnfree = true; config.cudaSupport = true; };
stable = import <nixpkgs> cfg;
master = import ./. cfg;
in {
stableList = stable.python3Packages.pytorch.cudaArchList;
masterList = master.python3Packages.pytorch.cudaArchList;
} nix-repl> archlists.masterList
[ ]
nix-repl> archlists.stableList
[ "3.5" "5.0" "5.2" "6.0" "6.1" "7.0" "7.0+PTX" "7.5" "7.5+PTX" ] |
There are many different versions of the `cudatoolkit` and related cuda packages, and it can be tricky to ensure they remain compatible. - `cudaPackages` is now a package set with `cudatoolkit`, `cudnn`, `cutensor`, `nccl`, as well as `cudatoolkit` split into smaller packages ("redist"); - expressions should now use `cudaPackages` as parameter instead of the individual cuda packages; - `makeScope` is now used, so it is possible to use `.overrideScope'` to set e.g. a different `cudnn` version; - `release-cuda.nix` is introduced to easily evaluate cuda packages using hydra.
18f44d1
to
ab8a744
Compare
Seems like some old style references were missed, Edit: #167985. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/how-to-install-a-specific-version-of-cuda-and-cudnn/21725/4 |
Reorganize how we handle cuda packages in Nixpkgs.
TODO:
Outside scope is to fix all cudatoolkit-redist packages. That can be done in a follow-up PR.
cc @obsidian-systems-maintenance
Description of changes
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes