Skip to content

Instantly share code, notes, and snippets.

@vroad
vroad / Readme.md
Last active December 28, 2021 07:38 — forked from WhittlesJr/Readme.md
NixOS: PCI Passthrough

Things I changed in this fork

Modified WhittlesJr's forked version to prevent some devices from loading its drivers. In my case, NVIDIA's USB Host controller is in the same IOMMU group, and specifying vfio-pci option didn't prevent the device from loading xhci_usb driver.

IOMMU Group 1   00:01.0 PCI bridge [0604]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) [8086:1901] (rev 07)
IOMMU Group 1   01:00.0 VGA compatible controller [0300]: NVIDIA Corporation TU106M [GeForce RTX 2060 Mobile] [10de:1f11] (rev a1)
IOMMU Group 1   01:00.1 Audio device [0403]: NVIDIA Corporation TU106 High Definition Audio Controller [10de:10f9] (rev a1)
IOMMU Group 1 01:00.2 USB controller [0c03]: NVIDIA Corporation TU106 USB 3.1 Host Controller [10de:1ada] (rev a1)
#include <node.h>
#include <stdio.h>
using namespace v8;
void Exit(void* arg) {
printf("node::AtExit called\n");
}
void Initialize(Handle<Object> exports) {