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 uses the wrong cmake flag to build for ROCM #364708

Closed
HiroseKoichi opened this issue Dec 12, 2024 · 0 comments · Fixed by #380550
Closed

llama-cpp uses the wrong cmake flag to build for ROCM #364708

HiroseKoichi opened this issue Dec 12, 2024 · 0 comments · Fixed by #380550
Labels
0.kind: bug Something is broken

Comments

@HiroseKoichi
Copy link

HiroseKoichi commented Dec 12, 2024

llama-cpp uses the wrong cmake flag to build for ROCM

The cmake flag to enable ROCM support in llamacpp has changed from GGML_HIPBLAS to GGML_HIP. The llama-cpp package in Nixos still uses GGML_HIPBLAS to build on ROCM enabled systems, which results in llamacpp being built with only CPU support:

warning: not compiled with GPU offload support, --gpu-layers option will be ignored
warning: see main README.md for information on enabling GPU BLAS support

Steps To Reproduce

Steps to reproduce the behavior:

  1. Add llama-cpp to environment.systemPackages in configuartion.nix
  2. Rebuild the configuration with nixos-rebuild switch
  3. Attempt to run a model using llama-server, which notifies you that llamacpp was not built with GPU support

Expected behavior

Llama-cpp being built with GPU support on AMD hardware.

Additional context

A workaround is to add an overlay to the package to include the new cmake flag:

((pkgs.llama-cpp.overrideAttrs (finalAttrs: previousAttrs: {
cmakeFlags = (previousAttrs.cmakeFlags ++ [ "-DGGML_HIP=ON" ]);
})).override { rocmSupport = true; })

This results in llama-cpp successfully being built with GPU support on AMD hardware.

Metadata

  • system: "x86_64-linux"
  • host os: Linux 6.12.2-zen1, NixOS, 24.11 (Vicuna), 24.11.710905.a0f3e10d9435
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.24.10
  • channels(root): "nixos-24.11"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

Notify maintainers

@dit7ya, @elohmeier, @philiptaron, @xddxdd


Note for maintainers: Please tag this issue in your PR.


Add a 👍 reaction to issues you find important.

@HiroseKoichi HiroseKoichi added the 0.kind: bug Something is broken label Dec 12, 2024
@HiroseKoichi HiroseKoichi changed the title llama-cpp won't build with GPU support on AMD hardware llama-cpp uses the wrong cmake flag to build for ROCM Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant