kvm-guest-drivers-windows icon indicating copy to clipboard operation
kvm-guest-drivers-windows copied to clipboard

viogpu: can't set resolution higher than 1024x768

Open amezin opened this issue 4 years ago • 30 comments

In Windows display settings I see 3 resolution options:

  • 3840x1912
  • 1024x768
  • 800x600

When I select 3840x1912, I immediately see "Guest disabled display." message and then guest reboots. No memory dump is created.

With https://gitlab.freedesktop.org/spice/win32/virtio-gpu-wddm-dod I see more resolution options, and 1920x1080 is working.

The same (almost) issue reported there: https://gitlab.freedesktop.org/spice/win32/virtio-gpu-wddm-dod/-/issues/5 (before I found that the driver is now included here)

amezin avatar Mar 10 '21 13:03 amezin

@amezin

currently 3840x1912x32bit is too big https://github.com/virtio-win/kvm-guest-drivers-windows/blob/master/viogpu/viogpudo/viogpudo.cpp#L2263 I'm going to fix this problem along with https://bugzilla.redhat.com/show_bug.cgi?id=1923886

btw, I wouldn't suggest using this repository https://gitlab.freedesktop.org/spice/win32/virtio-gpu-wddm-dod/ anymore. Windows virtio-gpu driver has been fully merged under virtio-win umbrella.

Cheers, Vadim.

vrozenfe avatar Mar 11 '21 01:03 vrozenfe

I'm going to fix this problem along with https://bugzilla.redhat.com/show_bug.cgi?id=1923886

@vrozenfe It looks like you fixed that bug a month ago. It's not clear to me whether that fix made it into the recently updated public builds, but presumably this issue can be closed?

jwatt avatar Aug 05 '21 22:08 jwatt

@jwatt

Win10 currently (latest-build 204) works with up to 16MB (2KB x 2KB x 32bpp) surface. I still have a plan to make it bigger (up to 256 MB) but it might take some time. There is also a new feature introduced in build 204 that allows to change the Windows VM screen resolution dynamically https://bugzilla.redhat.com/show_bug.cgi?id=1923886.

Vadim.

vrozenfe avatar Aug 06 '21 06:08 vrozenfe

Yes, 2560x1600 works for me now.

@vrozenfe

There is also a new feature introduced in build 204 that allows to change the Windows VM screen resolution dynamically

Windows allows me to select 3840x1848 (which is, I guess, the size of virt-manager window), but it results in a black screen. I think the driver shouldn't report the resolution if it's too big. virtio-win-0.1.204

amezin avatar Aug 06 '21 21:08 amezin

@amezin

I will try too support the bigger resolutions soon.

vrozenfe avatar Aug 07 '21 08:08 vrozenfe

I think it's sometimes too big. My Screen supports 2560 x 1440 and in the Windows guest 2560 x 1600, so 160px too much, it doesn't crash but the pixels at the bottom aren't visible.

Lilith2208 avatar Jan 30 '22 21:01 Lilith2208

@Lilith2208 currently we pre-allocate 16MB buffer on Win10 and 8MB on Win8/8.1 https://github.com/virtio-win/kvm-guest-drivers-windows/blob/master/viogpu/viogpudo/viogpudo.cpp#L2368 16MB should be enough to handle 2048x2048 resolution in 32bit per pixel mode. 2560x1600x4 requires even a bit less than 16MB. What kind of viewer do use?

In any case 16MB is a temporary limit that planed to be fixed in the future versions.

Vadim.

vrozenfe avatar Jan 30 '22 23:01 vrozenfe

@Lilith2208 currently we pre-allocate 16MB buffer on Win10 and 8MB on Win8/8.1 https://github.com/virtio-win/kvm-guest-drivers-windows/blob/master/viogpu/viogpudo/viogpudo.cpp#L2368 16MB should be enough to handle 2048x2048 resolution in 32bit per pixel mode. 2560x1600x4 requires even a bit less than 16MB. What kind of viewer do use?

In any case 16MB is a temporary limit that planed to be fixed in the future versions.

Vadim.

Any update on this? I would really like to set 2560x1440 as a resolution because the maximum 2048x2048 is square on looks odd on most common 16:9 / 16:10 monitors.

Is there any way to set 2560x1440 while using the viogpud driver on Windows 10?

BentHaase avatar Jul 06 '22 07:07 BentHaase

@BentHaase Technically, it should be possible on Win10. 2560x1600x4 a git more than 14 MB while the memory, allocated to backup the frame buffer is 16MB.

vrozenfe avatar Jul 06 '22 10:07 vrozenfe

@BentHaase Technically, it should be possible on Win10. 2560x1600x4 a git more than 14 MB while the memory, allocated to backup the frame buffer is 16MB.

Sadly there is now way to way to set 2560x1440 or am I missing something?

image

BentHaase avatar Jul 23 '22 23:07 BentHaase

@BentHaase you need to pass the following parameters to qemu "-device virtio-vga,edid=on,xres=2560,yres=1600" to make the new resolution to be recognisable by the guest/viogpudo driver Screenshot from 2022-07-24 15-50-53

Alternatively, you can try using the dynamic resolutions https://bugzilla.redhat.com/show_bug.cgi?id=1923886 by installing and running vgpusrv.exe service together with viogpuap.exe application

Best, Vadim.

vrozenfe avatar Jul 24 '22 06:07 vrozenfe

@BentHaase It has to be "-device virtio-vga,edid=on,xres=2560,yres=1440" of course, but let me check if it works fine with the recent drivers.

vrozenfe avatar Jul 24 '22 06:07 vrozenfe

Using dynamic resolution seems to only work for me using QXL. Even though all guest tools have been installed on this Windows 10 VM dynamic resolution does not work when using virtio gpudo.

@BentHaase It has to be "-device virtio-vga,edid=on,xres=2560,yres=1440" of course, but let me check if it works fine with the recent drivers.

Is there a way to set this directly via virsh xml definition?

This is my current video device (virtio-vga-gl)

<video>
  <model type="virtio" heads="1" primary="yes">
    <acceleration accel3d="yes"/>
  </model>
  <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0"/>
</video>

Which translates to these qemu parameters:

[...] spice port=0,disable-ticketing=on,image-compression=auto_lz,streaming-video=filter,gl=on,rendernode=/dev/dri/by-path/pci-0000:07:00.0-render,seamless-migration=on -device virtio-vga-gl,id=video0,max_outputs=1,bus=pcie.0,addr=0x1 [...]

BentHaase avatar Jul 24 '22 07:07 BentHaase

@BentHaase, What kind of viewer do you use? The Windows virtio-gpu driver is not integrated with spice and vnc. And honestly, we don't have any technical requirements to address this issue yet.

Unfortunately, I have no idea how to set resolutions from libvirt/virsh side.

vrozenfe avatar Jul 24 '22 10:07 vrozenfe

Just for the record. Tested it again on QEMU with relatively recent driver. It works fine on my setup. We even don't need to enable EDID, just specify resolutions "-device virtio-vga,xres=2560,yres=1440" Screenshot from 2022-07-24 21-41-34

vrozenfe avatar Jul 24 '22 11:07 vrozenfe

This is a really helpful thread, as I also wanted to set a resolution of 2560 x 1440. Thank you so much @vrozenfe!

Just an FYI follow-up on the additional query @BentHaase raised, which i will paraphrase as to how to set this via the XML definition?.

I was able to achieve this by configuring the resolution element as shown below. This is documented as being a supported element in the libvirt XML docs so hopefully also answers that additional query

<video>
  <model type="virtio" heads="1" primary="yes">
    <resolution x="2560" y="1440"/>
  </model>
  <alias name="video0"/>
  <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0"/>
</video>

  ....

With this in place, i was then able to see the correct parameters being passed to qemu in the libvirt log for the VM. FYI they were as follows:-

-device virtio-vga,id=video0,max_outputs=1,xres=2560,yres=1440,bus=pcie.0,addr=0x1

dacarey avatar Aug 31 '22 16:08 dacarey

In any case 16MB is a temporary limit that planed to be fixed in the future versions.

Thank you for this thread. I was hoping for xres=3200,yres=1800 and not yet at this time using the Red Hat VirIO GPU DOD controller. The resolution works for Linux VMs and fits nicely within a 4k display.

Wish list: Please allow this resolution in a future release.

I tried spice using the Red Hat QXL controller, but the UI is laggy. So I export a variable for SDL and run QEMU with the following options. Be sure to update the display adapter driver and point to the virtio-win CD drive.

export SDL_MOUSE_FOCUS_CLICKTHROUGH=1

-vga none -device virtio-vga-gl,max_outputs=1,xres=2560,yres=1600 -display sdl,gl=on \
-audiodev sdl,id=audio0 -device intel-hda -device hda-output,audiodev=audio0

This works too.

-vga none -device virtio-vga-gl -display sdl,gl=on \
-audiodev sdl,id=audio0 -device intel-hda -device hda-output,audiodev=audio0

marioroy avatar Sep 06 '22 07:09 marioroy

@marioroy I will try to add more resolutions/memory allocation support in the next release.

vrozenfe avatar Sep 06 '22 08:09 vrozenfe

Could you also add 3:2 aspect ratio 3240x2560? It would be great for my Huwai Mateview 28

sbleschke avatar Nov 25 '22 17:11 sbleschke

Hi, I could need some help here as well. I tried setting my resultion to 3840x1880 using this XML configuration:

<video>
  <model type="virtio" heads="1" primary="yes">
    <acceleration accel3d="yes"/>
    <resolution x="3840" y="1880"/>
  </model>
  <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0"/>
</video>

But still, Windows only allows me setting the resolution up until 2560x1600, which leaves some black edges on my screen (using 4K). So is it not possible to set the resolution to any arbitrary value using the XML file or did I do something wrong?

major-mayer avatar Sep 20 '23 14:09 major-mayer

Currently viogpudo driver allocates 16MB memory buffer, which is too small for resolutions like 3840x1880 .

I will try to increase this size in the next release. Vadim.

vrozenfe avatar Sep 21 '23 23:09 vrozenfe

4K resolutions should work with the following fix https://github.com/virtio-win/kvm-guest-drivers-windows/pull/1019

vrozenfe avatar Jan 02 '24 00:01 vrozenfe

Great news thanks for your work 😊

major-mayer avatar Jan 02 '24 07:01 major-mayer

the latest virtio-gpu-dod 64-bit drivers for Win10 and Win11 platforms can be found here https://people.redhat.com/vrozenfe/viogpu247.zip.

Not officially tested yet. Use it on your own rick. Best, Vadim.

vrozenfe avatar Jan 24 '24 11:01 vrozenfe

@vrozenfe, When will this be officially released?

mrhyperbit avatar Jan 28 '24 19:01 mrhyperbit

@mrhyperbit Last decade of February. Maybe a bit earlier. Vadim.

vrozenfe avatar Jan 28 '24 22:01 vrozenfe

the latest virtio-gpu-dod 64-bit drivers for Win10 and Win11 platforms can be found here https://people.redhat.com/vrozenfe/viogpu247.zip.

Not officially tested yet. Use it on your own rick. Best, Vadim.

Those are for ARM?

Toetje585 avatar Feb 21 '24 13:02 Toetje585

@Toetje585 That one was for x64 platforms only. But a new stable virtio-win package with the latest ARM64 drivers will be released soon. Vadim.

vrozenfe avatar Feb 22 '24 01:02 vrozenfe

@vrozenfe

If i inspect the INF file (viogpu247.zip.) they seem to be for ARM perhaps this happend by accident.

%VENDOR%=VioGpu,NTARM64.10.0

Toetje585 avatar Feb 22 '24 09:02 Toetje585

My bad. Drivers in Win11 folder are actually Win11 arm64. Just messed up with attestation signing submission. Thank you spotting it out. Vadim.

vrozenfe avatar Feb 23 '24 00:02 vrozenfe