MENU

Fun & Interesting

Single GPU Passthrough Tutorial - KVM/VFIO

BlandManStudios 163,428 lượt xem 2 years ago
Video Not Working? Fix It Now

The world's first and world's best video tutorial on single gpu passthrough. Play video games in a Windows VM running on Linux

# LINKS #
Discord Invite: https://discord.gg/NPCnXGtnN8
blandmanstudios store: https://blandmanstudios.square.site/

# Chapters and Links and Commands by Timestamp#
0:00 Intro
My Dual GPU Tutorial Series: https://www.youtube.com/watch?v=fFz44XivxWI&list=PLG7vUqRxMOG6gsPXohhFht3UJbcCxYgcL
My Looking Glass Demo: https://youtu.be/8v3DRJqRWnY
My Single GPU Demo: https://youtu.be/p3eJNp3OmrA
My Hardware Compatibility Video: https://youtu.be/fFz44XivxWI
My Linux Install Tutorial: https://youtu.be/ahAPSMiKrE4
1:14 Update your OS
sudo dnf update
1:37 Installing nvidia drivers
lspci -nnk
sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda
2:37 Install UNIGINE Valley
cd ~/Downloads
chmod a+x UnigineValley
./Unigine_Valley-1.0.run
cd Unigine_Valley-1.0
./valley
4:00 Benchmark Results (on Host)
4:16 UEFI/BIOS Settings
Enable "Virtualization" and "VT-d"
4:49 Install Stuff
sudo dnf groupinstall --withoptional virtualization
5:10 Configure Linux
sudo vi /etc/sysconfig/grub
Content to add: intel_iommu=on iommu=pt
sudo grub2-mkconfig -o /etc/grub2.cfg
sudo vi /etc/dracut.conf.d/local.conf
add_driver+=" vfio vfio_iommu_type1 vfio_pci vfio_virqfd "
sudo dracut -f --kver `uname -r`
My Grub and Dracut Explanation: https://youtu.be/3OdlPmPbLII?t=270
6:24 Verify Linux Setup
lsmod | grep kvm
dmesg | grep -i iommu
cat /proc/cmdline
lspci -nnk
7:30 Downloads
Windows 10 ISO: https://www.microsoft.com/en-us/software-download/windows10
VIRTIO Driver ISO: https://github.com/virtio-win/virtio-win-pkg-scripts/blob/master/README.md
7:46 Create the VM
9:30 Installing Windows
10:00 Virtual Disk Performance
11:39 VM Network Connection
11:55 Remote Display
ip addr
13:42 Install Hook Helper
Github Tutorial: https://github.com/joeknock90/Single-GPU-Passthrough
PassthroughPo.st Hook Helper: https://passthroughpo.st/simple-per-vm-libvirt-hooks-with-the-vfio-tools-hook-helper/
PassthroughPo.st VFIO Tools: https://github.com/PassthroughPOST/VFIO-Tools
sudo mkdir -p /etc/libvirt/hooks
sudo wget 'https://raw.githubusercontent.com/PassthroughPOST/VFIO-Tools/master/libvirt_hooks/qemu' -O /etc/libvirt/hooks/qemu
sudo chmod +x /etc/libvirt/hooks/qemu
sudo service libvirtd restart
11:14 Writing the Hook Scripts
mkdir -p /etc/libvirt/hooks/qemu.d/win10-vm1-singlegpu/prepare/begin
mkdir -p /etc/libvirt/hooks/qemu.d/win10-vm1-singlegpu/release/end
vi /etc/libvirt/hooks/qemu.d/win10-vm1-singlegpu/prepare/begin/start.sh
chmod +x /etc/libvirt/hooks/qemu.d/win10-vm1-singlegpu/prepare/begin/start.sh
vi /etc/libvirt/hooks/qemu.d/win10-vm1-singlegpu/release/end/revert.sh
chmod +x /etc/libvirt/hooks/qemu.d/win10-vm1-singlegpu/release/end/revert.sh
14:50 Customize Hook Scripts
lspci -nnk
15:45 Test and Fix Hook Scripts
sudo systemctl start sshd
ssh singlegpu@192.168.0.123
/etc/libvirt/hooks/qemu.d/win10-vm1-singlegpu/prepare/begin
lsmod | grep nv
sudo rmmod nvidia_drm
sudo rmmod nvidia_uvm
sudo rmmod nvidia_modeset
sudo rmmod nvidia
/etc/libvirt/hooks/qemu.d/win10-vm1-singlegpu/release/end/revert.sh
18:53 Add GPU to the VM
19:34 Install GPU Drivers
20:04 Mouse and Keyboard
20:40 Install UNIGINE Valley
21:43 Benchmark Results (on Guest)
21:55 Closing Thoughts
22:27 Bonus Message
Discord Invite: https://discord.gg/NPCnXGtnN8
blandmanstudios store: https://blandmanstudios.square.site/

# External Links #
Download Windows 10 ISO: https://www.microsoft.com/en-us/software-download/windows10
Download VIRTIO Driver ISO: https://github.com/virtio-win/virtio-win-pkg-scripts/blob/master/README.md

# Corrections #
If you're having trouble connecting to the VNC on another computer, try disabling firewalld with the command: systemctl stop firewalld

# My Links #
you can find my other creative endeavors at:
http://blandmanstudios.com
http://blandmanstudios.itch.io
http://instagram.com/blandmanstudios
http://twitter.com/blandmanstudios
https://discord.gg/NPCnXGtnN8

Comment