To run ignition-gazebo with accelerated 3D graphics on an Ubuntu VMware guest
you need to set the Mesa environment variables that disable some of the OpenGL
extensions.
The following applies to a macOS Big Sur 11.4 host (AMD Radeon Pro W5700X 16GB) with
an Ubuntu 20.04.2.0 guest on VMware. You may need to experiment with the choice of
valid extensions depending upon the OpenGL support of your GPU.
Set up a script you can source containing these environment variables or add them to your
.bashrc:
# set_mesa_env
# Configure the Mesa Environment
# https://docs.mesa3d.org/envvars.html
# Core Mesa environment variables
export MESA_DEBUG=1
export MESA_GL_VERSION_OVERRIDE=4.1
export MESA_GLSL_VERSION_OVERRIDE=410
export MESA_EXTENSION_OVERRIDE="\
-GL_ARB_buffer_storage \
-GL_ARB_multi_draw_indirect \
-GL_ARB_texture_buffer_range \
-GL_ARB_compute_shader \
-GL_ARB_ES3_compatibility \
"
Then source them:
source set_mesa_env
Additional debug info can be obtained by setting the LIBGL_*
and GALLIUM_HUD
environment variables:
# LibGL environment variables
export LIBGL_DEBUG=verbose
export LIBGL_ALWAYS_INDIRECT=false
export LIBGL_ALWAYS_SOFTWARE=false
export LIBGL_NO_DRAWARRAYS=false
export LIBGL_SHOW_FPS=false
export LIBGL_DRI2_DISABLE=false
export LIBGL_DRI3_DISABLE=false
# Gallium environment variables
export GALLIUM_HUD="simple,\
fps\
+frametime\
+cpu\
+cpu0\
+cpu1\
+cpu2\
+cpu3\
+samples-passed\
+primitives-generated\
+num-draw-calls\
+nic-rx-ens33\
+nic-tx-ens33\
+num-fallbacks\
+num-flushes\
+num-validations\
+map-buffer-time\
+num-buffers-mapped\
+num-textures-mapped\
+num-bytes-uploaded\
+num-command-buffers\
+command-buffer-size\
+flush-time\
+surface-write-flushes\
+num-readbacks\
+num-resource-updates\
+num-buffer-uploads\
+num-const-buf-updates\
+num-const-updates\
+num-shader-relocations\
+num-surface-relocations\
+memory-used\
+num-shaders\
+num-resources\
+num-state-objects\
+num-surface-views\
+num-generate-mipmap\
+num-failed-allocations\
+num-commands-per-draw\
+shader-mem-used\
"
Setting LIBGL_ALWAYS_SOFTWARE=true
is an alternative to unsetting Accerated 3D Graphics
in the virtual machine settings if you want run ignition gazebo using software OpenGL.
Running the shapes.sdf
example:
ign gazebo -v 4 shapes.sdf
PBS materials are supported: this using the panda_world
from Ignition Fuel: Panda joint control world
ign gazebo -v 4 panda_world.sdf
If you build ignition-edifice from source you can test using the ign-rendering
examples: simple_demo
will run with either ogre
or ogre2
as a render engine. The ogre2demo
illustrates that there is still something not quite right with the OpenGL settings. It will render if you reduce the number of spot lights to a 3 x 2 grid, but fails to render correctly with a 3 x 3 grid. I'm still chasing down why that is, but any suggestions welcomed.