Preview:
#-Add IOMMU Support-

vim /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on"
#	- OR -
GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on"

# Save file and close

update-grub

# -Load VFIO modules at boot-

vim /etc/modules

vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd

# Save file and close

echo "options vfio_iommu_type1 allow_unsafe_interrupts=1" > /etc/modprobe.d/iommu_unsafe_interrupts.conf

echo "options kvm ignore_msrs=1" > /etc/modprobe.d/kvm.conf

echo "blacklist nouveau" >> /etc/modprobe.d/blacklist.conf
echo "blacklist nvidia" >> /etc/modprobe.d/blacklist.conf

# -Configure GPU for PCIe Passthrough-
	- Find your GPU
lspci -v

#	- Enter the PCI identifier
lspci -n -s 82:00

	- Copy the HEX values from your GPU here:
echo "options vfio-pci ids=####.####,####.#### disable_vga=1"> /etc/modprobe.d/vfio.conf

update-initramfs -u

# --REBOOT--


# ---------------------  -Virtual Machine PCIe passthrough (Debian Linux)- -----------------

# -Confirm GPU is being passed through-

lspci

-Disable Nouveau drivers in kernel-

sudo bash -c "echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
sudo bash -c "echo options nouveau modset=0 >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf"

sudo update-initramfs -u

# --REBOOT--

# -Confirm no drivers running for nVidia GPU-

lspci -v

# Find GPU. There should be no 'Kernel driver in use:' line

# 
# Download nVidia Drivers & Install nVidia Drivers

# Visit nVidia.com/drivers, locate your card, and find out what the most recent version is

wget https://international.download.nvidia.com/XFree86/Linux-x86_64/515.65.01/NVIDIA-Linux-x86_64-515.65.01.run

sudo chmod +x NVIDIA-Linux-x86_64-###.##.##.run
sudo apt update
sudo apt install build-essential libglvnd-dev pkg-config

./NVIDIA-Linux-x86_64-###.##.##.run

# Complete prompts to install

lspci -v

# Confirm GPU is using  nvidia drivers
"Kernel driver in use: nvidia"

nvidia-smi

downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter