From d97b9bbcd7c82696f9c0d764ea978e1a52934b7e Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Thu, 17 Oct 2024 22:50:41 +0200 Subject: [PATCH] lkajsdlakjsdlkjasd --- hardware/gpu/cuda.nix | 2 ++ hardware/gpu/rocm.nix | 1 + hosts/bolle/configuration.nix | 1 + hosts/eple/configuration.nix | 1 + hosts/garp/configuration.nix | 1 + hosts/known-hosts.toml | 6 +++--- profiles/services/ollama.nix | 7 +++++++ 7 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 profiles/services/ollama.nix diff --git a/hardware/gpu/cuda.nix b/hardware/gpu/cuda.nix index 5953b67..5c59db2 100644 --- a/hardware/gpu/cuda.nix +++ b/hardware/gpu/cuda.nix @@ -37,6 +37,8 @@ virtualisation.podman.enableNvidia = lib.mkDefault true; # deprecated hardware.nvidia-container-toolkit.enable = lib.mkDefault true; + services.ollama.acceleration = lib.mkDefault "cuda"; + # only do these per-host #hardware.nvidia.open = lib.mkDefault true; # open source version of kernel module, only on driver 515.43.04+ diff --git a/hardware/gpu/rocm.nix b/hardware/gpu/rocm.nix index 5e829c2..efc13d8 100644 --- a/hardware/gpu/rocm.nix +++ b/hardware/gpu/rocm.nix @@ -13,6 +13,7 @@ nixpkgs.config.vdpauSupport = true; nixpkgs.config.vaapiSupport = true; + services.ollama.acceleration = lib.mkDefault "rocm"; } (lib.mkIf (lib.versionAtLeast (lib.versions.majorMinor lib.version) "24.05") { hardware.amdgpu.opencl.enable = lib.mkDefault true; diff --git a/hosts/bolle/configuration.nix b/hosts/bolle/configuration.nix index a54afae..537ebbd 100644 --- a/hosts/bolle/configuration.nix +++ b/hosts/bolle/configuration.nix @@ -6,6 +6,7 @@ boot.loader.efi.efiSysMountPoint = "/boot/efi"; boot.binfmt.emulatedSystems = [ + "aarch64-linux" "riscv64-linux" ]; diff --git a/hosts/eple/configuration.nix b/hosts/eple/configuration.nix index 77cef4f..841159e 100644 --- a/hosts/eple/configuration.nix +++ b/hosts/eple/configuration.nix @@ -7,6 +7,7 @@ boot.binfmt.emulatedSystems = [ "aarch64-linux" + "riscv64-linux" ]; services.nfs.server.enable = false; # TODO: remove? diff --git a/hosts/garp/configuration.nix b/hosts/garp/configuration.nix index 739515e..4fec81b 100644 --- a/hosts/garp/configuration.nix +++ b/hosts/garp/configuration.nix @@ -5,6 +5,7 @@ boot.loader.efi.canTouchEfiVariables = true; boot.binfmt.emulatedSystems = [ + "aarch64-linux" "riscv64-linux" ]; diff --git a/hosts/known-hosts.toml b/hosts/known-hosts.toml index ff04125..d2bbaaa 100644 --- a/hosts/known-hosts.toml +++ b/hosts/known-hosts.toml @@ -43,7 +43,7 @@ ssh.connectTimeout = 3 ["bolle.pbsds.net"] -buildMachine.systems = ["x86_64-linux", "i686-linux", "riscv64-linux"] +buildMachine.systems = ["x86_64-linux", "i686-linux", "aarch64-linux", "riscv64-linux"] buildMachine.maxJobs = 3 # 12 threads 32GB buildMachine.speedFactor = 4 # ??? buildMachine.supportedFeatures = ["kvm", "big-parallel", "nixos-test"] @@ -52,7 +52,7 @@ ssh.proxyJump = "isvegg.pvv.ntnu.no" ["eple.pbsds.net"] # r9 290x aliases = [ "eple.tail9aac63.ts.net" ] -buildMachine.systems = ["x86_64-linux", "i686-linux", "aarch64-linux"] +buildMachine.systems = ["x86_64-linux", "i686-linux", "aarch64-linux", "riscv64-linux"] buildMachine.maxJobs = 3 # 12 threads 32GB buildMachine.speedFactor = 3 # i7-5820K buildMachine.supportedFeatures = ["kvm", "big-parallel", "nixos-test"] @@ -60,7 +60,7 @@ ssh.listenPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH03MEINNnjBvtmvN2QsC ssh.proxyJump = "isvegg.pvv.ntnu.no" ["garp.pbsds.net"] # gtx 1080 -buildMachine.systems = ["x86_64-linux", "i686-linux", "riscv64-linux"] +buildMachine.systems = ["x86_64-linux", "i686-linux", "aarch64-linux", "riscv64-linux"] buildMachine.maxJobs = 2 # 8 threads 32GB buildMachine.speedFactor = 4 # i7-6700 buildMachine.supportedFeatures = ["kvm", "big-parallel", "nixos-test", "cuda"] diff --git a/profiles/services/ollama.nix b/profiles/services/ollama.nix new file mode 100644 index 0000000..91e287e --- /dev/null +++ b/profiles/services/ollama.nix @@ -0,0 +1,7 @@ +{ config, pkgs, lib, ... }: + +{ + # http://localhost:11434/ + services.ollama.enable = true; + /* services.ollama.openFirewall = true; */ +}