Have been scratching my head trying to pass through a graphics card to a VM.
My goal:
I have some Windows only applications I want to run, and would prefer to run the system in a VM. At least one of the applications can be GPU intensive, hence why I want to pass through a card to the VM.
I have installed KVM, QEMU and Virt-Manager.
Relevant hardware I have:
Motherboard: ASUS ROG Strix X570-F
CPU: AMD Ryzen 9 3950X
GPU 1: XFX Radeon RX 6800 XT Speedster MERC 319
GPU 2: ASUS GeForce RTX 2070 DUAL EVO V2 (intended for VM)
Currently my system is Fedora 36 with KDE.
I have tried several guides, but ran into some distribution (application) differences that didnât âtranslateâ to something that worked with what is available by default in Fedora. Could also be due to my inexperience.
So far my most successful attempt has been a guide wendell wrote. I also applied the corrections mentioned in the thread. Looking around I also came across a video on YouTube that is almost identical and confirms the steps at least worked in Fedora 35.
However, when running dracut -fv
I get the following output:
dracut: Executing: /usr/bin/dracut -fv
dracut: dracut module âbusyboxâ will not be installed, because command âbusyboxâ could not be found!
dracut: dracut module ârngdâ will not be installed, because command ârngdâ could not be found!
dracut: dracut module ânetwork-wickedâ will not be installed, because command âwickedâ could not be found!
dracut: dracut module âtpm2-tssâ will not be installed, because command âtpm2â could not be found!
dracut: dracut module ânvmfâ will not be installed, because command ânvmeâ could not be found!
dracut: dracut module âbiosdevnameâ will not be installed, because command âbiosdevnameâ could not be found!
dracut: dracut module âbusyboxâ will not be installed, because command âbusyboxâ could not be found!
dracut: dracut module ârngdâ will not be installed, because command ârngdâ could not be found!
dracut: dracut module ânetwork-wickedâ will not be installed, because command âwickedâ could not be found!
dracut: dracut module âtpm2-tssâ will not be installed, because command âtpm2â could not be found!
dracut: dracut module ânvmfâ will not be installed, because command ânvmeâ could not be found!
dracut: *** Including module: bash ***
dracut: *** Including module: systemd ***
dracut: *** Including module: systemd-initrd ***
dracut: *** Including module: systemd-sysusers ***
dracut: *** Including module: nss-softokn ***
dracut: *** Including module: dbus-broker ***
dracut: *** Including module: dbus ***
dracut: *** Including module: i18n ***
dracut: *** Including module: vfio ***
dracut: Cannot install a hook (â/usr/lib/dracut/modules.d/20vfio/vfio-pci-override.shâ) that does not exist.
dracut: Aborting initrd creation.
I have tried the vfio-pci-override.sh
script from wendell and the one from YouTube with the same result. They seem to function identically, but tried regardless.
My grub file has the following line: GRUB_CMDLINE_LINUX="quiet amd_iommu=on rd.driver.pre=vfio-pci"
Docs from Fedora say that at least amd_iommu=on
isnât necessary, but it is added. Shouldnât hurt anything? I have made sure IOMMU and SVM is set to ON and not Auto/Disabled in my BIOS.
The nVidia card I want to pass through is located at 0000:0c:00.0
to 0000:0c:00.3
.
The vfio-pci-override.sh
script located in /usr/sbin/
is made executable and is as follows:
#!/bin/sh
PREREQS=""
DEVS=â0000:0c:00.0 0000:0c:00.1 0000:0c:00.2 0000:0c:00.3âfor DEV in $DEVS; do
echo âvfio-pciâ > /sys/bus/pci/devices/$DEV/driver_override
donemodprobe -i vfio-pci
module-setup.sh
is made executable, located in /usr/lib/dracut/modules.d/20vfio/
and is as follows:
#!/usr/bin/bash
check() {
return 0
}
depends() {
return 0
}
install() {
declare moddir=${moddir}
inst_hook pre-udev 00 â$moddir/vfio-pci-override.shâ
}
I also added vfio-pci-override.sh
as a symbolic link to the same directory.
vfio.conf
has been created in /etc/dracut.conf.d/
and is as follows:
add_dracutmodules+=" vfio "
force_drivers+=" vfio vfio-pci vfio_iommu_type1 "
install_items="/usr/sbin/vfio-pci-override.sh /usr/bin/find /usr/bin/dirname"
Any suggestions as to what failed and how to fix it?