Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.
Patrick Magauran edited this page Jan 5, 2022 · 3 revisions

Using this ROM

All steps are written to be done on Fedora 32. They can easily be translated to other linux distros.

Pre-Requisites

  1. Download the ROM from the releases page or compile it yourself.
  2. Install QEMU/OVMF: sudo yum install libvirt virt-install qemu-kvm bridge-utils libguestfs-tools virt-manager
  3. Edit the Kernel Parameters: sudo nano /etc/default/grub
    1. Add the following parameters to GRUB_CMDLINE_LINUX: intel_iommu=on i915.enable_gvt=1 i915.enable_guc=0 iommu=pt
    2. Run sudo dracut -f --kver $(uname -r) && sudo grub2-mkconfig and reboot
  4. Now we have to create our workspace
    1. Create a folder: mkdir i915dev
    2. Extract the contents of the release rom to this folder.

GVT-G(Virtual GPU)

  1. Now we have to ensure some important modules are loaded: kvmgt, vfio-iommu-type1, vfio-mdev, vfio_pci

    1. Create a file in /etc/modules-load.d/ for example sudo nano /etc/modules-load.d/kvm.conf
    2. Put those modules in separated by newlines
  2. 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 ./
  3. Reboot for the changes to take effect.

  4. Now we need to determine some attributes of your system

    1. Determine your PCI Ids and location for the Intel GPU
    2. 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
    3. 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.
    4. 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.
  5. Some modifications are needed to the config (config)

    1. Update WORKSPACE to point to your workspace created earlier(e.g /home/rotatingFans/i915dev)
    2. Update PCILOC to use the PCIlocation noted earlier in step 4.2.(e.g. 0000:00:02.0) - Each zero is important!
    3. Update GVTMODE to use the desired mode in Step 4.4(e.g. i915-GVTg_V5_4)
  6. 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
  7. 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.

GVT-D(Full iGPU passhthrough)

  1. Now we have to ensure some important modules are loaded: kvmgt, vfio-iommu-type1, vfio-mdev

    1. Create a file in /etc/modules-load.d/ for example sudo nano /etc/modules-load.d/kvm.conf
    2. Put those modules in separated by newlines
  2. Now we need to determine some attributes of your system

    1. Determine your PCI Ids and location for the Intel GPU
    2. This can easily be found using the iommu.sh in the repository
  3. Add the following kernel parameter: vfio-pci.ids=PCIID where PCIID is the ID obtained earlier(eg 8086:1234)

    1. Run sudo dracut -f --kver $(uname -r) && sudo grub2-mkconfig and reboot
  4. 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 ./
  5. Some modifications are needed to the config file (config)

    1. Update WORKSPACE to point to your workspace created earlier(e.g /home/rotatingFans/i915dev)
    2. Update PCILOC to use the PCIlocation .(e.g. 0000:00:02.0) - Each zero is important!
    3. Update PCIID to use the PCIID noted earlier in step 4.2(e.g. 8086:9bca)
  6. Reboot for the changes to take effect.

  7. 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.
  8. Adapt to your needs

    • You can modify the script to launch your own qemu command, just make sure to use the correct parameters.
Clone this wiki locally