-
-
Notifications
You must be signed in to change notification settings - Fork 24
Using
All steps are written to be done on Fedora 32. They can easily be translated to other linux distros.
- Download the ROM from the releases page or compile it yourself.
- Install QEMU/OVMF:
sudo yum install libvirt virt-install qemu-kvm bridge-utils libguestfs-tools virt-manager
- Edit the Kernel Parameters:
sudo nano /etc/default/grub
- Add the following parameters to
GRUB_CMDLINE_LINUX
:intel_iommu=on i915.enable_gvt=1 i915.enable_guc=0 iommu=pt
- Run
sudo dracut -f --kver $(uname -r) && sudo grub2-mkconfig
and reboot
- Add the following parameters to
- Now we have to create our workspace
- Create a folder:
mkdir i915dev
- Extract the contents of the release rom to this folder.
- Create a folder:
-
Now we have to ensure some important modules are loaded:
kvmgt, vfio-iommu-type1, vfio-mdev, vfio_pci
- Create a file in
/etc/modules-load.d/
for examplesudo nano /etc/modules-load.d/kvm.conf
- Put those modules in separated by newlines
- Create a file in
-
Now in your workspace folder: Run the following:
dd if=/dev/zero of=disk bs=128M count=1 sudo mkfs.vfat disk mkdir i915_simple cp disk i915_simple/ cp /usr/share/edk2/ovmf/OVMF_CODE.fd ./
-
Reboot for the changes to take effect.
-
Now we need to determine some attributes of your system
- Determine your PCI Ids and location for the Intel GPU
- This can easily be found using the
iommu.sh
in the repository(Assuming iommu works on your system)- Otherwise, you can find the PCI Location using
lspci
- Otherwise, you can find the PCI Location using
- Run
ls /sys/devices/pci$GVT_DOM/$GVT_PCI/mdev_supported_types
where$GVT_DOM
is the PCI Domain(Typically 0000) and$GVT_PCI
is the PCI location noted earlier. - Note down the available types and determine which one you want to use
- You can determine the capabilities by doing
cat description
in each folder.
- You can determine the capabilities by doing
-
Some modifications are needed to the config (
config
)- Update
WORKSPACE
to point to your workspace created earlier(e.g/home/rotatingFans/i915dev
) - Update PCILOC to use the PCIlocation noted earlier in step 4.2.(e.g.
0000:00:02.0
) - Each zero is important! - Update GVTMODE to use the desired mode in Step 4.4(e.g.
i915-GVTg_V5_4
)
- Update
-
Now use the test script provided in the download as follows
sudo ./test-gvt-g.sh
- This script will create the desired virtual device, load up a blank disk for QEMU to boot, and boot it up
- If it works you should see the OVMF boot screen
- It requires Sudo
-
Adapt to your needs
- You can modify the script to launch your own qemu command, just make sure to use the correct parameters and have created the vgpu.
-
Now we have to ensure some important modules are loaded:
kvmgt, vfio-iommu-type1, vfio-mdev
- Create a file in
/etc/modules-load.d/
for examplesudo nano /etc/modules-load.d/kvm.conf
- Put those modules in separated by newlines
- Create a file in
-
Now we need to determine some attributes of your system
- Determine your PCI Ids and location for the Intel GPU
- This can easily be found using the
iommu.sh
in the repository
-
Add the following kernel parameter:
vfio-pci.ids=PCIID
where PCIID is the ID obtained earlier(eg 8086:1234)- Run
sudo dracut -f --kver $(uname -r) && sudo grub2-mkconfig
and reboot
- Run
-
Now in your workspace folder: Run the following:
dd if=/dev/zero of=disk bs=128M count=1 sudo mkfs.vfat disk mkdir i915_simple cp disk i915_simple/ cp /usr/share/edk2/ovmf/OVMF_CODE.fd ./
-
Some modifications are needed to the config file (
config
)- Update
WORKSPACE
to point to your workspace created earlier(e.g/home/rotatingFans/i915dev
) - Update PCILOC to use the PCIlocation .(e.g.
0000:00:02.0
) - Each zero is important! - Update PCIID to use the PCIID noted earlier in step 4.2(e.g.
8086:9bca
)
- Update
-
Reboot for the changes to take effect.
-
Now use the test script provided in the download as follows
sudo ./test-gvt-d.sh
- This script will detach the i915 device and attach it to vfio-pci, load up a blank disk for QEMU to boot, and boot it up(timing out after a couple seconds for test purposes)
- If it works you should see the OVMF boot screen
- It requires Sudo
- It works best if run over ssh from another machine.
-
Adapt to your needs
- You can modify the script to launch your own qemu command, just make sure to use the correct parameters.