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

llama-cpp: fix cuda support #277709

Merged
merged 1 commit into from
Jan 1, 2024

Conversation

happysalada
Copy link
Contributor

@happysalada happysalada commented Dec 30, 2023

Description of changes

this fixes cuda support.
an attempt at addressing #272569

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.

@happysalada happysalada mentioned this pull request Dec 30, 2023
12 tasks
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Dec 30, 2023
@happysalada happysalada force-pushed the llama_cpp_fix_cuda_support branch from e74b1b4 to e41c63d Compare December 30, 2023 17:27
@happysalada
Copy link
Contributor Author

@SomeoneSerge thank you for the detailed feedback, I think I integrated everything you pointed out.
let me know if anything else!

@ofborg ofborg bot requested a review from dit7ya December 30, 2023 18:00
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin labels Dec 30, 2023
@happysalada happysalada force-pushed the llama_cpp_fix_cuda_support branch 2 times, most recently from a8eea68 to 02c283f Compare December 31, 2023 08:08
@happysalada
Copy link
Contributor Author

Result of nixpkgs-review pr 277709 run on x86_64-linux 1

@happysalada
Copy link
Contributor Author

I've switched a system with cudaSupport to this PR and tested ollama works

@happysalada happysalada force-pushed the llama_cpp_fix_cuda_support branch from 02c283f to 47fc482 Compare December 31, 2023 15:57
@happysalada
Copy link
Contributor Author

@SomeoneSerge gave it another round of changes. Let me know.

@teto
Copy link
Member

teto commented Dec 31, 2023

if all the settings are exclusive, one solution could be to replace the booleans with a string target and check the string with checkListOfEnum "GPU target" [ "cuda" "rocm "openblas" ] ;

@SomeoneSerge
Copy link
Contributor

if all the settings are exclusive, one solution could be to replace the booleans with a string target and check the string with checkListOfEnum "GPU target" [ "cuda" "rocm "openblas" ] ;

I'm not sure what exactly is the situation upstream wrt the interaction of these options, so in a way the bool flags might be justified. They let the end-user try the cursed things out, and we do communicate the supported variants using broken. Otherwise, I like the suggestion

Copy link
Contributor

@SomeoneSerge SomeoneSerge left a comment

Choose a reason for hiding this comment

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

We should wait for Ofborg, but otherwise I think the PR is ready (within the scope suggested by the title)

Thanks @happysalada!

@delroth delroth added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Dec 31, 2023
@happysalada
Copy link
Contributor Author

Result of nixpkgs-review pr 277709 run on x86_64-linux 1

@happysalada
Copy link
Contributor Author

I've tested ollama on a system with cudaSupport with this PR.

@NickCao NickCao merged commit 001d496 into NixOS:master Jan 1, 2024
23 checks passed
@happysalada happysalada deleted the llama_cpp_fix_cuda_support branch January 1, 2024 17:19
@newAM newAM mentioned this pull request Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 1-10 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux 12.approvals: 1 This PR was reviewed and approved by one reputable person
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants