infrastructure/machines/krz01/microvm-ml01.nix
Ryan Lahfa 8160b2762f feat(krz01): passthrough the nVidia Tesla K80 in ml01
This way, no need for reboot.

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

48 lines
1.2 KiB
Nix

_: {
microvm.autostart = [ "ml01" ];
microvm.vms.ml01 = {
config =
{ config, ... }:
{
nixpkgs.config.cudaSupport = true;
nixpkgs.config.nvidia.acceptLicense = true;
# Tesla K80 is not supported by the latest driver.
hardware.nvidia.package = config.boot.kernelPackages.nvidia_x11_legacy470;
# Don't ask.
services.xserver.videoDrivers = [ "nvidia" ];
networking.hostName = "ml01";
services.ollama = {
enable = true;
listenAddress = "0.0.0.0:11434";
sandbox = true;
acceleration = "cuda";
};
microvm = {
hypervisor = "cloud-hypervisor";
vcpu = 4;
mem = 4096;
balloonMem = 2048;
devices = [
# The nVidia Tesla K80
{
bus = "pci";
path = "0000:44:00.0";
}
{
bus = "pci";
path = "0000:45:00.0";
}
];
shares = [
{
source = "/nix/store";
mountPoint = "/nix/.ro-store";
tag = "ro-store";
proto = "virtiofs";
}
];
};
};
};
}