Jump to content

Talk:Intel GVT-g

From ArchWiki

If you don't set the aperture size[1] to at least 512MB[2], you won't get all of the options listed on mdev_supported_types[3]. It might be a good idea to add a section that talks about this. CuriousTommy (talk) 04:53, 31 January 2019 (UTC)Reply

GTK display crashes on Wayland but not on X11

On Wayland, after firing up a Windows 10 guest with "-display gtk,gl=on", the window shows up for a while then crashes:

   location/to/QEMU/script: line <number>: 14321 Segmentation fault      (core dumped) <qemu commands>

my script:

   qemu-system-x86_64 \
   -m 4G -smp 8,cores=4 \
   -enable-kvm \
   -k en-us \
   -machine kernel_irqchip=on,type=q35 \
   -cpu host,hv-time,hv-relaxed,hv-vapic,hv-spinlocks=0x1fff,hv-runtime \
   -usb -device usb-tablet \
   -soundhw hda \
   -drive file=$HOME/virtual-machines/win10.raw,format=raw \
   -device intel-iommu,caching-mode=on \
   -net nic -net user,smb=$HOME/data \
   -vga none \
     -display gtk,gl=on \
     -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 \
     -device vfio-pci,sysfsdev=/sys/bus/pci/devices/0000:00:02.0/158ae64a-0d18-4ef9-b991-199985c3fdb2/,display=on,x-igd-opregion=on

Running it on X11 or adding "GDK_BACKEND=x11" doesn't cause this problem. Perhaps we should note this as well? Takutekato2 (talk) 10:04, 19 April 2020 (UTC)Reply

Libvirt hook

Hear is a modified libvirt hook that does not require modification for each domain that has vgpu like the one in the article.

If the domain has no mdev vgpu element, the value of GVT_GUID is an empty string (null). The if's test to make sure its not null. (-n "$GVT_GUID").

/etc/libvirt/hooks/qemu
#!/bin/bash

GVT_PCI="0000:00:02.0"
GVT_GUID="$(xmllint --xpath 'string(/domain/devices/hostdev[@type="mdev"][@display="on"]/source/address/@uuid)' -)"
MDEV_TYPE="i915-GVTg_V5_4"

if [ $# -ge 3 ]; then
    if [ -n "$GVT_GUID" -a $2 = "prepare" -a $3 = "begin" ]; then
        echo "$GVT_GUID" > "/sys/bus/pci/devices/$GVT_PCI/mdev_supported_types/$MDEV_TYPE/create"
    elif [ -n "$GVT_GUID" -a $2 = "release" -a $3 = "end" ]; then
        echo 1 > /sys/bus/pci/devices/$GVT_PCI/$GVT_GUID/remove
    fi
fi
fi

It's important to make sure GVT_GUID is NOT null before executing the remove statement, or $GVT_PCI/$GVT_GUID/remove becomes $GVT_PCI//remove, removing the host iGPU, crashing the host (that happened to me). The value @display="on" above should be changed to @display="off", depending on how the domain is setup, according to the article. Chriscjsus (talk) 00:04, 7 August 2021 (UTC)Reply

Where to put shared clipboard for libvirt

Hello Lahwaacz, you've removed my section on qemu-vdagent clipboard for libvirt. I wouldn't assume everyone knows how to bring qemu arguments into libvirt form (or that they automatically are valid, in that form) and now there is no libvirt variant of these arguments on the wiki any more. GVT-g is already hard enough, where do you suppose I put the libvirt-form arguments to link them from here? As far as I can tell the libvirt article isn't for that either. IOfwq (talk) 09:34, 17 September 2023 (UTC)Reply

Libvirt things should be described on the libvirt page. Specifically it should be trivial to convert any list of QEMU command-line arguments to the <qemu:commandline> block for libvirt. Then just link to the generic section instead of duplicating the instructions for every example. — Lahwaacz (talk) 11:02, 17 September 2023 (UTC)Reply

by that logic, might as well delete half the GVT-g article. libvirt is unnecessary, the user can "easily" convert.

yet the internet is riddled with people giving up on GVT-g because instructions (here, specifically) are too hard. Besides, QEMU commands are not automatically valid in libvirt in the <qemu:commandline> form.

Lahwaacz, not everyone has the understanding you (and I, now after a week of trying to get this to work) do. You're making things hard for the beginner by removing instructions that "look duplicate". Yes, to us they might, but the beginner, which such an article is most useful to, every information counts. Right now, looking at this they might think it's only possible in pure QEMU, at least I would if I read this.

I get that you have your system, you want to adhere to DRY and keep things clean here, it's a shepherds task with people like me (sorry).

What do you suggest to address this? What's a good solution here? Should I put the <qemu:commandline> form in the libvirt article, since it's "only" qemu command line arguments? Should I remove it from the QEMU article and have everything here? IOfwq (talk) 02:53, 18 September 2023 (UTC)Reply

Document how to use mdevctl to create the virtual devices

There is the package in AUR and many guides for other distros recommend using this tool: https://aur.archlinux.org/packages/mdevctl

It is arguably better/more straight-forward than writing the libvirt hook or systemd service. You also don't need to generate your own UUIDs, this is done for you automatically. There is also a good chance that in the future libvirt will natively support this without the need for any extra tooling.

Unrelated to this page, it also works for nVidia vGPU, giving you a nice overview of the assignable vGPUs available on your workstation.

So my proposal would be to remove the other options (1.1 and 1.2) or somewhat restructure the section so that there's 1.1 mdevctl, 1.2 for common stuff and 1.2.1 libvirt hook, 1.2.2 systemd service (?) Any objections/ideas?

Plantroon (talk) 21:47, 5 March 2025 (UTC)Reply

Added the mdevctl instructions, I will leave it up to the original author to remove the older guide - it may be useful to some, but mdevctl is better in every way. Plantroon (talk) 23:29, 12 March 2025 (UTC)Reply