GPU Passthrough -> Win10 Guest

System:
Kernel: 6.10.5-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 14.2.1
clocksource: tsc avail: hpet,acpi_pm
parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
root=UUID=6661e2ff-52e3-4165-8d0e-c97c9468f623 rw rootflags=subvol=@
vfio-pci.ids=10de:2484, 10de:228b loglevel=3 intel_iommu=on iommu=pt
ibt=off
Desktop: KDE Plasma v: 6.1.4 tk: Qt v: N/A wm: kwin_x11 dm: SDDM
Distro: Garuda base: Arch Linux
Machine:
Type: Desktop System: ASUS product: N/A v: N/A serial: N/A
Mobo: ASUSTeK model: ROG STRIX Z490-E GAMING v: Rev 1.xx serial: <filter>
part-nu: SKU uuid: b27228e9-1a48-8c6a-5d27-3c7c3f1e37af
UEFI: American Megatrends v: 3001 date: 02/19/2024
CPU:
Info: model: Intel Core i9-10850K socket: LGA1200 bits: 64 type: MT MCP
arch: Comet Lake gen: core 10 level: v3 note: check built: 2020
process: Intel 14nm family: 6 model-id: 0xA5 (165) stepping: 5
microcode: 0xFC
Topology: cpus: 1x cores: 10 tpc: 2 threads: 20 smt: enabled cache:
L1: 640 KiB desc: d-10x32 KiB; i-10x32 KiB L2: 2.5 MiB desc: 10x256 KiB
L3: 20 MiB desc: 1x20 MiB
Speed (MHz): avg: 1992 high: 4702 min/max: 800/5200 base/boost: 3600/8300
scaling: driver: intel_pstate governor: performance volts: 1.0 V
ext-clock: 100 MHz cores: 1: 4702 2: 4700 3: 1148 4: 800 5: 800 6: 4700
7: 800 8: 800 9: 1645 10: 800 11: 800 12: 3628 13: 1127 14: 4700 15: 800
16: 800 17: 800 18: 800 19: 800 20: 4701 bogomips: 144000
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Vulnerabilities: <filter>
Graphics:
Device-1: Intel CometLake-S GT2 [UHD Graphics 630] vendor: ASUSTeK
driver: i915 v: kernel arch: Gen-9.5 process: Intel 14nm built: 2016-20
ports: active: HDMI-A-3 empty: DP-4,HDMI-A-2 bus-ID: 00:02.0
chip-ID: 8086:9bc5 class-ID: 0300
Device-2: NVIDIA GA104 [GeForce RTX 3070] vendor: PNY driver: N/A
alternate: nouveau, nvidia_drm, nvidia non-free: 550.xx+ status: current
(as of 2024-06; EOL~2026-12-xx) arch: Ampere code: GAxxx
process: TSMC n7 (7nm) built: 2020-2023 pcie: gen: 3 speed: 8 GT/s
lanes: 16 link-max: gen: 4 speed: 16 GT/s ports: active: none
off: DP-3,HDMI-A-1 empty: DP-1,DP-2 bus-ID: 01:00.0 chip-ID: 10de:2484
class-ID: 0300
Display: unspecified server: X.Org v: 21.1.13 with: Xwayland v: 24.1.2
compositor: kwin_x11 driver: X: loaded: nvidia gpu: i915 display-ID: :1
screens: 1
Screen-1: 0 s-res: 4480x1440 s-dpi: 91 s-size: 1248x401mm (49.13x15.79")
s-diag: 1311mm (51.61")
Monitor-1: DP-4 pos: primary,bottom-l res: 1920x1080 dpi: 90
size: 544x303mm (21.42x11.93") diag: 623mm (24.52") modes: N/A
Monitor-2: HDMI-0 pos: top-right res: 2560x1440 hz: 75 dpi: 123
size: 527x296mm (20.75x11.65") diag: 604mm (23.8") modes: N/A
API: EGL v: 1.5 hw: drv: intel iris drv: nvidia platforms: device: 0
drv: nvidia device: 2 drv: iris device: 3 drv: swrast gbm: drv: nvidia
surfaceless: drv: nvidia x11: drv: nvidia inactive: wayland,device-1
API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: nvidia mesa v: 555.58.02
glx-v: 1.4 direct-render: yes renderer: NVIDIA GeForce RTX 3070/PCIe/SSE2
memory: 7.81 GiB
API: Vulkan v: 1.3.279 layers: 5 device: 0 type: discrete-gpu
name: NVIDIA GeForce RTX 3070 driver: nvidia v: 555.58.02
device-ID: 10de:2484 surfaces: xcb,xlib
Audio:
Device-1: Intel Comet Lake PCH cAVS vendor: ASUSTeK driver: snd_hda_intel
v: kernel alternate: snd_soc_skl, snd_soc_avs, snd_sof_pci_intel_cnl
bus-ID: 00:1f.3 chip-ID: 8086:06c8 class-ID: 0403
Device-2: NVIDIA GA104 High Definition Audio vendor: PNY
driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16
link-max: gen: 4 speed: 16 GT/s bus-ID: 01:00.1 chip-ID: 10de:228b
class-ID: 0403
Device-3: Blue Microphones Yeti Stereo Microphone
driver: hid-generic,snd-usb-audio,usbhid type: USB rev: 1.1 speed: 12 Mb/s
lanes: 1 mode: 1.1 bus-ID: 1-7:5 chip-ID: b58e:9e84 class-ID: 0300
serial: <filter>
API: ALSA v: k6.10.5-zen1-1-zen status: kernel-api with: aoss
type: oss-emulator tools: alsactl,alsamixer,amixer
Server-1: PipeWire v: 1.2.2 status: n/a (root, process) with:
1: pipewire-pulse status: active 2: wireplumber status: active
3: pipewire-alsa type: plugin 4: pw-jack type: plugin
tools: pactl,pw-cat,pw-cli,wpctl
Network:
Device-1: Intel Comet Lake PCH CNVi WiFi driver: iwlwifi v: kernel
bus-ID: 00:14.3 chip-ID: 8086:06f0 class-ID: 0280
IF: wlo1 state: down mac: <filter>
Device-2: Intel Ethernet I225-V vendor: ASUSTeK driver: igc v: kernel
pcie: gen: 2 speed: 5 GT/s lanes: 1 port: N/A bus-ID: 04:00.0
chip-ID: 8086:15f3 class-ID: 0200
IF: enp4s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
IF-ID-1: virbr0 state: down mac: <filter>
Info: services: NetworkManager,systemd-timesyncd
Bluetooth:
Device-1: Intel AX201 Bluetooth driver: btusb v: 0.8 type: USB rev: 2.0
speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 1-14:11 chip-ID: 8087:0026
class-ID: e001
Report: btmgmt ID: hci0 rfk-id: 0 state: down bt-service: enabled,running
rfk-block: hardware: no software: yes address: <filter> bt-v: 5.2 lmp-v: 11
status: discoverable: no pairing: no
RAID:
Hardware-1: Intel Comet Lake PCH-H RAID driver: ahci v: 3.0 port: 4060
bus-ID: 00:17.0 chip-ID: 8086:06d6 rev: class-ID: 0104
Drives:
Local Storage: total: 3.07 TiB used: 594.79 GiB (18.9%)
ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Crucial model: CT2000P3PSSD8
size: 1.82 TiB block-size: physical: 512 B logical: 512 B speed: 63.2 Gb/s
lanes: 4 tech: SSD serial: <filter> fw-rev: P9CR40D temp: 35.9 C
scheme: GPT
SMART: yes health: PASSED on: 89 hrs cycles: 35
read-units: 569,891 [291 GB] written-units: 1,127,183 [577 GB]
ID-2: /dev/sda maj-min: 8:0 vendor: Western Digital
model: WD Blue SA510 2.5 1TB size: 931.51 GiB block-size: physical: 512 B
logical: 512 B sata: 3.2 speed: 6.0 Gb/s tech: SSD serial: <filter>
fw-rev: 0100 temp: 37 C scheme: GPT
SMART: yes state: enabled health: PASSED on: 27d 11h cycles: 891
read: 18.4 MiB written: 5.6 MiB Pre-Fail: reallocated sector: 100
threshold: 10
ID-3: /dev/sdb maj-min: 8:16 vendor: A-Data model: SU600 size: 111.79 GiB
block-size: physical: 512 B logical: 512 B sata: 3.1 speed: 6.0 Gb/s
tech: SSD serial: <filter> fw-rev: 1A temp: 44 C scheme: GPT
SMART: yes state: enabled health: PASSED on: 1y 229d 15h cycles: 2810
read: 1.41 GiB written: 1.85 GiB
ID-4: /dev/sdc maj-min: 8:32 vendor: Western Digital
model: WD2500BEVT-00ZCT0 family: Scorpio Blue Serial ATA size: 232.89 GiB
block-size: physical: 512 B logical: 512 B type: USB rev: 2.0
spd: 480 Mb/s lanes: 1 mode: 2.0 sata: 2.5 speed: 3.0 Gb/s tech: HDD
rpm: 5400 serial: <filter> fw-rev: 1.05 drive-rev: 11.01A11 temp: 42 C
scheme: GPT
SMART: yes state: enabled health: PASSED on: 2y 353d 12h cycles: 21854
Old-Age: write error rate: 100 threshold: 100
Partition:
ID-1: / raw-size: 111.49 GiB size: 111.49 GiB (100.00%)
used: 14.85 GiB (13.3%) fs: btrfs block-size: 4096 B dev: /dev/sdb2
maj-min: 8:18
ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
used: 584 KiB (0.2%) fs: vfat block-size: 512 B dev: /dev/sdb1 maj-min: 8:17
ID-3: /home raw-size: 111.49 GiB size: 111.49 GiB (100.00%)
used: 14.85 GiB (13.3%) fs: btrfs block-size: 4096 B dev: /dev/sdb2
maj-min: 8:18
ID-4: /var/log raw-size: 111.49 GiB size: 111.49 GiB (100.00%)
used: 14.85 GiB (13.3%) fs: btrfs block-size: 4096 B dev: /dev/sdb2
maj-min: 8:18
ID-5: /var/tmp raw-size: 111.49 GiB size: 111.49 GiB (100.00%)
used: 14.85 GiB (13.3%) fs: btrfs block-size: 4096 B dev: /dev/sdb2
maj-min: 8:18
Swap:
Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default) zswap: no
ID-1: swap-1 type: zram size: 31.17 GiB used: 0 KiB (0.0%) priority: 100
comp: zstd avail: lzo,lzo-rle,lz4,lz4hc,842 max-streams: 20 dev: /dev/zram0
Sensors:
System Temperatures: cpu: 41.2 C mobo: N/A gpu: nvidia temp: 57 C
Fan Speeds (rpm): N/A gpu: nvidia fan: 0%
Info:
Memory: total: 32 GiB available: 31.17 GiB used: 4.84 GiB (15.5%)
igpu: 64 MiB
Processes: 475 Power: uptime: 8m states: freeze,mem,disk suspend: deep
avail: s2idle wakeups: 0 hibernate: platform avail: shutdown, reboot,
suspend, test_resume image: 12.42 GiB services: org_kde_powerdevil,upowerd
Init: systemd v: 256 default: graphical tool: systemctl
Packages: 1491 pm: pacman pkgs: 1460 libs: 414 tools: pamac,paru
pm: flatpak pkgs: 31 Compilers: gcc: 14.2.1 Shell: garuda-inxi (sudo)
default: Bash v: 5.2.32 running-in: konsole inxi: 3.3.35
Garuda (2.6.26-1):
System install date:     2024-07-30
Last full system update: 2024-08-19
Is partially upgraded:   No
Relevant software:       snapper NetworkManager dracut nvidia-dkms
Windows dual boot:       No/Undetected
Failed units:

Hello All,
I just want to thank you for your time before getting into this. I’ll do my best to explain my situation, my goals, and what I’m experiencing.

The Goal: Dedicated GPU passthrough to Win10 Guest.
I would like to get my NVIDIA 3070 passed through to a KVM QEMU Guest running Windows 10, and upon starting the guest, swap the host over to integrated graphics.

Hardware Setup:
-NVIDIA 3070: DP-1 to Monitor 1 and HDMI to Monitor 2
-Intel i9 10850k processor with HDMI plugged into HDMI port on Monitor 1.

This is my Grub command line:

GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 intel_iommu=on iommu=pt"
GRUB_CMDLINE_LINUX="vfio-pci.ids=10de:2484, 10de:228b"

This is my /etc/modprobe.d/vfio.conf:

options vfio-pci ids=10de:2484, 10de:228b

As far as I understand, the integrated graphics should be able to take over on the host using hooks.

I have tried following along with the Single GPU Passthrough guide on Github, and using those scripts, with my own modifications for my PCI ID’s the VM shuts down my displays and needs the host to be rebooted, since I cant SSH into the host at the moment.

This is my start.sh script:

#!/bin/bash
# Helpful to read output when debugging
set -x

# Stop display manager
systemctl stop display-manager.service
## Uncomment the following line if you use GDM
#killall gdm-x-session

# Unbind VTconsoles
echo 0 > /sys/class/vtconsole/vtcon0/bind
echo 0 > /sys/class/vtconsole/vtcon1/bind

# Unbind EFI-Framebuffer
echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind

# Avoid a Race condition by waiting 2 seconds. This can be calibrated to be shorter or longer if required for your system
sleep 2

# Unbind the GPU from display driver
virsh nodedev-detach pci_0000_01_00_0
virsh nodedev-detach pci_0000_01_00_1

# Load VFIO Kernel Module  
modprobe vfio-pci  

This is my revert.sh script:

#!/bin/bash
set -x
  
# Re-Bind GPU to Nvidia Driver
virsh nodedev-reattach pci_0000_01_00_1
virsh nodedev-reattach pci_0000_01_00_0

# Reload nvidia modules
#modprobe nvidia
#modprobe nvidia_modeset
#modprobe nvidia_uvm
#modprobe nvidia_drm

# Rebind VT consoles
echo 1 > /sys/class/vtconsole/vtcon0/bind
# Some machines might have more than 1 virtual console. Add a line for each corresponding VTConsole
#echo 1 > /sys/class/vtconsole/vtcon1/bind

nvidia-xconfig --query-gpu-info > /dev/null 2>&1
echo "efi-framebuffer.0" > /sys/bus/platform/drivers/efi-framebuffer/bind

# Restart Display Manager
systemctl start display-manager.service

I know I have to include a line in the hooks to swap the host to integrated graphics, however I cant get past this point. Any help would be greatly appreciated and I am happy to provide any more info on this topic.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.