I want to allocate some video memory to a Qemu VM which uses virgl VGA to enable 3D acceleration. I typed this command to try to allocate 1G video memory to it:

qemu-system-x86_64 -hda RedHat.qcow2 -m 2G -smp 8 \
    -device virtio-vga-gl,max_hostmem=1000 -display gtk,gl=on

But it doesn't work; the virgl device in VM does not obtain the allocated video memory. This can be shown by info ramblock command in Qemu monitor:

(qemu) info ramblock
              Block Name    PSize              Offset               Used              Total
   0000:00:03.0/vga.vram    4 KiB  0x00000000800c0000 0x0000000000800000 0x0000000000800000
0000:00:03.0/virtio-vga.rom    4 KiB  0x00000000808c0000 0x0000000000010000 0x0000000000010000

, or glxinfo -B command in guest OS: enter image description here

So, how can I allocate video memory to virtio-vga-gl device? The host is Ubuntu 20.10, the guest is RHEL 8.5, and Qemu is built from latest source 6.2.0-rc4.

As a side question, where can I find full documents of latest Qemu options and its properties like max_hostmem=1G or show-cursor=on? I know -device help command line option of Qemu, but it contains no further document. I googled a lot but can only find docs like this which almost says nothing. This document is too old. I also read this question. It's only 3 years old, but already out-of-date. I'll appreciate it if you can let me know the url in comment.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.