Ollama: Difference between revisions
Malteneuss (talk | contribs) m Add standalone amd override hint |
This has been changed so that it actually overrides the proper env vars. The last format shouldn't work as the convention is to use 10.3.0 for other rocm devices. |
||
(3 intermediate revisions by one other user not shown) | |||
Line 13: | Line 13: | ||
services.ollama = { | services.ollama = { | ||
enable = true; | enable = true; | ||
# Optional: | # Optional: preload models, see https://ollama.com/library | ||
loadModels = [ .. | loadModels = [ "llama3.2:3b" "deepseek-r1:1.5b"]; | ||
}; | }; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 102: | Line 102: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
# classical | |||
$ nix-shell -p "rocmPackages.rocminfo" --run "rocminfo" | grep "gfx" | $ nix-shell -p "rocmPackages.rocminfo" --run "rocminfo" | grep "gfx" | ||
Name: gfx1031 | |||
# flakes | |||
$ nix run nixpkgs#"rocmPackages.rocminfo" -- --run "rocminfo" | grep "gfx" | |||
Name: gfx1031 | Name: gfx1031 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 114: | Line 119: | ||
HCC_AMDGPU_TARGET = "gfx1031"; # used to be necessary, but doesn't seem to anymore | HCC_AMDGPU_TARGET = "gfx1031"; # used to be necessary, but doesn't seem to anymore | ||
}; | }; | ||
# results in environment variable "HSA_OVERRIDE_GFX_VERSION=10.3. | # results in environment variable "HSA_OVERRIDE_GFX_VERSION=10.3.0" | ||
rocmOverrideGfx = "10.3. | rocmOverrideGfx = "10.3.0"; | ||
}; | }; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 121: | Line 126: | ||
or via an environment variable in front of the standalone app | or via an environment variable in front of the standalone app | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
HSA_OVERRIDE_GFX_VERSION=10.3. | HSA_OVERRIDE_GFX_VERSION=10.3.0 ollama serve | ||
</syntaxhighlight> | </syntaxhighlight> | ||