Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

libGL error: failed to load driver: swrast - Running Ubuntu Docker container on Mac OS X host

Tags:

docker

I'm running a GUI application in a container in privileged mode on a MAX OS X host. I'be been successfully able to start the GUI in the container using this link: http://kartoza.com/en/blog/how-to-run-a-linux-gui-application-on-osx-using-docker/

Now within my GUI application, I'm trying to pop up another window and I get the following: Using Volk machine: avx_64_mmx_orc libGL error: failed to load driver: swrast

How do I go about solving this?

like image 895
VarsMolta Avatar asked Oct 17 '16 17:10

VarsMolta


2 Answers

Had the same issue trying to forward GUI from Ubuntu Server to my Mac.

On Ubuntu, installing the swrast driver for OpenGL rendering solved the issue -

sudo apt-get install -y mesa-utils libgl1-mesa-glx
like image 65
Avi Avidan Avatar answered Nov 16 '22 02:11

Avi Avidan


I'm not sure about Mac OSX as host but I've had the same error message. Here are the two steps that worked for me on Ubuntu 16.04 LTS:

  • install the same driver version in the container as you have it on the host
    • see: https://github.com/jessfraz/dockerfiles/issues/253#issuecomment-313995830
  • re-run the docker container with the parameters -v /tmp/.X11-unix:/tmp/.X11-unix:rw --privileged in order to make it able to use DRI

The essential part aside from the driver was actually the --privileged parameter.

That fixed the problem on my Ubuntu. Hope it helps.

like image 34
Hendrik Wiese Avatar answered Nov 16 '22 02:11

Hendrik Wiese