Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Of course. Here it is.

  boot.kernelModules = [ "kvm-amd" "vfio_virqfd" "vfio_pci" "vfio_iommu_type1" "vfio" ];
  boot.extraModprobeConfig = "options vfio-pci ids=10de:1e04,10de:10f7,10de:1ad6,10de:1ad7";
  boot.kernelParams = [ "amd_iommu=on" /*"video=efifb:off" if you have only one GPU and want to keep the vBIOS intact*/ ];

  virtualisation = {
    lxc.enable = true;
    lxd.enable = true;

    libvirtd = {
      enable = true;
      qemuOvmf = true;
      qemuVerbatimConfig = ''
        namespaces = []
        dynamic_ownership = 0
      '';
    };
  };
Make sure your environment.systemPackages include qemu-kvm and virtmanager.

And that's about it really. All you need to do after this is to go to virt-manager and create a new VM and add your GPU.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: