Bug 1791236
Summary: | virgl 3d acceleration enabled automatically after enabling egl-headless | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux Advanced Virtualization | Reporter: | Guo, Zhiyi <zhguo> |
Component: | libvirt | Assignee: | Jonathon Jongsma <jjongsma> |
Status: | CLOSED ERRATA | QA Contact: | yafu <yafu> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 8.2 | CC: | chhu, coli, dyuan, jdenemar, jsuchane, juzhang, kraxel, lmen, mprivozn, virt-maint, xuzhang, yafu |
Target Milestone: | rc | Keywords: | Upstream |
Target Release: | 8.0 | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-6.2.0-1.el8 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2020-11-17 17:46:36 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Guo, Zhiyi
2020-01-15 09:52:17 UTC
> Expected results:
> virgl shouldn't be enabled without virgl=on option
Why not? I'd expect people typically expect that virgl gets enabled if possible.
If you don't want it in specific use cases there is the option to explicitly say so using "virgl=off".
(In reply to Gerd Hoffmann from comment #1) > > Expected results: > > virgl shouldn't be enabled without virgl=on option > > Why not? I'd expect people typically expect that virgl gets enabled if > possible. > If you don't want it in specific use cases there is the option to explicitly > say so using "virgl=off". Looks like libvirt cannot specify virgl=off, but use egl-headless to controll the ON/OFF of virgl is also weird to me. Let's look at some user scenarios: 1)users want to enable virgl, in this scenario, they need both egl-headless and "acceleration accel3d='yes'" for virtio-vga: ... <graphics type='egl-headless'> <gl rendernode='/dev/dri/renderD128'/> </graphics> ... <video> <model type='virtio' heads='1' primary='yes'> <acceleration accel3d='yes'/> </model> <alias name='video0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </video> ... These two libvirt elements will translate into -display egl-headless,rendernode=/dev/dri/renderD128 -device virtio-vga,id=video0,virgl=on,max_outputs=1,bus=pcie.0,addr=0x1 in qemu cli and virgl is enabled inside VM as expected. 2)user want to use virtio-vga but with virgl disabled, the legacy way is no egl-headless and acceleration accel3d='yes' specified and I have no doubt about this one. 3)user want to use virtio-vga but with virgl disabled, they add egl-headless in their xml but they don't need the 3d capability for now(maybe multiple VMs are enabled on a server and only some people require to work with 3d content and they don't want other people to share host graphic resource). In this case, they can use: a) ... <graphics type='egl-headless'> <gl rendernode='/dev/dri/renderD128'/> </graphics> ... <video> <model type='virtio' heads='1' primary='yes'> <acceleration accel3d='no'/> </model> <alias name='video0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </video> ... b) ... <graphics type='egl-headless'> <gl rendernode='/dev/dri/renderD128'/> </graphics> ... <video> <model type='virtio' heads='1' primary='yes'> </model> <alias name='video0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </video> ... Whatever a) or b), they will all translate into -display egl-headless,rendernode=/dev/dri/renderD128 -device virtio-vga,id=video0,max_outputs=1,bus=pcie.0,addr=0x1 in qemu cli From the meaning of the libvirt xml and qemu cli, these seems point to virgl is OFF. However, virgl is ON inside VM!! 4) in scenario virtio-vga(primary) + intel vgpu(secondary), users only want to use virtio-vga for boot messages and use intel vgpu for their desktop. ... <video> <model type='virtio' heads='1' primary='yes'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </video> ... <graphics type='egl-headless'> <gl rendernode='/dev/dri/renderD128'/> </graphics> ... <hostdev mode='subsystem' type='mdev' managed='no' model='vfio-pci' display='on'> <source> <address uuid='24e33b95-444c-45f4-98a5-758de39aa651'/> </source> <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/> </hostdev> ... Use egl-headless here I think is just for enabling vfio display of vgpu, however, virgl is also enabled as well. If people want to enable virgl indeed in this configuration, they can add <acceleration accel3d='yes'/> to virtio-vga for this purpose. But if they want the virgl to remain OFF or are not aware of the existence of virgl, just don't specify "acceleration accel3d" is more natural. > a) > ... > <graphics type='egl-headless'> > <gl rendernode='/dev/dri/renderD128'/> > </graphics> > ... > <video> > <model type='virtio' heads='1' primary='yes'> > <acceleration accel3d='no'/> > </model> > <alias name='video0'/> > <address type='pci' domain='0x0000' bus='0x00' slot='0x01' > function='0x0'/> > </video> > ... > Whatever a) or b), they will all translate into -display > egl-headless,rendernode=/dev/dri/renderD128 -device > virtio-vga,id=video0,max_outputs=1,bus=pcie.0,addr=0x1 in qemu cli Oh. That is wrong. With explicit "accel3d='no'" libvirt should pass "virgl=off" to qemu (if the virgl property is present). I've merged the patch upstream: dee2218bc8 qemu: explicitly disable virgl when requested v6.0.0-97-gdee2218bc8 Reproduced with libvirt-6.0.0-17.x86_64. Verified with libvirt-6.4.0-1.x86_64. Test steps: Scenario 1: guest with spice gl and acce3d='no': 1.Start a guest with spice gl and accel3d='no': #virsh dumpxml vm1 ... <graphics type='egl-headless'> <gl rendernode='/dev/dri/renderD128'/> </graphics> ... <video> <model type='virtio' heads='1' primary='yes'> <acceleration accel3d='no'/> </model> <alias name='video0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </video> ... 2.Check the qemu cmd line: #ps aux | grep -i qemu | grep -i virgl ...-device virtio-vga,id=ua-1035e984-8238-46e1-bf56-b546246e1a35,virgl=off,max_outputs=1,bus=pcie.0,addr=0x1... 3.Check virgl in guest os: # dmesg | grep -i virgl [ 14.169104] [drm] virgl 3d acceleration not supported by host scenario 2: guest with spice gl and no acce3d setting: 1.Start guest with spice gl and no acce3d setting: #virsh dumpxml vm1 ... <graphics type='egl-headless'> <gl rendernode='/dev/dri/renderD128'/> </graphics> ... <video> <model type='virtio' heads='1' primary='yes'> </model> <alias name='video0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </video> ... 2.Check the qemu cmd line: #ps aux | grep -i qemu | grep -i virgl: no output 3.Check virgl in guest os: # dmesg | grep -i virgl [ 14.136783] [drm] virgl 3d acceleration enabled scenario 3: guest with spice gl and acce3d='yes': #virsh dumpxml vm1 ... <graphics type='egl-headless'> <gl rendernode='/dev/dri/renderD128'/> </graphics> ... <video> <model type='virtio' heads='1' primary='yes'> <acceleration accel3d='yes'/> </model> <alias name='video0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </video> ... 2.Check qemu cmd line: #ps aux | grep -i qemu | grep -i virgl: ...-device virtio-vga,id=ua-1035e984-8238-46e1-bf56-b546246e1a35,virgl=on,max_outputs=1,bus=pcie.0,addr=0x1... 3.Check virgl in guest os: # dmesg | grep -i virgl [ 14.136783] [drm] virgl 3d acceleration enabled Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (virt:8.3 bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:5137 |