Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save csullivan/a57835c23ebe48ab37a9666048748d08 to your computer and use it in GitHub Desktop.
Save csullivan/a57835c23ebe48ab37a9666048748d08 to your computer and use it in GitHub Desktop.
VFIO Setup on Ubuntu 18.04

Ubuntu 18.04 VFIO GPU passthrough with a single GPU (onboard automatically disables itself)

On an Ubuntu 18.04 system with two NVIDIA GPUs only the change to Grub below was necessary, I did not need to mess with modprobe or initramfs. In addition, I needed to set the PCI bus for the correct nvidia xconfig to the non-blacklisted GPU following these steps

sudo nvidia-xconfig

This will create a new xorg config at /etc/X11/xorg.conf.

Then add the BusID line in the following part of the file /etc/X11/xorg.conf:

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BusID          "PCI:9:0:0"
EndSection

Source: https://askubuntu.com/questions/787030/setting-the-default-gpu

Hardware

https://www.reddit.com/r/JDM_WAAAT/comments/8zgkfj/server_build_nas_killer_v_20_the_terminator_dual/ 2x X5650 from this thread Aside from that build guide, a generic USB3 card and an AMD R9-200

Grub

Modify /etc/default/grub and add vfio-pci.ids=dead:beef video=efifb:off to GRUB_CMDLINE_LINUX_DEFAULT (use the PCI vid/pid of your primary GPU, not dead:beef)

# My actual
GRUB_CMDLINE_LINUX_DEFAULT="maybe-ubiquity intel_iommu=on vfio-pci.ids=1002:67b0 video=efifb:off"

Run update-grub

See source for additional details if needed.

Install KVM

sudo apt-get install libvirt-bin bridge-utils virt-manager qemu-kvm ovmf

Then reboot so that the libvirtd service is started. Then run virt-manager.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment