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
- Compute shaders leveraging GPU parallelism within the context of the graphics pipeline
- Shader storage buffer objects, allowing shaders to read and write buffer objects like image load/store from 4.2, but through the language rather than function calls.
- Image format parameter queries
- ETC2/EAC texture compression as a standard feature
- Full compatibility with OpenGL ES 3.0 APIs
- MESA >10.3 for llvm software render(https://people.freedesktop.org/~imirkin/glxinfo/#diff&b=version&g=LLVMPipe)
llvmpipe
is OpenGL software operations driver.
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 ~]$