ollama: enable AMD GPU acceleration

This commit is contained in:
2024-10-12 23:10:42 +00:00
parent 643a6e8309
commit cba800ca17
2 changed files with 11 additions and 0 deletions

View File

@@ -1,4 +1,6 @@
# ollama: <https://github.com/ollama/ollama>
# - <https://wiki.nixos.org/wiki/Ollama>
#
# use: `ollama run llama3.2`
# or use a remote session: <https://github.com/ggozad/oterm>
#
@@ -23,6 +25,13 @@ in
services.ollama.group = "ollama";
services.ollama.models = models;
# these acceleration settings are relevant to `desko`.
# docs also suggest nixpkgs needs to be built with `rocmSupport` (which it isn't, by default),
# but i still see GPU offload even without that.
services.ollama.acceleration = "rocm"; # AMD GPU acceleration
services.ollama.rocmOverrideGfx = "10.1.0"; #< `nix-shell -p "rocmPackages.rocminfo" --run "rocminfo" | grep "gfx"`
# services.ollama.environmentVariables.HCC_AMDGPU_TARGET = "gfx1010"; # seems to be unnecessary
users.groups.ollama = {};
users.users.ollama = {