diff --git a/machines/krz01/_configuration.nix b/machines/krz01/_configuration.nix index f63a9a1..154edfe 100644 --- a/machines/krz01/_configuration.nix +++ b/machines/krz01/_configuration.nix @@ -10,6 +10,8 @@ lib.extra.mkConfig { "microvm-router01" "nvidia-tesla-k80" "proxmox" + # Machine learning API machine + "microvm-ml01" ]; extraConfig = { @@ -24,6 +26,9 @@ lib.extra.mkConfig { services.netbird.enable = true; + # We are going to use CUDA here. + nixpkgs.config.cudaSupport = true; + users.users.root.hashedPassword = "$y$j9T$eNZQgDN.J5y7KTG2hXgat1$J1i5tjx5dnSZu.C9B7swXi5zMFIkUnmRrnmyLHFAt8/"; }; diff --git a/machines/krz01/microvm-ml01.nix b/machines/krz01/microvm-ml01.nix new file mode 100644 index 0000000..5980524 --- /dev/null +++ b/machines/krz01/microvm-ml01.nix @@ -0,0 +1,22 @@ +_: { + microvm.autostart = [ "ml01" ]; + microvm.vms.ml01 = { + config = { + networking.hostName = "ml01"; + services.ollama = { + enable = true; + listenAddress = "0.0.0.0:11434"; + sandbox = true; + acceleration = "cuda"; + }; + microvm.shares = [ + { + source = "/nix/store"; + mountPoint = "/nix/.ro-store"; + tag = "ro-store"; + proto = "virtiofs"; + } + ]; + }; + }; +} diff --git a/machines/krz01/nvidia-tesla-k80.nix b/machines/krz01/nvidia-tesla-k80.nix index 2828369..3d7f6ba 100644 --- a/machines/krz01/nvidia-tesla-k80.nix +++ b/machines/krz01/nvidia-tesla-k80.nix @@ -1,5 +1,8 @@ { config, ... }: { + nixpkgs.config.nvidia.acceptLicense = true; # Tesla K80 is not supported by the latest driver. - hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages_legacy_470; + hardware.nvidia.package = config.boot.kernelPackages.nvidia_x11_legacy470; + # Don't ask. + services.xserver.videoDrivers = [ "nvidia" ]; }