You are not logged in.

#1 2016-11-06 11:06:52

cyannut
Member
Registered: 2016-11-05
Posts: 1

QEMU: how to enable Virgl in arch guest?

Hi,

    I am trying to enable virgl in an qemu Arch guest.  Here is the command line:

qemu-system-x86_64 \
    -enable-kvm -cpu host -m 4096 \
    -vga virtio \
    -display gtk,gl=on \
    -machine smm=off \
    -usbdevice tablet \
    -net nic -net user,hostfwd=tcp::3411-:3411 \
    -drive format="raw",file=archlinux.img,if=virtio \
    -boot order=c 

    In the console everything seems to be fine, since I can see the following from dmesg:

$ dmesg |grep drm
[    1.265993] [drm] Initialized drm 1.1.0 20060810
[    1.451790] [drm] pci: virtio-vga detected
[    1.451793] fb: switching to virtiodrmfb from VESA VGA
[    1.456451] [drm] virgl 3d acceleration enabled
[    1.456983] [drm] virtio vbuffers: 272 bufs, 192B each, 51kB total.
[    1.467837] [drm] number of scanouts: 1
[    1.467870] [drm] number of cap sets: 1
[    1.501881] [drm] cap set 0: id 1, max-version 1, max-size 308
[    1.507655] virtio_gpu virtio0: fb0: virtiodrmfb frame buffer device
[    1.514745] [drm] Initialized virtio_gpu 0.0.1 0 on minor 0

However when I try to run startx, it segfaults:

$ cat ~/.local/share/xorg/Xorg.0.log | grep EE
[   314.102] Current Operating System: Linux shadow 4.8.6-1-ARCH #1 SMP PREEMPT Mon Oct 31 18:51:30 CET 2016 x86_64
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[   314.130] (EE) 
[   314.130] (EE) Backtrace:
[   314.130] (EE) 0: /usr/lib/xorg-server/Xorg (OsLookupColor+0x139) [0x59cd49]
[   314.130] (EE) 1: /usr/lib/libc.so.6 (__restore_rt+0x0) [0x7eff777f90af]
[   314.131] (EE) 2: /usr/lib/libgbm.so.1 (gbm_surface_has_free_buffers+0x1505) [0x7eff724d88f5]
[   314.131] (EE) 3: /usr/lib/libgbm.so.1 (gbm_surface_has_free_buffers+0x1b98) [0x7eff724d9628]
[   314.131] (EE) 4: /usr/lib/libgbm.so.1 (gbm_surface_has_free_buffers+0x1498) [0x7eff724d8738]
[   314.131] (EE) 5: /usr/lib/libgbm.so.1 (gbm_create_device+0x4c) [0x7eff724d5cbc]
[   314.131] (EE) 6: /usr/lib/xorg/modules/libglamoregl.so (glamor_egl_init+0x81) [0x7eff726e8151]
[   314.131] (EE) 7: /usr/lib/xorg/modules/drivers/modesetting_drv.so (_init+0x3cc0) [0x7eff72f33af0]
[   314.131] (EE) 8: /usr/lib/xorg-server/Xorg (InitOutput+0xac5) [0x47d065]
[   314.132] (EE) 9: /usr/lib/xorg-server/Xorg (remove_fs_handlers+0x266) [0x43a5f6]
[   314.132] (EE) 10: /usr/lib/libc.so.6 (__libc_start_main+0xf1) [0x7eff777e6291]
[   314.132] (EE) 11: /usr/lib/xorg-server/Xorg (_start+0x29) [0x4246e9]
[   314.133] (EE) 12: ? (?+0x29) [0x29]
[   314.133] (EE) 
[   314.133] (EE) Segmentation fault at address 0xc
[   314.133] (EE) 
[   314.133] (EE) Caught signal 11 (Segmentation fault). Server aborting
[   314.133] (EE) 
[   314.133] (EE) 
[   314.133] (EE) Please also check the log file at "/home/chen/.local/share/xorg/Xorg.0.log" for additional information.
[   314.133] (EE) 
[   314.137] (EE) Server terminated with error (1). Closing log file.

But if I turn off virgl (with -vga std), X starts fine. Is there anything I can do to fix for virgl?

The guest is up-to-date with the repo:

$ pacman -Qs '^(linux|mesa|xorg-server)$'
local/linux 4.8.6-1 (base)
    The Linux kernel and modules
local/mesa 13.0.0-1
    an open-source implementation of the OpenGL specification
local/xorg-server 1.18.4-1 (xorg)
    Xorg X server

host packages:

$ pacman -Qs '^(linux|mesa|qemu|virglrenderer|libepoxy)$'
local/libepoxy 1.3.1-1
    A library for handling OpenGL function pointer management for you
local/linux 4.6.4-1 (base)
    The Linux kernel and modules
local/mesa 13.0.0-1
    an open-source implementation of the OpenGL specification
local/qemu 2.7.0-2
    A generic and open source machine emulator and virtualizer
local/virglrenderer 0.5.0-1
    A virtual 3D GPU library, that allows the guest operating system to use the host GPU to accelerate 3D rendering

Offline

#2 2016-11-06 17:30:13

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: QEMU: how to enable Virgl in arch guest?

https://wiki.archlinux.org/index.php/QEMU#virtio

Looks like you also need a development version of spice and a custom build qemu .

qemu-spice in AUR looks like it may be what you need .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2017-07-28 13:52:35

LarryLu
Member
Registered: 2017-07-28
Posts: 1

Re: QEMU: how to enable Virgl in arch guest?

Hi,
Not working: qemu-system-x86_64 -device virtio-vga,virgl=on -display gtk,gl=on ...
Working for me: qemu-system-x86_64 -device virtio-gpu-pci,virgl=on -display gtk,gl=on ...

Offline

Board footer

Powered by FluxBB