User:AdaptL/Intel SR-IOV

From Gentoo Wiki
Jump to:navigation Jump to:search

Introduction

WIP (Warn about suspend/Resume and buggyness. recommend waiting until mainline)

SR-IOV allows you to split up your graphics processor into several "Virtual Functions (VFs)" which can be accessed by virtual machines. Recent intel processors (11th gen and 12th gen integrated graphics, but NOT "Arc" dedicated graphics (citation)) support this functionality. This page describes the usage of SR-IOV with libvirt on a Gentoo host to run a Windows guest.

See also User:Shunlir/Intel_GVT-g, which is basically the same thing but for older intel graphics.

Kernel Configuration

The SR-IOV functionality is still in intel's codebase but should be upstreamed into mainline linux by end of 2023[1]. For the time being, Arch Linux users have already packaged the functionality with DKMS[2][3]. Gentoo doesn't support DKMS but we can just compile it as a normal module like so:

First, go to your kernel source directory. (mention kernel version) For reference, I am using kernel 6.1.28.

... other patches ...

Then, make sure to build intel graphics as a module (<M> instead of * in menuconfig):

You will also need to enable IOMMU:

You will also have to set the following kernel options:

Creating a VF

The system to create a VF is exposed by a pseudo-filesystem on /sys (mention uuidgen).

You'll have to do this every time you reboot. (init script with libvirt??)

Libvirt Configuration

Looking Glass?

Looking Glass is an alternative to the SPICE virtual display; It's a lot faster because it keeps the framebuffer on shared memory between the host and guest OS (insert ref).

(show how to install it)

Bugs

suspend/resume bug?

todo: add extra advice like spice guest tools and virtio driver to some other page?

References