Ollama: Difference between revisions

m Configuration of GPU acceleration: Document vulkan option
Updated syntax for systemd service config (acceleration -> package); have not tested standalone package config
 
Line 19: Line 19:


== Configuration of GPU acceleration ==
== Configuration of GPU acceleration ==
Its possible to use following values for acceleration:
Acceleration is configured by selecting a package:
* false: disable GPU, only use CPU
* ollama-cpu: disable GPU, only use CPU
* "rocm": supported by most modern AMD GPUs
* ollama-rocm: supported by most modern AMD GPUs
* "cuda": supported by most modern NVIDIA GPUs
* ollama-cuda: supported by most modern NVIDIA GPUs
* "vulkan": supported by most modern GPUs on Linux
* ollama-vulkan: supported by most modern GPUs on Linux




Line 41: Line 41:
services.ollama = {
services.ollama = {
   enable = true;
   enable = true;
   acceleration = "cuda";
   package = pkgs.ollama-cuda;
};
};
</syntaxhighlight>
</syntaxhighlight>
Line 128: Line 128:
services.ollama = {
services.ollama = {
   enable = true;
   enable = true;
   acceleration = "rocm";
   package = pkgs.ollama-rocm;
   environmentVariables = {
   environmentVariables = {
     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