I had a look at this again this morning and cracked it. More info below.
The above are as they should be. When building qemu it is important to set
USE="virgl". This is how mine was built:
[ebuild R ] app-emulation/qemu-2.9.0-r2::gentoo USE="aio alsa bluetooth
bzip2 caps curl fdt filecaps gtk gtk2 jpeg ncurses nls opengl pin-upstream-
blobs png pulseaudio sdl sdl2 seccomp usb vhost-net virgl virtfs vnc xattr -
accessibility -debug (-glusterfs) -gnutls -infiniband -iscsi -lzo -nfs -numa -
python -rbd -sasl (-selinux) -smartcard -snappy -spice -ssh -static -static-
user -systemtap -tci {-test} -usbredir -vde -vte -xen -xfs" LINGUAS="-bg -
de_DE -fr_FR -hu -it -tr -zh_CN" PYTHON_TARGETS="python2_7"
QEMU_SOFTMMU_TARGETS="x86_64 -aarch64 -alpha -arm -cris -i386 -lm32 -m68k -
microblaze -microblazeel -mips -mips64 -mips64el -mipsel -moxie -nios2 -or1k -
ppc -ppc64 -ppcemb -s390x -sh4 -sh4eb -sparc -sparc64 -tricore -unicore32 -
xtensa -xtensaeb" QEMU_USER_TARGETS="-aarch64 -alpha -arm -armeb -cris -hppa -
i386 -m68k -microblaze -microblazeel -mips -mips64 -mips64el -mipsel -mipsn32
-mipsn32el -nios2 -or1k -ppc -ppc64 -ppc64abi32 -ppc64le -s390x -sh4 -sh4eb -
sparc -sparc32plus -sparc64 -tilegx -x86_64*" 0 KiB
Thereafter, the trick in getting hardware acceleration in the guest is to set
'-vga virtio' when launching the guest VM with qemu:
$ qemu-system-x86_64 -m 1024 -enable-kvm -display sdl,gl=on -vga virtio -drive
if=virtio,file=Mint_18.2_HDA.qcow2,cache=none
gl_version 33 - core profile enabled
As you can see it returns 'gl_version 33 - core profile enabled' on the
terminal. When I login the guest's desktop no longer warns that there will be
no hardware acceleration. :-)
This is what the guest shows:
$ dmesg | grep -i drm
[ 1.413078] [drm] Initialized drm 1.1.0 20060810
[ 1.488900] [drm] pci: virtio-vga detected
[ 1.488903] fb: switching to virtiodrmfb from VESA VGA
[ 1.490827] [drm] virgl 3d acceleration enabled <==virgl being used
[ 1.491401] [drm] virtio vbuffers: 272 bufs, 192B each, 51kB total.
[ 1.494571] [drm] number of scanouts: 1
[ 1.494577] [drm] number of cap sets: 1
[ 1.504333] [drm] cap set 0: id 1, max-version 1, max-size 308
[ 1.505633] virtio_gpu virtio0: fb0: virtiodrmfb frame buffer device
[ 1.505638] [drm] Initialized virtio_gpu 0.0.1 0 on minor 0
$glxinfo
name of display: :0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
GLX_ARB_create_context, GLX_ARB_create_context_profile,
GLX_ARB_fbconfig_float, GLX_ARB_framebuffer_sRGB, GLX_ARB_multisample,
GLX_EXT_create_context_es2_profile, GLX_EXT_create_context_es_profile,
GLX_EXT_fbconfig_packed_float, GLX_EXT_framebuffer_sRGB,
GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info,
GLX_EXT_visual_rating, GLX_INTEL_swap_event, GLX_MESA_copy_sub_buffer,
GLX_OML_swap_method, GLX_SGIS_multisample, GLX_SGIX_fbconfig,
GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group, GLX_SGI_swap_control
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
client glx extensions:
GLX_ARB_create_context, GLX_ARB_create_context_profile,
GLX_ARB_create_context_robustness, GLX_ARB_fbconfig_float,
GLX_ARB_framebuffer_sRGB, GLX_ARB_get_proc_address, GLX_ARB_multisample,
GLX_EXT_buffer_age, GLX_EXT_create_context_es2_profile,
GLX_EXT_create_context_es_profile, GLX_EXT_fbconfig_packed_float,
GLX_EXT_framebuffer_sRGB, GLX_EXT_import_context,
GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info, GLX_EXT_visual_rating,
GLX_INTEL_swap_event, GLX_MESA_copy_sub_buffer,
GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer,
GLX_MESA_swap_control, GLX_OML_swap_method, GLX_OML_sync_control,
GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
GLX_SGIX_visual_select_group, GLX_SGI_make_current_read,
GLX_SGI_swap_control, GLX_SGI_video_sync
GLX version: 1.4
GLX extensions:
GLX_ARB_create_context, GLX_ARB_create_context_profile,
GLX_ARB_fbconfig_float, GLX_ARB_framebuffer_sRGB,
GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_buffer_age,
GLX_EXT_create_context_es2_profile, GLX_EXT_create_context_es_profile,
GLX_EXT_fbconfig_packed_float, GLX_EXT_framebuffer_sRGB,
GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info,
GLX_EXT_visual_rating, GLX_INTEL_swap_event, GLX_MESA_copy_sub_buffer,
GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer,
GLX_MESA_swap_control, GLX_OML_swap_method, GLX_OML_sync_control,
GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
GLX_SGIX_visual_select_group, GLX_SGI_make_current_read,
GLX_SGI_swap_control, GLX_SGI_video_sync
Extended renderer info (GLX_MESA_query_renderer):
Vendor: Red Hat (0x1af4)
Device: virgl (0x1010)
Version: 12.0.6
Accelerated: yes
Video memory: 0MB
Unified memory: no
Preferred profile: core (0x1)
Max core profile version: 3.3
Max compat profile version: 3.0
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.0
OpenGL vendor string: Red Hat
OpenGL renderer string: Gallium 0.4 on virgl
OpenGL core profile version string: 3.3 (Core Profile) Mesa 12.0.6
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
I hope this helps others.
--
Regards,
Mick