nixos/ollama: add vulkan acceleration option

This commit is contained in:
Paul Grandperrin
2025-11-21 16:10:41 +01:00
parent b0369b28e3
commit 7014a71155
3 changed files with 20 additions and 0 deletions
+2
View File
@@ -103,6 +103,7 @@ in
false
"rocm"
"cuda"
"vulkan"
]
);
default = null;
@@ -119,6 +120,7 @@ in
- may require overriding gpu type with `services.ollama.rocmOverrideGfx`
if rocm doesn't detect your AMD gpu
- `"cuda"`: supported by most modern NVIDIA GPUs
- `"vulkan"`: supported by most modern GPUs on Linux
'';
};
rocmOverrideGfx = lib.mkOption {
+1
View File
@@ -1136,6 +1136,7 @@ in
ollama = runTest ./ollama.nix;
ollama-cuda = runTestOn [ "x86_64-linux" "aarch64-linux" ] ./ollama-cuda.nix;
ollama-rocm = runTestOn [ "x86_64-linux" "aarch64-linux" ] ./ollama-rocm.nix;
ollama-vulkan = runTestOn [ "x86_64-linux" "aarch64-linux" ] ./ollama-vulkan.nix;
ombi = runTest ./ombi.nix;
omnom = runTest ./omnom;
oncall = runTest ./web-apps/oncall.nix;
+17
View File
@@ -0,0 +1,17 @@
{ lib, ... }:
{
name = "ollama-vulkan";
meta.maintainers = with lib.maintainers; [ abysssol ];
nodes.vulkan =
{ ... }:
{
services.ollama.enable = true;
services.ollama.acceleration = "vulkan";
};
testScript = ''
vulkan.wait_for_unit("multi-user.target")
vulkan.wait_for_open_port(11434)
'';
}