Skip to content

gpt4all-cuda: use gcc12 for cuda (fixes build)#434165

Open
Titaniumtown wants to merge 3 commits intoNixOS:masterfrom
Titaniumtown:pr/fix-gpt4all-cuda
Open

gpt4all-cuda: use gcc12 for cuda (fixes build)#434165
Titaniumtown wants to merge 3 commits intoNixOS:masterfrom
Titaniumtown:pr/fix-gpt4all-cuda

Conversation

@Titaniumtown
Copy link
Contributor

@Titaniumtown Titaniumtown commented Aug 16, 2025

Closes #409674

Cuda was not happy that gcc14 was being used as the cuda compiler. For the cuda bits we should be using gcc12.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@Titaniumtown
Copy link
Contributor Author

@ofborg build gpt4all-cuda

(lib.cmakeBool "LLMODEL_KOMPUTE" false)
]
++ lib.optionals cudaSupport [
"-DCUDA_HOST_COMPILER=${gcc12Stdenv.cc}/bin/c++"
Copy link
Member

Choose a reason for hiding this comment

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

have you tried using cudaPackages.backendStdenv.cc ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

woah. Ok cool I will do that instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nevermind, it explodes in the same way. Reverting!

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. labels Aug 16, 2025
lib,
config,
stdenv,
gcc12Stdenv,
Copy link
Member

Choose a reason for hiding this comment

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

how about in all-packages.nix ?

override { stdenv = gcc12Stdenv };

also this should be resolved soon in nvcc

NVIDIA/nccl#1743

leave a link to the issue in the override

Copy link
Member

@emilazy emilazy left a comment

Choose a reason for hiding this comment

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

GCC 12 is EOL and about to be removed. Current versions of CUDA support up to GCC 14. I believe you want to use stdenv' = if cudaSupport then cudaPackages.backendStdenv else stdenv; here.

Edit: Okay, I see that that was tried and there is another issue here. But we shouldn’t be adding more references to GCC 12. Perhaps using another CUDA version will fix this?

@kirillrdy
Copy link
Member

builds with

  gpt4all-cuda = gpt4all.override {
    cudaSupport = true;
    cudaPackages = cudaPackages_12_6;
  };

@Titaniumtown
Copy link
Contributor Author

@kirillrdy I will test this. I need to investigate why it's so out of date then, thank you!

@iedame iedame mentioned this pull request Oct 19, 2025
13 tasks
@nixpkgs-ci nixpkgs-ci bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build failure: gpt4all-cuda

3 participants