From aaba57ee2f59750ceb20976f0a12e1e844322c19 Mon Sep 17 00:00:00 2001 From: Andreas Schaafsma Date: Thu, 26 Feb 2026 02:46:01 +0100 Subject: [PATCH] add nv gpu passthrough vm setup --- .../hardware/graphics/passthrough_nvidia.nix | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 systems/x86_64-linux/drivebystation-nix/hardware/graphics/passthrough_nvidia.nix diff --git a/systems/x86_64-linux/drivebystation-nix/hardware/graphics/passthrough_nvidia.nix b/systems/x86_64-linux/drivebystation-nix/hardware/graphics/passthrough_nvidia.nix new file mode 100644 index 0000000..f65cefd --- /dev/null +++ b/systems/x86_64-linux/drivebystation-nix/hardware/graphics/passthrough_nvidia.nix @@ -0,0 +1,23 @@ +{ config, lib, system, pkgs, ... }: +{ + boot.kernelParams = [ + "amd_iommu=on" + "iommu=pt" + "vfio-pci.ids=10de:1b81,10de:10f0" + ]; + virtualisation.libvirtd = { + enable = true; + onBoot = "ignore"; + onShutdown = "shutdown"; + qemu.runAsRoot = true; + qemu.swtpm.enable = true; + qemu.package = pkgs.qemu_full; + }; + environment.systemPackages = with pkgs; [ + virtiofsd + config.virtualisation.libvirtd.qemu.package + looking-glass-client + virt-manager + libguestfs-with-appliance + ]; +} \ No newline at end of file