infrastructure/machines/krz01/_configuration.nix
Ryan Lahfa 4bedb3f497 feat(krz01): move the GPU stuff to the host for now
We also add a K80 specific patch for ollama.

Signed-off-by: Ryan Lahfa <ryan@dgnum.eu>
2024-10-09 09:33:57 +02:00

54 lines
1.3 KiB
Nix

{ lib, pkgs, ... }:
lib.extra.mkConfig {
enabledModules = [
# INFO: This list needs to stay sorted alphabetically
];
enabledServices = [
# INFO: This list needs to stay sorted alphabetically
"microvm-router01"
"nvidia-tesla-k80"
"proxmox"
# Machine learning API machine
"microvm-ml01"
];
extraConfig = {
microvm = {
host.enable = true;
};
dgn-hardware = {
useZfs = true;
zfsPools = [
"dpool"
"ppool0"
];
};
services.netbird.enable = true;
# We are going to use CUDA here.
nixpkgs.config.cudaSupport = true;
services.ollama = {
enable = true;
package =
(pkgs.ollama.override {
cudaPackages = pkgs.cudaPackages_11;
gcc12 = pkgs.gcc11;
}).overrideAttrs
(old: {
CMAKE_CUDA_ARCHITECTURES = "35";
ldflags = old.ldflags ++ [
# K80 is 3.5
"-X=github.com/ollama/ollama/gpu.CudaComputeMajorMin=3"
"-X=github.com/ollama/ollama/gpu.CudaComputeMinorMin=5"
];
patches = (old.patches or [ ]) ++ [ ./K80-support.patch ];
});
};
users.users.root.hashedPassword = "$y$j9T$eNZQgDN.J5y7KTG2hXgat1$J1i5tjx5dnSZu.C9B7swXi5zMFIkUnmRrnmyLHFAt8/";
};
root = ./.;
}