Skip to content

cudaPackages: eliminate exceptions#276800

Merged
SomeoneSerge merged 2 commits intoNixOS:masterfrom
SomeoneSerge:fix/cuda-no-throw
Dec 26, 2023
Merged

cudaPackages: eliminate exceptions#276800
SomeoneSerge merged 2 commits intoNixOS:masterfrom
SomeoneSerge:fix/cuda-no-throw

Conversation

@SomeoneSerge
Copy link
Contributor

@SomeoneSerge SomeoneSerge commented Dec 25, 2023

as they break common nixpkgs tools like lib.meta,
cf. #276795

@NixOS/cuda-maintainers

Description of changes

Before:

Before:
❯ nix repl --show-trace
Welcome to Nix 2.19.2. Type :? for help.
nix-repl> :lf nixpkgs
nix-repl> with legacyPackages.aarch64-darwin; lib.meta.availableOn "aarch64-darwin" cudaPackages.cuda_nvcc
...
       … while calling 'getRedistArch'
...
       error: Unsupported Nix system: aarch64-darwin

After:

nix-repl> with legacyPackages.aarch64-darwin; lib.meta.availableOn "aarch64-darwin" cudaPackages.cuda_nvcc
false
nix-repl> with legacyPackages.x86_64-darwin; cudaPackages.cuda_nvcc.meta.unsupported  
true
nix-repl> with legacyPackages.x86_64-linux; cudaPackages.cuda_nvcc.meta.unsupported  
false

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@SomeoneSerge SomeoneSerge added the 6.topic: cuda Parallel computing platform and API label Dec 25, 2023
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can make this warn "Unknown architecture: ${cap}" "sm_${...}" later. Right now I just want cleaner eval

@SomeoneSerge SomeoneSerge force-pushed the fix/cuda-no-throw branch 2 times, most recently from 9fb3b38 to 95a3b0d Compare December 26, 2023 00:12
@github-actions github-actions bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Dec 26, 2023
@ofborg ofborg bot added the 8.has: package (new) This PR adds a new package label Dec 26, 2023
@ofborg ofborg bot added 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Dec 26, 2023
@delroth delroth added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels Dec 26, 2023
@SomeoneSerge
Copy link
Contributor Author

Some of the outPaths have changed because the "unsupported" packages now have more outputs. Stuff like opencv4 and torch hasn't been affected, only the unsupported stuff has.

The solutions here are highly sub-optimal. There are upcoming refactors to the evalModules bit (incl. in Connor's cross-compilation PR) which might address this properly. It took some effort to satisfy Ofborg here without more global changes.

Ofborg happy, and thanks to @aidalgol for the review. Merging this so we can start using meta.unsupported

@SomeoneSerge SomeoneSerge merged commit 86b7775 into NixOS:master Dec 26, 2023
};

meta = with lib; {
badPlatforms = lib.optionals cudaSupport lib.platforms.darwin;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was required because of the "missing attribute cudnn_8_6"

@infinisil
Copy link
Member

This indirectly broke the channel build, fix in #279684

infinisil added a commit that referenced this pull request Jan 8, 2024
This very weirdly broke the channel evaluation: https://hydra.nixos.org/build/245871962/nixlog/1

It appears that this attribute is only evaluated by Hydra, _not_ by
ofborg. So this wouldn't have been detected by CI anyways in the PR that
introduced the problem: #276800.

However, due to #271123 (comment),
the channel only broke once that was fixed with #278777

Whether the fix is good, I don't know, but the failing-on-darwin attribute
doesn't exist anymore with this commit, making the tarball build succeed
again:

    nix-build pkgs/top-level/release.nix -A tarball
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: cuda Parallel computing platform and API 6.topic: python Python is a high-level, general-purpose programming language. 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages.

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

4 participants