A Guide to virtualise your Intel GPU. Heavily based on https://forum.qubes-os.org/t/lenovo-thinkpad-t14-gen-5/27923/27. The Output will still be send trough the normal QubesOS pipeline, so no extra Monitor is needed. ATTENTION: This Guide requires executing 3rd party Code in dom0 at Kernel priveleges (a driver). This can be a security risk depending on your threadmodell, but you also can check the code (if you understand a bit of programming). All commands must be run in dom0.
uname -a in a dom0 terminal) Download as ZIP or TARqvm-run -p [VM] "cat [Path/to/code]" > code, only works on files so you should use a ZIP or TAR Archive)unzip or tar -xaf)sudo dkms add ./[path/to/unziped/code]Install module via sudo dkms install i915-sriov-dkms/[version] (use TAB to Autocomplete)
Add the following to your GRUB Kernel commandline in /etc/defualt/grub: intel_iommu=on i915.enable_guc=3 i915.max_vfs=7 module_blacklist=xe intel_iommu=on i915.enable_guc=3 i915.max_vfs=7 module_blacklist=xe (Variable named GRUB_CMDLINE_LINUX_DEFAULT)
Update GRUB: sudo grub2-mkconfig -o /boot/efi/EFI/qubes/grub.cfg
sudo dracut --regenerate-all --forceecho 7 | sudo tee sys/devices/pci0000\:00/0000\:00\:02.0/sriov_numvfs (Assuming GPU is on PCI device 00:02.0 which is normal for an iGPU at least in my experience. In doubt check with lspci) You can use any value between 1-7 from my experience its better to choose as low as you can if you want to game.qubes-kernel-vm-support, though not realy clear why)qvm-features [VM] boot-mode.kernelopts.sriov "i915.force_probe=XXXX i915.enable_guc=3' (as for the XXXX use your GPU device id you get this via cat "/sys/devices/pci000:00/0000:00:02.0/device", may not be needed) and change to the new Kernelopts via: qvm-features [VM] boot-mode.active sriovqvm-service [VM] --disable software-renderingAfter that GPU acceleration should work in your VM. You can test with glxheads if your GPU is used.
Problems: For me there is currently one strange Problem. On some Games the VM sometimes hangs on display output. This is not realy reproducible and depends on the game used. While testing i encountered on game that wouldn't run. Check my other Thread for more info on which games. GPU acceleration for other things, like AI (the real one not LLMs), did work fine.
Check if firmware-intel-graphics is installed.
Try installing the Driver in the template via DKMS. For this you also need to setup kernel provided by qube.