Skip to content

cudaPackages.nccl: only ever builds with default version of cudaPackages #221895

@ConnorBaker

Description

@ConnorBaker

Describe the bug

nccl is only ever built with the default version of cudaPackages because the line which adds the derivation never changes the version of cudaPackages provided:

https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/cuda-packages.nix#L48

I confirmed this by making this change to the nccl derivation

cuda-redist = throw "cudaPackages.cudaVersion is ${cudaPackages.cudaVersion}";

and trying to build it with two different versions of cudaPackages. Notice that the error is the same:

Details
[connorbaker@fedora nixpkgs]$ nix build --impure -L .#cudaPackages.nccl
warning: Git tree '/home/connorbaker/Documents/nixpkgs' is dirty
error:
       … while calling the 'derivationStrict' builtin

         at //builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'nccl-2.16.5-1-cuda-11.7'
         whose name attribute is located at /nix/store/bh247jakm9gvjrif38ssqz90zfgqxy05-source/pkgs/stdenv/generic/make-derivation.nix:302:7

       … while evaluating attribute 'nativeBuildInputs' of derivation 'nccl-2.16.5-1-cuda-11.7'

         at /nix/store/bh247jakm9gvjrif38ssqz90zfgqxy05-source/pkgs/stdenv/generic/make-derivation.nix:342:7:

          341|       depsBuildBuild              = lib.elemAt (lib.elemAt dependencies 0) 0;
          342|       nativeBuildInputs           = lib.elemAt (lib.elemAt dependencies 0) 1;
             |       ^
          343|       depsBuildTarget             = lib.elemAt (lib.elemAt dependencies 0) 2;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: cudaPackages.cudaVersion is 11.7
[connorbaker@fedora nixpkgs]$ nix build --impure -L .#cudaPackages_11_8.nccl
warning: Git tree '/home/connorbaker/Documents/nixpkgs' is dirty
error:
       … while calling the 'derivationStrict' builtin

         at //builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'nccl-2.16.5-1-cuda-11.7'
         whose name attribute is located at /nix/store/bh247jakm9gvjrif38ssqz90zfgqxy05-source/pkgs/stdenv/generic/make-derivation.nix:302:7

       … while evaluating attribute 'nativeBuildInputs' of derivation 'nccl-2.16.5-1-cuda-11.7'

         at /nix/store/bh247jakm9gvjrif38ssqz90zfgqxy05-source/pkgs/stdenv/generic/make-derivation.nix:342:7:

          341|       depsBuildBuild              = lib.elemAt (lib.elemAt dependencies 0) 0;
          342|       nativeBuildInputs           = lib.elemAt (lib.elemAt dependencies 0) 1;
             |       ^
          343|       depsBuildTarget             = lib.elemAt (lib.elemAt dependencies 0) 2;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: cudaPackages.cudaVersion is 11.7

In python-packages.nix the pattern seems to be passing pythonPackages = self. However, it is relatively rare that the derivation takes pythonPackages as an argument. Instead, it seems to be preferred to have the derivation take, as arguments, the actual python packages required.

To bring the NCCL derivation in line with this pattern, it should take the CUDA packages it requires as arguments.

Notify maintainers

@NixOS/cuda-maintainers

Metadata

Metadata

Assignees

Labels

0.kind: bugSomething is broken6.topic: cudaParallel computing platform and API
No fields configured for issues without a type.

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions