[GH-ISSUE #81] Feature-Request: Add virgl support #53

Open
opened 2026-02-27 15:57:09 +03:00 by kerem · 3 comments
Owner

Originally created by @fabiohsouza on GitHub (Dec 28, 2015).
Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/81

I tryed change to

<video>
    <model type='virtio' heads='1'>
        <acceleration accel3d='yes'/>
    </model
</video>

but an error message saying the video model 'virtio' is not supported.

I am using for tests:
Ubuntu 15.10 - Kernel 4.4-rc7 (host/guest)
QEMU 2.5
Mesa 11.2
libvirt 1.2.21

https://www.redhat.com/archives/libvir-list/2015-November/msg01245.html

Originally created by @fabiohsouza on GitHub (Dec 28, 2015). Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/81 I tryed change to ``` <video> <model type='virtio' heads='1'> <acceleration accel3d='yes'/> </model </video> ``` but an error message saying the video model 'virtio' is not supported. I am using for tests: Ubuntu 15.10 - Kernel 4.4-rc7 (host/guest) QEMU 2.5 Mesa 11.2 libvirt 1.2.21 https://www.redhat.com/archives/libvir-list/2015-November/msg01245.html
Author
Owner

@savichev commented on GitHub (Dec 28, 2015):

Latest in git - libvirtd version 1.3.1.
I compile for deb for test

Worked!
Debian 8 (host/guest)
Kernel: 4.4.0-040400rc7-generic (host/guest)
QEMU 2.5 (host)
mesa-dev_11.2.0 (host/guest)
libdrm-dev_2.4.66 (host/guest)
libvirt-namespaces._1.3.1 (host)

Image of Yaktocat

<!-- gh-comment-id:167539995 --> @savichev commented on GitHub (Dec 28, 2015): Latest in git - libvirtd version 1.3.1. I compile for deb for test Worked! Debian 8 (host/guest) Kernel: 4.4.0-040400rc7-generic (host/guest) QEMU 2.5 (host) mesa-dev_11.2.0 (host/guest) libdrm-dev_2.4.66 (host/guest) libvirt-namespaces._1.3.1 (host) ![Image of Yaktocat](https://pp.vk.me/c630316/v630316041/12ff2/znNWSb9AfWw.jpg)
Author
Owner

@savichev commented on GitHub (Mar 24, 2016):

https://cgit.freedesktop.org/spice/spice/commit/?id=782c7508e28fdeee786cdcebffd22f772d7f09ec

GL acceleration (virgl)

OpenGL acceleration is currently local only (it has to go through a Unix socket)
and it needs guest support. It's currently limited to recent linux
distributions (for example up to date Fedora 23 + updated mesa packages from
https://copr.fedorainfracloud.org/coprs/kraxel/virgl/[copr:kraxel]).

Configuration

Using libvirt

You need to add a virtio-gpu video device to your virtual machine instead of QXL.
[source,xml]

<video>
   <model type='virtio' heads='1'>
     <acceleration accel3d='yes'/>
   </model>
 </video>

Then you need to enable OpenGL on your SPICE graphics node:
[source,xml]

<graphics type='spice' autoport='no'>
  <gl enable='yes'/>
</graphics>

You don't need any port/address as they won't be usable with GL.

Using QEMU

You need to add a virtio-gpu device on QEMU command line,
as well as enable GL with SPICE. port/tls-port/addr arguments
won't be used in this setup. You need to configure a Unix socket to
connect to the VM display.

[source,sh]
-device virtio-vga,virgl=on -spice gl=on,unix,addr=/run/user/1000/spice.sock

Connecting to the guest

Connecting to the guest when virgl is in use is slightly different
than usual

If libvirt is being used

[source,sh]
client$ virt-viewer -a $vmname

If a Unix socket has been set on QEMU command line

[source,sh]
client$ remote-viewer spice+unix:///run/user/1000/spice.sock

<!-- gh-comment-id:200836912 --> @savichev commented on GitHub (Mar 24, 2016): https://cgit.freedesktop.org/spice/spice/commit/?id=782c7508e28fdeee786cdcebffd22f772d7f09ec > # GL acceleration (virgl) > > OpenGL acceleration is currently **local only** (it has to go through a Unix socket) > and it needs guest support. It's currently limited to recent linux > distributions (for example up to date Fedora 23 + updated mesa packages from > https://copr.fedorainfracloud.org/coprs/kraxel/virgl/[copr:kraxel]). > > ## Configuration > > Using libvirt > > You need to add a virtio-gpu video device to your virtual machine instead of QXL. > [source,xml] > > ``` > <video> > <model type='virtio' heads='1'> > <acceleration accel3d='yes'/> > </model> > </video> > ``` > > Then you need to enable OpenGL on your SPICE graphics node: > [source,xml] > > ``` > <graphics type='spice' autoport='no'> > <gl enable='yes'/> > </graphics> > ``` > > **You don't need any port/address** as they won't be usable with GL. > > Using QEMU > > You need to add a virtio-gpu device on QEMU command line, > as well as enable GL with SPICE. port/tls-port/addr arguments > won't be used in this setup. You need to configure a Unix socket to > connect to the VM display. > > [source,sh] > `-device virtio-vga,virgl=on -spice gl=on,unix,addr=/run/user/1000/spice.sock` > > ## Connecting to the guest > > Connecting to the guest when virgl is in use is slightly different > than usual > > If libvirt is being used > > [source,sh] > `client$ virt-viewer -a $vmname` > > If a Unix socket has been set on QEMU command line > > [source,sh] > `client$ remote-viewer spice+unix:///run/user/1000/spice.sock`
Author
Owner

@zingmars commented on GitHub (Jun 6, 2018):

While enabling virgl works, it breaks the NoVNC viewer as it fails to properly connect to the socket for some reason (blank screen followed by "Unexpected close while ready").

<!-- gh-comment-id:395145915 --> @zingmars commented on GitHub (Jun 6, 2018): While enabling virgl works, it breaks the NoVNC viewer as it fails to properly connect to the socket for some reason (blank screen followed by "Unexpected close while ready").
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/webvirtcloud#53
No description provided.