You are not logged in.

#1 2019-04-30 13:33:59

r0b0t
Member
From: /tmp
Registered: 2009-05-24
Posts: 488

[SOLVED]virtio 3daccel - virgl3d on Arch Linux guest / Arch Host

Host setup

pacman -Q virt-manager qemu qemu-arch-extra xf86-video-qxl spice spice-gtk libvirt
virt-manager 2.1.0-2
qemu 4.0.0-2
qemu-arch-extra 4.0.0-2
xf86-video-qxl 0.1.5-7
spice 0.14.0-3
spice-gtk 0.36-1
libvirt 5.2.0-1

uname -a
Linux arch 5.0.9-arch1-1-ARCH #1 SMP PREEMPT Sat Apr 20 15:00:46 UTC 2019 x86_64 GNU/Linux

Fully up to date with all current standard channels updates

Guest setup

pacman -Q qemu-guest-agent spice-vdagent xf86-video-qxl
qemu-guest-agent 3.1.0-2
spice-vdagent 0.18.0-1
xf86-video-qxl 0.1.5-7

spice-vdagentd and ga-qemu enabled 
Same kernel version as the host.

First I removed the QXL Display and Added a Virtio one, then I had to edit

    <graphics type='spice' keymap='en'>
      <listen type='socket' socket='/tmp/spice.socket'/>
      <image compression='off'/>
      <gl enable='yes'/>

Without the socket it couldn't start it gave an error.
https://bugzilla.redhat.com/show_bug.cgi?id=1337290 , the workaround suggested there worked (spice.socket).

The problem with cinnamon, after lxdm whenever I logged in X crashed with the following error:


[   381.159] (II) config/udev: Adding input device spice vdagent tablet (/dev/input/js1)
[   381.160] (II) No input driver specified, ignoring this device.
[   381.160] (II) This device may have been added with another device file.
[   381.163] (II) config/udev: Adding input device spice vdagent tablet (/dev/input/mouse2)
[   381.163] (II) No input driver specified, ignoring this device.
[   381.163] (II) This device may have been added with another device file.
[   381.285] (II) config/udev: Adding input device spice vdagent tablet (/dev/input/event5)
[   381.285] (**) spice vdagent tablet: Applying InputClass "libinput pointer catchall"
[   381.285] (II) Using input driver 'libinput' for 'spice vdagent tablet'
[   381.285] (**) spice vdagent tablet: always reports core events
[   381.285] (**) Option "Device" "/dev/input/event5"
[   381.285] (**) Option "_source" "server/udev"
[   381.308] (II) event5  - spice vdagent tablet: is tagged by udev as: Mouse
[   381.308] (II) event5  - spice vdagent tablet: device is a pointer
[   381.308] (II) event5  - spice vdagent tablet: device removed
[   381.358] (**) Option "config_info" "udev:/sys/devices/virtual/input/input6/event5"
[   381.358] (II) XINPUT: Adding extended input device "spice vdagent tablet" (type: MOUSE, id 10)
[   381.360] (**) Option "AccelerationScheme" "none"
[   381.363] (**) spice vdagent tablet: (accel) selected scheme none/0
[   381.363] (**) spice vdagent tablet: (accel) acceleration factor: 2.000
[   381.363] (**) spice vdagent tablet: (accel) acceleration threshold: 4
[   381.365] (II) event5  - spice vdagent tablet: is tagged by udev as: Mouse
[   381.365] (II) event5  - spice vdagent tablet: device is a pointer
[   382.713] Failed to compile FS: 0:11(2): error: `color0' undeclared
0:11(2): error: value of type vec4 cannot be assigned to variable of type error
0:12(2): error: `color1' undeclared
0:12(2): error: value of type vec4 cannot be assigned to variable of type error

[   382.713] Program source:
#ifdef GL_ES
precision mediump float;
#endif
#define ATLAS_DIM_INV 0.000976562500000000
varying vec2 glyph_pos;
uniform vec4 fg;
uniform sampler2D atlas;
void main() {
       vec4 mask = texture2D(atlas, glyph_pos);
       vec4 source = fg;
      color0 = source * mask;
      color1 = source.a * mask;
}
[   382.713] (EE) 
Fatal server error:
[   382.713] (EE) GLSL compile failure
[   382.713] (EE) 
[   382.713] (EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
[   382.713] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[   382.713] (EE) 
[   382.713] (II) AIGLX: Suspending AIGLX clients for VT switch
[   382.717] (EE) Server terminated with error (1). Closing log file.

somehow it worked well with xfce4 3daccel plus framerate refresh and window automatic resize so I guess virgl 3d is a workaround for https://bbs.archlinux.org/viewtopic.php?id=245954

grep drm
[   31.153395] [drm] pci: virtio-vga detected at 0000:07:00.0
[   31.153397] fb0: switching to virtiodrmfb from EFI VGA
[   31.153497] [drm] virgl 3d acceleration enabled
[   31.154975] [drm] number of scanouts: 1
[   31.155043] [drm] number of cap sets: 2
[   31.155246] [drm] cap set 0: id 1, max-version 1, max-size 308
[   31.155827] [drm] cap set 1: id 2, max-version 2, max-size 556
[   31.180246] virtio_gpu virtio4: fb0: virtiodrmfb frame buffer device
[   31.193520] [drm] Initialized virtio_gpu 0.1.0 0 for virtio4 on minor 0
lsmod | grep virtio
virtio_gpu             61440  13
ttm                   114688  2 bochs_drm,virtio_gpu
drm_kms_helper        208896  2 bochs_drm,virtio_gpu
drm                   499712  17 drm_kms_helper,bochs_drm,virtio_gpu,ttm
virtio_blk             20480  2
virtio_rng             16384  0
rng_core               16384  1 virtio_rng
virtio_balloon         24576  0
virtio_console         36864  2
virtio_pci             28672  0
virtio_ring            40960  6 virtio_rng,virtio_console,virtio_balloon,virtio_gpu,virtio_pci,virtio_blk
virtio                 16384  6 virtio_rng,virtio_console,virtio_balloon,virtio_gpu,virtio_pci,virtio_blk
glxgears   
libGL error: Version 7 or imageFromFds image extension not found
libGL error: failed to load driver: virtio_gpu
Running synchronized to the vertical refresh.  The framerate should be
approximately the same as the monitor refresh rate.
611 frames in 5.0 seconds = 121.840 FPS
574 frames in 5.0 seconds = 114.798 FPS
639 frames in 5.0 seconds = 127.737 FPS
XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0.0"
      after 7167 requests (7167 known processed) with 0 events remaining.

Can we make this work on cinnamon as well?
Also the 2 libGL errors, how to add the imageFromFds extension , as for virtio_gpu is already loaded.

Last edited by r0b0t (2019-05-08 12:05:10)

Offline

#2 2019-05-04 13:42:55

r0b0t
Member
From: /tmp
Registered: 2009-05-24
Posts: 488

Re: [SOLVED]virtio 3daccel - virgl3d on Arch Linux guest / Arch Host

ERR, not solved, as soon as I click an application (any) X crashes.
If anyone has any idea of what's going on here, their input will be thanked by the old arch generation of users tongue

EDIT / SOLUTION:
Set Video to Virtio and enable 3D, also enable OpenGL on display spice , when you recheck it if you have OpenGL enabled on the host it will show /dev/dri/renderD128

Refer as well to the configuration above, and also check the other thread. https://bbs.archlinux.org/viewtopic.php?id=245954

By booting in cinnamon with rendering this time everything works and glxgears doesn't show any errors.
Also screen resizing works as well.

Last edited by r0b0t (2019-05-08 12:16:07)

Offline

#3 2019-09-08 16:01:49

klapauzius
Member
Registered: 2019-07-22
Posts: 19

Re: [SOLVED]virtio 3daccel - virgl3d on Arch Linux guest / Arch Host

r0b0t wrote:

Host setup

pacman -Q virt-manager qemu qemu-arch-extra xf86-video-qxl spice spice-gtk libvirt
virt-manager 2.1.0-2
qemu 4.0.0-2
qemu-arch-extra 4.0.0-2
xf86-video-qxl 0.1.5-7
spice 0.14.0-3
spice-gtk 0.36-1
libvirt 5.2.0-1
[..]

[..]
Guest setup

pacman -Q qemu-guest-agent spice-vdagent xf86-video-qxl
qemu-guest-agent 3.1.0-2
spice-vdagent 0.18.0-1
xf86-video-qxl 0.1.5-7

spice-vdagentd and __qemu-guest-agent__ enabled 

[..]

Hey, r0b0t, thanks for sharing. My arch guest kept freezing a few seconds after starting X-Server/LightDM, so I've been studying the arch-wiki's QEMU article up and down, assuming I've been missing something and you just pasted in a few lines what pieces of software one needs.

r0b0t wrote:

[..]
Set Video to Virtio and enable 3D, also enable OpenGL on display spice
[..]
Also screen resizing works as well.
[..]

Again, thanks for sharing, switching from QXL to virtio unfreezed my arch guest. This might be a very valuable hint for others trying to get an arch guest running.

After switching to virtio I removed xf86-video-qxl on guest and host. So far without experiencing any negative consequences.



off-topic - relates to screen resizing - if you like to add different resolutions for your guest you can do a

sudo nano /etc/X11/xorg.conf.d/30-monitor.conf
Section "Monitor"
   Identifier "Virtual-1"
   Modeline "..."
   Optione "PreferredMode" "..."
EndSection

Modeline can be calculated like this

cvt 2560 1440 60

Automatic resizing (Host - libvirt-manager - View - Resize to VM) doesn't support non-standard guest resolutions, though.

PS: is it possible that there is a tv show named after you? wink

Last edited by klapauzius (2019-09-09 17:46:23)

Offline

Board footer

Powered by FluxBB