canonical / multipass

Multipass orchestrates virtual Ubuntu instances
https://multipass.run
GNU General Public License v3.0
7.67k stars 637 forks source link

ROS2 GUI on macOS #3113

Open imstevenpmwork opened 1 year ago

imstevenpmwork commented 1 year ago

Describe the bug When trying to launch rviz2 or ign gazebo in the humble vm I get a segmentation fault

To Reproduce Fresh install of Multipass on MacOS with the humble blueprint. Connect via ssh -X to the vm and launch the command

Expected behavior rviz2 and gin gazebo gui to appear

Logs

Additional info

Additional context I was following this canonical blog: blog + installing xquartz I tried also to follow these other two blog posts related to how to set up the GUI on MacOS for Multipass, but none of them made any difference: blog 2 , blog 3 Both Firefox and xeyes GUI work.

When running rviz2:

[ERROR] [1686066097.256930170] [rviz2]: Failed to create an OpenGL context. BadValue (integer parameter out of range for operation)
[ERROR] [1686066097.256940961] [rviz2]: RenderingAPIException: Unable to create a suitable GLXContext in GLXContext::GLXContext at ./.obj-aarch64-linux-gnu/ogre-v1.12.1-prefix/src/ogre-v1.12.1/RenderSystems/GLSupport/src/GLX/OgreGLXContext.cpp (line 60)
[ERROR] [1686066097.256952211] [rviz2]: rviz::RenderSystem: error creating render window: RenderingAPIException: Unable to create a suitable GLXContext in GLXContext::GLXContext at ./.obj-aarch64-linux-gnu/ogre-v1.12.1-prefix/src/ogre-v1.12.1/RenderSystems/GLSupport/src/GLX/OgreGLXContext.cpp (line 60)
[ERROR] [1686066097.256979795] [rviz2]: Unable to create the rendering window after 100 tries
terminate called after throwing an instance of 'std::runtime_error'
  what():  Unable to create the rendering window after 100 tries
Aborted (core dumped)

When running ign gazebo:

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 (most recent call last):
#31   Object "/lib/aarch64-linux-gnu/libruby-3.0.so.3.0", at 0xffff9acc5ab7, in rb_vm_exec
#30   Object "/lib/aarch64-linux-gnu/libruby-3.0.so.3.0", at 0xffff9acc088b, in
#29   Object "/lib/aarch64-linux-gnu/libruby-3.0.so.3.0", at 0xffff9acbdefb, in
#28   Object "/lib/aarch64-linux-gnu/libruby-3.0.so.3.0", at 0xffff9acbbef3, in
#27   Object "/usr/lib/aarch64-linux-gnu/ruby/3.0.0/fiddle.so", at 0xffff96d55d93, in
#26   Object "/lib/aarch64-linux-gnu/libruby-3.0.so.3.0", at 0xffff9ac88b13, in rb_nogvl
#25   Object "/usr/lib/aarch64-linux-gnu/ruby/3.0.0/fiddle.so", at 0xffff96d556cb, in
#24   Object "/lib/aarch64-linux-gnu/libffi.so.8", at 0xffff96d33a93, in
#23   Object "/lib/aarch64-linux-gnu/libffi.so.8", at 0xffff96d36e0f, in
#22   Object "/usr/lib/aarch64-linux-gnu/libignition-gazebo6-ign.so.6.11.0", at 0xffff96241fcf, in runGui
#21   Object "/lib/aarch64-linux-gnu/libignition-gazebo6-gui.so.6", at 0xffff9607f453, in ignition::gazebo::v6::gui::runGui(int&, char**, char const*, char const*, int, char const*)
#20   Object "/lib/aarch64-linux-gnu/libignition-gazebo6-gui.so.6", at 0xffff9607d3ef, in ignition::gazebo::v6::gui::createGui(int&, char**, char const*, char const*, bool, char const*, int, char const*)
#19   Object "/lib/aarch64-linux-gnu/libignition-gazebo6-gui.so.6", at 0xffff9607b11f, in ignition::gazebo::v6::gui::launchQuickStart(int&, char**, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
#18   Object "/lib/aarch64-linux-gnu/libQt5Core.so.5", at 0xffff939641cb, in QCoreApplication::exec()
#17   Object "/lib/aarch64-linux-gnu/libQt5Core.so.5", at 0xffff9395b06b, in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)
#16   Object "/lib/aarch64-linux-gnu/libQt5Core.so.5", at 0xffff939bb523, in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
#15   Object "/lib/aarch64-linux-gnu/libglib-2.0.so.0", at 0xffff927f2f13, in g_main_context_iteration
#14   Object "/lib/aarch64-linux-gnu/libglib-2.0.so.0", at 0xffff9284a76b, in
#13   Object "/lib/aarch64-linux-gnu/libglib-2.0.so.0", at 0xffff927f5a6f, in g_main_context_dispatch
#12   Object "/lib/aarch64-linux-gnu/libQt5XcbQpa.so.5", at 0xffff87ebf267, in
#11   Object "/lib/aarch64-linux-gnu/libQt5Gui.so.5", at 0xffff93d09393, in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>)
#10   Object "/lib/aarch64-linux-gnu/libQt5Gui.so.5", at 0xffff93d32dfb, in QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent*)
#9    Object "/lib/aarch64-linux-gnu/libQt5Core.so.5", at 0xffff9395cb8f, in QCoreApplication::notifyInternal2(QObject*, QEvent*)
#8    Object "/lib/aarch64-linux-gnu/libQt5Widgets.so.5", at 0xffff94e02abf, in QApplicationPrivate::notify_helper(QObject*, QEvent*)
#7    Object "/lib/aarch64-linux-gnu/libQt5Gui.so.5", at 0xffff93d3e5f3, in QWindow::event(QEvent*)
#6    Object "/lib/aarch64-linux-gnu/libQt5Quick.so.5", at 0xffff9490bb57, in
#5    Object "/lib/aarch64-linux-gnu/libQt5Quick.so.5", at 0xffff9490a5b3, in
#4    Object "/lib/aarch64-linux-gnu/libQt5Quick.so.5", at 0xffff9490903b, in QSGRenderLoop::handleContextCreationFailure(QQuickWindow*)
#3    Object "/lib/aarch64-linux-gnu/libQt5Core.so.5", at 0xffff93750f63, in QMessageLogger::fatal(char const*, ...) const
#2    Object "/lib/aarch64-linux-gnu/libc.so.6", at 0xffff9a91712f, in abort
#1    Object "/lib/aarch64-linux-gnu/libc.so.6", at 0xffff9a92a67b, in raise
#0    Object "/lib/aarch64-linux-gnu/libc.so.6", at 0xffff9a96f200, in
Aborted (Signal sent by tkill() 6194 1000)
Escalating to SIGKILL on [Ignition Gazebo Server]
luis4a0 commented 1 year ago

Hi @imstevenpmwork, thanks for reporting. I reproduced the bug and will come up shortly with an answer.

luis4a0 commented 1 year ago

Hi @imstevenpmwork. Unfortunately, I couldn't make it work on the M1. This is surprising because Xquartz claims it supports GL on the M1. I will inform the ROS team about this so they can update the blog post. Sorry for the inconvenience.

tomkimsour commented 7 months ago

How has this issue evolved ? I am facing the same issue as of today

Tobias-Fischer commented 4 months ago

You might be interested in https://robostack.github.io/index.html