Disable or de-prioritize Incus virtual GPU (VM with physical GPU passthru)

So I have an Incus VM running with a GPU passed thru so that it has a physical display.

The problem I have now is that the Incus (spice?) GPU is also there so the VM has two GPUs (one virtual, one physical) and the virtual one is the primary one. This means that everything defaults to the virtual console and the physical one is unused.

When the VM boots, the physical and virtual (viewed using incus-ui) show the same content, however after the Linux kernel takes over, only the primary console gets output. And that is the virtual one. The physical displays just go blank.

I can force the Linux console onto the physical display by adding fbcon=map:1 to the kernel boot options, which works, except it still isn’t the prirmary device. If I start a desktop, it appears on the virtual console unless I add specific config for it.

I don’t want to have to mess with kernel boot options and display server configurations. I just want the physical GPU to be the main one. Otherwise I’ll need special case configurations for Incus VM.

I want to either deprioritize the incus/spice GPU so that it comes last, so that any other GPUs come first, OR I want to disable the incus/spice GPU completely.

Is this possible somehow?

See https://linuxcontainers.org/incus/docs/main/reference/instance_options/#override-qemu-configuration

OK, I did read that before but missed the point. So I did this

raw.qemu.conf: |-
    [device "qemu_gpu"]

which removed the device and that works - my physical gpu is now used by default. This satisfies my main requirement.

Say I wanted the incus one, as well. Could I do that? I can’t find anything about the device order, Documentation for qemu config is sadly lacking (or difficult to find). I’ve tried changing the address but it didn’t work (the device does not appear in the vm if I change the address):

  raw.qemu.conf: |-
    [device "qemu_gpu"]
    addr = "07"

I’ve tried to find documentation for virtio-gpu to understand the available options, etc. Best I’ve found is qemu-system-x86_64 -device virtio-gpu,help but I can’t find anything that explains how to change the virtual gpu so that it comes after the physical one. I can live without this but it would be good to understand if and how to do it, if it is possible.

Not sure how exactly Linux determines the priority.

If it’s purely based on PCIe addresses, then that may be tricky to change while not breaking a bunch of other things in the process. If it’s based on some other config option, then that should be easier to do.

1 Like