Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gazebo won't connect to Mac XQuartz #167

Closed
dershow opened this issue Jun 29, 2018 · 4 comments
Closed

Gazebo won't connect to Mac XQuartz #167

dershow opened this issue Jun 29, 2018 · 4 comments

Comments

@dershow
Copy link

dershow commented Jun 29, 2018

I'm running the Gazebo docker on my mac. If I try to run the image, and set the display, I get errors. For example, if I run bash, in docker, and then run gazebo --verbose , I see XQuartz open (so it is trying to connect) and then I get this:

libGL error: libGL error: No matching fbConfigs or visuals found
No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
libGL error: failed to load driver: swrast
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  149 (GLX)
  Minor opcode of failed request:  3X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  149 (X_GLXCreateContext)
  Value in failed request:  0x0
   (GLX)
Serial number of failed request:  23
  Current serial number in output stream:  24
  Minor opcode of failed request:  3 (X_GLXCreateContext)
  Value in failed request:  0x0
  Serial number of failed request:  23
  Current serial number in output stream:  24

I've searched around, and it seems like this is an accelerated graphics driver issue, but I've not had any luck finding a fix. I know that it is possible to run docker images with gui on a mac, and I've gotten it to run successfully for a test firefox image.

Any suggestions or guidance on this?

@ruffsl
Copy link
Member

ruffsl commented Jun 29, 2018

I'm not sure how you started the container here, but perhaps it might be easier to first get a basic openGL application working first, like glgears or etc. Here is an example (using nvidia-docker though, so not straightly applicable): NVIDIA/nvidia-docker#136 (comment)

I don't know the best way support hardware acceleration for a linux kernel guest VM on a MacOS host (assuming your using Docker for Mac), and I'm not sure how well using the integrated graphics in the VM would work: http://wiki.ros.org/docker/Tutorials/Hardware%20Acceleration#Intel

Perhaps you could install gazebo client onto the Mac host and run it locally, pointing to the gzserver running in the docker container on the bridged linux VM, as alluded to in a previous issue: #55

Or perhaps you might have better luck running an Xserver in the same container and simply using VNC to display GUI and desktop remotely: https://github.com/fcwu/docker-ubuntu-vnc-desktop

@dershow
Copy link
Author

dershow commented Jun 29, 2018 via email

@drrosa
Copy link

drrosa commented Jul 18, 2018

@dershow
Hi Adam,

Here's a tool that helps build a docker image that just works: https://github.com/osrf/gzdev

It's an alpha version still in development, but as of now it can spawn Gazebo 7, 8, and 9 just fine on Mac, Linux, and perhaps even Windows but it has not been tested there yet.

It's most likely not going to run as fast as the homebrew install of Gazebo. Hardware accelerated OpenGL applications running on docker containers are not as performant on Mac systems. Docker needs to use a virtualization layer to run on Mac.

There's Docker Toolbox and Docker for Mac, btw. You are probably better off using Docker for Mac as it uses a thinner virtualization layer compared to Docker Toolbox which requires something like VirtualBox to be installed. Here's more info about it https://docs.docker.com/docker-for-mac/docker-toolbox/

So I'm not sure if this is going be a good solution for you, but I hope it helps! Feel free to create a new issue in the gzdev repo if you run into any problems.

—David

@ruffsl
Copy link
Member

ruffsl commented Jul 22, 2018

Hmm, the two methods for mac seem facilitate confusion. Here was my take home from the docs:

Docker for Mac uses HyperKit instead of Virtual Box. Hyperkit is a lightweight macOS virtualization solution built on top of Hypervisor.framework in macOS 10.10 Yosemite and higher.

https://docs.docker.com/docker-for-mac/docker-toolbox/#the-docker-for-mac-environment

It's most likely not going to run as fast as the homebrew install of Gazebo. Hardware accelerated OpenGL applications running on docker containers are not as performant on Mac systems. Docker needs to use a virtualization layer to run on Mac.

This seems unavoidable unless one creates a PCI hardware passthrough for the VM, which I am unsure about for a mac hosts. Nevertheless, it seems gzdev will be valuable solution.

Another solution could be to use gzweb, like images we build here. If you have docker related issues using those images, feel free to make a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants