Various issues when using multiple graphic outputs

Hi, I've had continuous issues with this and wanted to reach out if that is a common issue everyone has or just me lacking a little detail on my setup. Setup: - tried qemu up to 4.2 - tried libvirt up to 6.0 - virt-viewer up to 7.0-2build1 - virt-manager up to 2.2.1 - I plan to retry with qemu 5.0, libvirt 6.6 and virt-viewer 9.0 but I don't have all pieces ready yet. - get a Desktop Guest (I've seen it with Ubuntu and Windows, therefore I'm rather sure it will affect all desktops) - configure your guest-xml to use multiple graphic adapters and start it - connect with virt-viewer to your guest which will open both screens The exact issue depends on the kind of graphic device I configure. The following list is ordered in terms of increasing confusion :-): - QXL with multiple heads - works fine (so multi display in general seems fine for the involved components) - VGA + QXL, QXL + Virtio, Virtio + QXL: - Guest only detects primary display - Can't convince X in the guest to use the second device as well - lspci lists both devices just fine - dmesg shows the kernel is initializing them, e.g. drm for virtio - 2*QXL - X has issues to initialize on user login - no error in the log, just hung - QXL + Mdev - mouse handling seems broken - in gnome I see no mouse pointer at all - in windows it is just strange - has offsets relative to mouse pointer entering - and can't move in one random direction (e.g. not up) - keyboard works just fine - I have played with adding/removing different input devices without much success. - I disabled the qxl display via xorg conf without the case getting any better The last case is what I initially tried and totally confused me at first. And to be clear, each of those graphics adapter types works fine if being attached "alone" on the guest (Except mdev alone, as I'm unable to convince libvirt to only attach the mdev without adding back a qxl graphics adapter). The Guest XML is the default that virt-manager gives me plus adding the second graphics adapter (example 2*QXL: https://paste.ubuntu.com/p/cVw8GVZ9dD/). If this is known in some way or even "yeah try version XY of component Foo" I'm happy about any hint/pointer you can give me. But if there is a chance that I'm the only one seeing it I'd like to understand why. Thanks in advance for thinking into this with me, Christian P.S. to avoid cross-posting I'll start with libvirt as it is in the middle of all involved components.

On Fri, Sep 04, 2020 at 12:05:08PM +0200, Christian Ehrhardt wrote:
Hi, I've had continuous issues with this and wanted to reach out if that is a common issue everyone has or just me lacking a little detail on my setup.
- QXL with multiple heads - works fine (so multi display in general seems fine for the involved components)
Yep.
- VGA + QXL, QXL + Virtio, Virtio + QXL: - Guest only detects primary display - Can't convince X in the guest to use the second device as well - lspci lists both devices just fine - dmesg shows the kernel is initializing them, e.g. drm for virtio
As far I know xorg can't really deal with multiple display devices. So typically you have a single device with multiple connectors, so you can hook up multiple monitors. In the virtual world qxl and virtio support multiple heads, so pick one of these two and enable as many heads as you need. Also make sure spice-agent is active in the guest, otherwise operating the mouse is a PITA. Dunno how things are with wayland.
- 2*QXL - X has issues to initialize on user login - no error in the log, just hung
The windows guest driver doesn't support qxl devices with multiple outputs and expects one qxl device per head instead. So use this one for windows guests. HTH, Gerd

On Fri, Sep 4, 2020 at 12:37 PM Gerd Hoffmann <kraxel@redhat.com> wrote:
On Fri, Sep 04, 2020 at 12:05:08PM +0200, Christian Ehrhardt wrote:
Hi, I've had continuous issues with this and wanted to reach out if that is a common issue everyone has or just me lacking a little detail on my setup.
- QXL with multiple heads - works fine (so multi display in general seems fine for the involved components)
Yep.
- VGA + QXL, QXL + Virtio, Virtio + QXL: - Guest only detects primary display - Can't convince X in the guest to use the second device as well - lspci lists both devices just fine - dmesg shows the kernel is initializing them, e.g. drm for virtio
As far I know xorg can't really deal with multiple display devices. So typically you have a single device with multiple connectors, so you can hook up multiple monitors.
In the virtual world qxl and virtio support multiple heads, so pick one of these two and enable as many heads as you need.
Well my initial target before I realized that it seemed to affect all combinations in different ways was to get a mediated device to work well. So If the answer is "just use only one" then I need to find a way to convince libvirt to -not- re-add a graphics device when the mdev of the vgpu is present.
Also make sure spice-agent is active in the guest, otherwise operating the mouse is a PITA.
I think it was active but surely will give it a second look to be sure - thank you!
Dunno how things are with wayland.
- 2*QXL - X has issues to initialize on user login - no error in the log, just hung
The windows guest driver doesn't support qxl devices with multiple outputs and expects one qxl device per head instead. So use this one for windows guests.
HTH, Gerd
-- Christian Ehrhardt Staff Engineer, Ubuntu Server Canonical Ltd

Hi,
Well my initial target before I realized that it seemed to affect all combinations in different ways was to get a mediated device to work well. So If the answer is "just use only one" then I need to find a way to convince libvirt to -not- re-add a graphics device when the mdev of the vgpu is present.
model='none'. HTH, Gerd

On Fri, Sep 4, 2020 at 1:30 PM Gerd Hoffmann <kraxel@redhat.com> wrote:
Hi,
Well my initial target before I realized that it seemed to affect all combinations in different ways was to get a mediated device to work well. So If the answer is "just use only one" then I need to find a way to convince libvirt to -not- re-add a graphics device when the mdev of the vgpu is present.
model='none'.
Arr that was it - and as always things are always easier to find once you know what you look for :-) It is quite literally at https://libvirt.org/formatdomain.html#video-devices "This legacy behaviour can be inconvenient in cases where GPU mediated devices are meant to be the only rendering device within a guest and so specifying another video device along with type none." Thank you Gerd and Daniel!
HTH, Gerd
-- Christian Ehrhardt Staff Engineer, Ubuntu Server Canonical Ltd

On Fri, Sep 04, 2020 at 12:37:06PM +0200, Gerd Hoffmann wrote:
On Fri, Sep 04, 2020 at 12:05:08PM +0200, Christian Ehrhardt wrote:
Hi, I've had continuous issues with this and wanted to reach out if that is a common issue everyone has or just me lacking a little detail on my setup.
- QXL with multiple heads - works fine (so multi display in general seems fine for the involved components)
Yep.
- VGA + QXL, QXL + Virtio, Virtio + QXL: - Guest only detects primary display - Can't convince X in the guest to use the second device as well - lspci lists both devices just fine - dmesg shows the kernel is initializing them, e.g. drm for virtio
As far I know xorg can't really deal with multiple display devices. So typically you have a single device with multiple connectors, so you can hook up multiple monitors.
IIRC, it Xorg can support multiple devices, but it is not zero-conf, it needs a custom config file to be written, and has some functional limitations compared to a multi-head layout. It has been at least 10+ years since I did something like this though :-)
In the virtual world qxl and virtio support multiple heads, so pick one of these two and enable as many heads as you need. Also make sure spice-agent is active in the guest, otherwise operating the mouse is a PITA.
This is definitely the better approach to get zero-conf though.
Dunno how things are with wayland.
- 2*QXL - X has issues to initialize on user login - no error in the log, just hung
The windows guest driver doesn't support qxl devices with multiple outputs and expects one qxl device per head instead. So use this one for windows guests.
HTH, Gerd
Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
participants (3)
-
Christian Ehrhardt
-
Daniel P. Berrangé
-
Gerd Hoffmann