Qemu [drm] virgl 3d acceleration

Refer to 

https://www.linux.com/training-tutorials/gpu-virtualization-update/

https://www.collabora.com/news-and-blog/blog/2018/02/12/virtualizing-gpu-access/

https://czak.pl/2020/04/09/three-levels-of-qemu-graphics.html

https://at.projects.genivi.org/wiki/display/GDP/QEMU+with+hardware+graphics+acceleration

 

OpenGL 4.3/Video card 

Release date: August 6, 2012

Virgil 3D/virglrenderer

  • Kernel Linux 4.2 contains the modesetting only drivers. Linux 4.4 contains the 3D supported pieces.

  • Mesa Mesa master contains the virgl 3D driver.

  • QEMU QEMU 2.4 contained the initial virtio-gpu with no acceleration support. QEMU 2.5 contains 3D support only with the GTK3 frontend with GL enabled.   Needs SDL2/OpenGL ES 3.0

  • virglrenderer The virglrenderer library seems mostly API stable. <-- Depends on OpenGL 3.0

Test 

 

Host  4.4.19 Linux  X86_64 with qemu5  with Intel UHD 620
Guest fc24/kernel 4.5.5  Live ISO

 

[liveuser@10 ~]$ uname -a 
Linux 10.0.2.15 4.5.5-300.fc24.x86_64 #1 SMP Thu May 19 13:05:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux


1. gl=es    fail

sudo   qemu-system-x86_64   -cpu host  -m 4096M   -cdrom  /media/root/LAKE/Fedora-Workstation-Live-x86_64-24-1.2.iso    -net nic,model=virtio   -enable-kvm    -vga virtio   -display sdl,gl=es    -net user  -serial `tty`
gl_version 32 - core profile enabled
                                    WARNING: running without ARB robustness in place may crash
                                                                                              No provider of glDrawBuffer found.  Requires one of:
                                                                                                                                                      Desktop OpenGL 1.0
                                                                                                                                                                        Aborted
2. gl=on 


root@lake-Latitude-5400:~# 
root@lake-Latitude-5400:~# 
root@lake-Latitude-5400:~# sudo   qemu-system-x86_64   -cpu host  -m 4096M   -cdrom  /media/root/LAKE/Fedora-Workstation-Live-x86_64-24-1.2.iso    -net nic,model=virtio   -enable-kvm    -vga virtio   -display sdl,gl=on    -net user  -serial `tty`
 .....................
 
[liveuser@10 ~]$ xdriinfo 
Screen 0: virtio_gpu =====>  qemu/ gl=off  ==>  Screen 0: not direct rendering capable.

[liveuser@10 ~]$ glxgears 
Running synchronized to the vertical refresh.  The framerate should be
approximately the same as the monitor refresh rate.
13763 frames in 5.0 seconds = 2751.700 FPS =====>   gl=off , will decrease to half value 
XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
      after 19218 requests (80 known processed) with 0 events remaining.
[liveuser@10 ~]$ 

[liveuser@10 ~]$ glxinfo |grep rend
direct rendering: Yes
    GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer, 
    GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer, 
Extended renderer info (GLX_MESA_query_renderer):
OpenGL renderer string: Gallium 0.4 on virgl
    GL_MESA_texture_signed_rgba, GL_NV_conditional_render, GL_NV_depth_clamp, 
    GL_NV_conditional_render, GL_NV_depth_clamp, GL_NV_fog_distance, 
    GL_OES_element_index_uint, GL_OES_fbo_render_mipmap, 
[liveuser@10 ~]$ dmesg  |grep drm 
[    6.021248] [drm] Initialized drm 1.1.0 20060810
[    6.085652] [drm] pci: virtio-vga detected
[    6.085853] [drm] virgl 3d acceleration enabled
[    6.086166] [drm] virtio vbuffers: 272 bufs, 192B each, 51kB total.
[    6.089463] [drm] number of scanouts: 1
[    6.089466] [drm] number of cap sets: 1
[    6.094637] [drm] cap set 0: id 1, max-version 1, max-size 308
[    6.111151] virtio_gpu virtio0: fb0: virtiodrmfb frame buffer device
[    6.111286] [drm] Initialized virtio_gpu 0.0.1 0 on minor 0


[liveuser@10 ~]$ ls -l /dev/dri/
total 0
crw-rw----+ 1 root video 226,   0 Jun 10 07:45 card0
crw-------. 1 root video 226,  64 Jun 10  2021 controlD64
crw-rw----+ 1 root video 226, 128 Jun 10  2021 renderD128
[liveuser@10 ~]$ ls -l /dev/f
fb0   fd/   full  fuse  
[liveuser@10 ~]$ ls -l /dev/fb0 
crw-rw----. 1 root video 29, 0 Jun 10  2021 /dev/fb0

[liveuser@10 ~]$ glxinfo |grep rend
direct rendering: Yes
    GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer, 
    GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer, 
Extended renderer info (GLX_MESA_query_renderer):
OpenGL renderer string: Gallium 0.4 on virgl
    GL_MESA_texture_signed_rgba, GL_NV_conditional_render, GL_NV_depth_clamp, 
    GL_NV_conditional_render, GL_NV_depth_clamp, GL_NV_fog_distance, 
    GL_OES_element_index_uint, GL_OES_fbo_render_mipmap, 

Attention!!

Inside Guest/Fedora 24 system live ISO


[liveuser@10 ~]$ xdriinfo 
Screen 0: virtio_gpu =====>  qemu/ gl=off  ==>  Screen 0: not direct rendering capable.

[liveuser@10 ~]$ glxgears 
Running synchronized to the vertical refresh.  The framerate should be
approximately the same as the monitor refresh rate.
13763 frames in 5.0 seconds = 2751.700 FPS =====>   gl=off , will decrease to half value, about 1200~1300 FPS
XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
      after 19218 requests (80 known processed) with 0 events remaining.
[liveuser@10 ~]$ 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值