modules(system.services.ollama): Set acceleration in gpu conf
This commit is contained in:
parent
cda0d66117
commit
de5f89f526
3 changed files with 7 additions and 3 deletions
|
@ -12,6 +12,10 @@ in
|
||||||
};
|
};
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||||
|
|
||||||
|
# Set acceleration to rocm
|
||||||
|
services.ollama.acceleration = "rocm";
|
||||||
|
|
||||||
# Load amdgpu driver for Xorg and Wayland
|
# Load amdgpu driver for Xorg and Wayland
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
@ -14,6 +14,9 @@ in
|
||||||
# Load nvidia driver for Xorg and Wayland
|
# Load nvidia driver for Xorg and Wayland
|
||||||
services.xserver.videoDrivers = ["nvidia"];
|
services.xserver.videoDrivers = ["nvidia"];
|
||||||
|
|
||||||
|
# Set acceleration to cuda
|
||||||
|
services.ollama.acceleration = "cuda";
|
||||||
|
|
||||||
hardware = {
|
hardware = {
|
||||||
graphics = {
|
graphics = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
cfg = config.modules.system.services.ollama;
|
cfg = config.modules.system.services.ollama;
|
||||||
nvidiaEnabled = config.modules.system.hardware.nvidia.enable;
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.modules.system.services.ollama = {
|
options.modules.system.services.ollama = {
|
||||||
|
@ -14,8 +13,6 @@ in
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
services.ollama = {
|
services.ollama = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
acceleration = if nvidiaEnabled then "cuda" else null;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue