Skip to content
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

gpt4all-cuda: fix CUDA initialization #342251

Merged

Conversation

haras-unicorn
Copy link
Contributor

Description of changes

Fixes #321928.

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.11 Release Notes (or backporting 23.11 and 24.05 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.

@ofborg ofborg bot requested review from polygon and Titaniumtown September 16, 2024 10:26
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1 labels Sep 16, 2024
@Titaniumtown
Copy link
Contributor

I do not have an nvidia gpu to test with. So I do not have any way of testing this.

@Titaniumtown
Copy link
Contributor

@VeilSilence Since you reported the original issue. Do you have a sec to test this? Lmk if you need an explanation on how to :)

@haras-unicorn
Copy link
Contributor Author

haras-unicorn commented Sep 16, 2024

i have this in my config so i just copied it over from there and it works for me but someone elses confirmation would be nice :)

      environment.systemPackages = with pkgs; [
        (gpt4all-cuda.overrideAttrs (final: prev: {
          nativeBuildInputs = (prev.nativeBuildInputs or [ ]) ++ [
            pkgs.autoAddDriverRunpath
          ];
        }))
      ];

@VeilSilence
Copy link

@VeilSilence Since you reported the original issue. Do you have a sec to test this? Lmk if you need an explanation on how to :)

{
  pkgs ?
    import (fetchTarball {
      url = "https://github.com/haras-unicorn/nixpkgs/archive/06c5b53ca56092bc65c2f6f30e31c8eeb87cbb7e.tar.gz";
    }) {
      config = {
        allowUnfree = true;
      };
    },
}:
pkgs.mkShell {
  buildInputs = [pkgs.gpt4all-cuda];
}

I made this shell, and build/launched gpt4all inside shell. gpt4all see cuda device, so if my test is correct, this merge request indeed fix this issue.

@Titaniumtown
Copy link
Contributor

Ok given the feedback I'll approve it. I have no qualms about the changes :)

Copy link
Contributor

@Titaniumtown Titaniumtown left a comment

Choose a reason for hiding this comment

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

LGTM. others said it fixed their issues.

@fabianhjr fabianhjr added 12.approvals: 1 This PR was reviewed and approved by one reputable person 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in the package labels Sep 17, 2024
@fabianhjr fabianhjr merged commit e2f071f into NixOS:master Sep 17, 2024
30 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1 12.approvals: 1 This PR was reviewed and approved by one reputable person 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in the package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gpt4all-cuda: No cuda acceleration
4 participants