| | 1 | [[PageOutline]] |
| | 2 | |
| | 3 | = virtio-gpu = |
| | 4 | * [https://virgil3d.github.io/ Virgil 3D GPU project by virgil3d] |
| | 5 | |
| | 6 | * [https://www.phoronix.com/scan.php?page=news_item&px=Virt-Manager-1.4-Released Virt-Manager 1.4 Exposes The New OpenGL Options - Phoronix] |
| | 7 | * [https://www.kraxel.org/blog/2016/09/using-virtio-gpu-with-libvirt-and-spice/ Using virtio-gpu with libvirt and spice | kraxel's news] |
| | 8 | |
| | 9 | == QXL vs virtio-vga == |
| | 10 | * 結論から言うと、SPICEが未対応のためvirt-manager下では3D accelerationを有効にできない |
| | 11 | * https://wiki.archlinux.org/index.php/QEMU#virtio {{{virtio-vga}}} / {{{virtio-gpu}}} is a paravirtual 3D graphics driver based on [https://virgil3d.github.io/ virgl]. |
| | 12 | > As of September 2016, support for the spice protocol is under development and can be tested installing the development release of spice (>= 0.13.2). |
| | 13 | |
| | 14 | * H/W: wiki:TipAndDoc/Hardware#ASUSH97M-PLUS |
| | 15 | * S/W |
| | 16 | * ArchLinux 4.7.6-1 |
| | 17 | * qemu 2.7.0-2 |
| | 18 | * seabios 1.9.3-1 |
| | 19 | * libvirt 2.3.0-1 |
| | 20 | * spice 0.12.8-1 |
| | 21 | * virt-manager 1.4.0-2 |
| | 22 | |
| | 23 | === QXL === |
| | 24 | * mitty@guest:~$ lspci |
| | 25 | {{{ |
| | 26 | 00:02.0 VGA compatible controller: Red Hat, Inc. QXL paravirtual graphic card (rev 04) |
| | 27 | }}} |
| | 28 | * mitty@guest:~$ dmesg | grep drm |
| | 29 | {{{ |
| | 30 | [ 1.057734] [drm] Initialized drm 1.1.0 20060810 |
| | 31 | [ 1.110306] [drm] Device Version 0.0 |
| | 32 | [ 1.110308] [drm] Compression level 0 log level 0 |
| | 33 | [ 1.110309] [drm] Currently using mode #0, list at 0x488 |
| | 34 | [ 1.110309] [drm] 12286 io pages at offset 0x1000000 |
| | 35 | [ 1.110310] [drm] 16777216 byte draw area at offset 0x0 |
| | 36 | [ 1.110310] [drm] RAM header offset: 0x3ffe000 |
| | 37 | [ 1.110311] [drm] rom modes offset 0x488 for 128 modes |
| | 38 | [ 1.110364] [drm] qxl: 16M of VRAM memory size |
| | 39 | [ 1.110364] [drm] qxl: 63M of IO pages memory ready (VRAM domain) |
| | 40 | [ 1.110365] [drm] qxl: 64M of Surface memory size |
| | 41 | [ 1.112882] [drm] main mem slot 1 [f4000000,3ffe000] |
| | 42 | [ 1.112884] [drm] surface mem slot 2 [f8000000,4000000] |
| | 43 | [ 1.113677] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013). |
| | 44 | [ 1.113679] [drm] No driver support for vblank timestamp query. |
| | 45 | [ 1.113891] [drm] fb mappable at 0xF4000000, size 3145728 |
| | 46 | [ 1.113891] [drm] fb: depth 24, pitch 4096, width 1024, height 768 |
| | 47 | [ 1.113892] fb: switching to qxldrmfb from VESA VGA |
| | 48 | [ 1.115537] fbcon: qxldrmfb (fb0) is primary device |
| | 49 | [ 1.116425] [drm:qxl_enc_commit [qxl]] *ERROR* head number too large or missing monitors config: ffffc90000748000, 0 |
| | 50 | [ 1.118767] qxl 0000:00:02.0: fb0: qxldrmfb frame buffer device |
| | 51 | [ 1.136842] [drm] Initialized qxl 0.1.0 20120117 for 0000:00:02.0 on minor 0 |
| | 52 | }}} |
| | 53 | |
| | 54 | * minecraftは一応動いた[[br]][[Image(QXL-minecraft.png)]] |
| | 55 | |
| | 56 | === virtio-vga (no 3D) === |
| | 57 | * mitty@guest:~$ lspci |
| | 58 | {{{ |
| | 59 | 00:02.0 VGA compatible controller: Red Hat, Inc Virtio GPU (rev 01) |
| | 60 | }}} |
| | 61 | * mitty@guest:~$ dmesg | grep drm |
| | 62 | {{{ |
| | 63 | [ 0.690401] [drm] Initialized drm 1.1.0 20060810 |
| | 64 | [ 0.714409] [drm] pci: virtio-vga detected |
| | 65 | [ 0.714412] fb: switching to virtiodrmfb from VESA VGA |
| | 66 | [ 0.714786] [drm] virgl 3d acceleration not available |
| | 67 | [ 0.715117] [drm] virtio vbuffers: 80 bufs, 192B each, 15kB total. |
| | 68 | [ 0.715164] [drm] number of scanouts: 1 |
| | 69 | [ 0.715177] [drm] number of cap sets: 0 |
| | 70 | [ 0.717593] virtio_gpu virtio0: fb0: virtiodrmfb frame buffer device |
| | 71 | [ 0.726158] [drm] Initialized virtio_gpu 0.0.1 0 on minor 0 |
| | 72 | }}} |
| | 73 | |
| | 74 | * 3Dが有効にならない場合、QXLとほぼ変わらない[[br]][[Image(virgil_no3d-minecraft.png)]] |
| | 75 | |
| | 76 | ==== errors ==== |
| | 77 | * [https://www.kraxel.org/blog/2015/10/virtio-gpu-and-libvirt/ virtio-gpu and libvirt | kraxel's news] こちらを参考に、virsh editで直接編集してみたが、起動に失敗する |
| | 78 | |
| | 79 | 1. mitty@host:~$ diff -u virgil.orig.xml virgil.gl.xml |
| | 80 | {{{#!diff |
| | 81 | --- virgil.orig.xml 2016-10-08 20:47:22.762150999 +0900 |
| | 82 | +++ virgil.gl.xml 2016-10-08 20:49:14.199368411 +0900 |
| | 83 | @@ -87,6 +87,7 @@ |
| | 84 | <graphics type='spice' autoport='yes' listen='0.0.0.0'> |
| | 85 | <listen type='address' address='0.0.0.0'/> |
| | 86 | <image compression='off'/> |
| | 87 | + <gl enable='yes'/> |
| | 88 | </graphics> |
| | 89 | <sound model='ich6'> |
| | 90 | <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> |
| | 91 | }}} |
| | 92 | * mitty@host:~$ virsh start virgil |
| | 93 | {{{ |
| | 94 | error: Failed to start domain virgil |
| | 95 | error: unsupported configuration: This QEMU doesn't support spice OpenGL |
| | 96 | }}} |
| | 97 | 2. mitty@host:~$ diff -u virgil.orig.xml virgil.gl.xml |
| | 98 | {{{#!diff |
| | 99 | --- virgil.orig.xml 2016-10-08 20:47:22.762150999 +0900 |
| | 100 | +++ virgil.gl.xml 2016-10-09 00:12:45.044761666 +0900 |
| | 101 | @@ -1,4 +1,4 @@ |
| | 102 | -<domain type='kvm'> |
| | 103 | +<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'> |
| | 104 | <name>virgil</name> |
| | 105 | <uuid>afd14745-a9f3-44ea-b2da-e2eefabea22b</uuid> |
| | 106 | <memory unit='KiB'>4194304</memory> |
| | 107 | @@ -84,10 +84,7 @@ |
| | 108 | </channel> |
| | 109 | <input type='mouse' bus='ps2'/> |
| | 110 | <input type='keyboard' bus='ps2'/> |
| | 111 | - <graphics type='spice' autoport='yes' listen='0.0.0.0'> |
| | 112 | - <listen type='address' address='0.0.0.0'/> |
| | 113 | - <image compression='off'/> |
| | 114 | - </graphics> |
| | 115 | + <graphics type='sdl' display=':0' xauth='/home/mitty/.Xauthority'/> |
| | 116 | <sound model='ich6'> |
| | 117 | <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> |
| | 118 | </sound> |
| | 119 | @@ -105,5 +102,11 @@ |
| | 120 | <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/> |
| | 121 | </memballoon> |
| | 122 | </devices> |
| | 123 | + <qemu:commandline> |
| | 124 | + <qemu:arg value='-set'/> |
| | 125 | + <qemu:arg value='device.video0.driver=virtio-vga'/> |
| | 126 | + <qemu:arg value='-display'/> |
| | 127 | + <qemu:arg value='gtk,gl=on'/> |
| | 128 | + </qemu:commandline> |
| | 129 | </domain> |
| | 130 | }}} |
| | 131 | * mitty@host:~$ virsh start virgil |
| | 132 | {{{ |
| | 133 | error: Failed to start domain virgil |
| | 134 | error: internal error: process exited while connecting to monitor: Unable to init server: Could not connect: Connection refused |
| | 135 | 2016-10-08T15:12:30.027297Z qemu-system-x86_64: OpenGL is not supported by the display |
| | 136 | }}} |
| | 137 | * ホスト上でXを動かせば良さそう |