OpenGL Rendering Issues with Ignition Gazebo in Docker on Mac Monterey

128 Views Asked by At

Environment:

  • Host OS: macOS Monterey v12.6
  • Graphics: Intel UHD Graphics 630 (1536 MB)
  • Docker OS/Kernel: Linux 130ae26988e4 (6.5.11-linuxkit)
  • Display: Using XQuartz for X11 forwarding

Issue: Running ROS 2 Iron in a Docker container works fine until attempting to use Ignition Gazebo (Fortress version) with a test project. The following errors are encountered when running

ign gazebo building_robot.sdf

root@130ae26988e4:/# ign gazebo building_robot.sdf

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'

libGL error: No matching fbConfigs or visuals found

libGL error: failed to load driver: swrast

[GUI] [Err] [Application.cc:801] [QT] Failed to create OpenGL context for format QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::NoProfile)

... [stack trace continues] ...

if i try same with ros2 testing node

ros2 run turtlesim turtlesim_node

it will work, i will see desplayed turtle (so it seems problem with Gazebo), but some errors still persist: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root' libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast

  • I ensured XQuartz is correctly installed and configured
  • I checked Docker container's access to host's X server

Questions:

  1. Are there known compatibility issues between Ignition Gazebo and macOS's graphic system?

  2. How can the libGL errors be resolved to enable proper rendering in Ignition Gazebo within a Docker container?

  3. Are additional configuration steps required for Docker or XQuartz to handle OpenGL rendering for Ignition Gazebo?

Any insights or suggestions would be greatly appreciated!

1

There are 1 best solutions below

0
Виталий Аллахвердянц On

Currently, gazebo fortress dont work with mac graphics setup, (nor from the docker container, nor from the actual host) issue: https://github.com/gazebosim/gz-sim/issues/44 As far as I can see source of the problem openGL interaction.

If you still want to use Gazebo on mac, you can install older version (gazebo classic): https://classic.gazebosim.org/tutorials?cat=install&tut=install_on_mac or try VM setup.

UPD (goto for me, my computer cannot work long with VM, start heating up): use robostack https://robostack.github.io/GettingStarted.html#__tabbed_1_1 OS agnostic decision.