在 Mac 上从容器中运行 GUI 导致 "libGL 错误:未找到匹配的 fbConfigs 或 visuals"。

15

我正在尝试从我的 Mac 运行一个基于 ubuntu:15.10 的容器。

我运行了以下命令:

docker run -i -v /tmp/.X11-unix:/tmp/. -e DISPLAY=192.168.0.104:0 --privileged mycompany/mycontainer

IP地址是通过ifconfig命令从我的en0网卡获取的。

我遇到了以下错误:

libGL error: No matching fbConfigs or visuals found
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:  24 (X_GLXCreateNewContext)
  Value in failed request:  0x0
  Serial number of failed request:  25
  Current serial number in output stream:  26

这个容器在另一个团队成员的Ubuntu操作系统上运行没有任何问题。

有什么想法是什么导致了这个错误吗?

3个回答

1
如果您的容器正在尝试运行Chrome脚本,则可以使用Chrome的SwiftShader软件渲染器-它与XQuartz 2.7.11兼容。
chromium-browser --use-gl=swiftshader

0

我在MacOS中的Docker容器中运行SUMO模拟GUI时遇到了同样的问题。

作为临时解决方案或解决方法,对我有效的是将XQuartz版本降级至2.7.8,正如https://bugs.freedesktop.org/show_bug.cgi?id=96433中所建议的那样。

我仍然会收到错误提示,但GUI确实可以工作。


0

我已将Xquartz降级到2.7.8版本,但我的应用程序打开后只显示黑色窗口并立即关闭。此容器的日志中也包含相同的问题:

libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
...
QOpenGLShaderProgram: could not create shader program
QOpenGLShader: could not create shader
QOpenGLShader: could not create shader
shader compilation failed:
QOpenGLShaderProgram::uniformLocation(matrix): shader program is not linked
QOpenGLShaderProgram::uniformLocation(opacity): shader program is not linked
QOpenGLShaderProgram: could not create shader program
QOpenGLShader: could not create shader
QOpenGLShader: could not create shader
shader compilation failed: 
""
QOpenGLShaderProgram::uniformLocation(qt_Matrix): shader program is not linked
QOpenGLShaderProgram: could not create shader program
QOpenGLShader: could not create shader
QOpenGLShader: could not create shader
shader compilation failed: 
""
QOpenGLShaderProgram::uniformLocation(matrix): shader program is not linked
QOpenGLShaderProgram::uniformLocation(opacity): shader program is not linked
QOpenGLShaderProgram: could not create shader program
QOpenGLShader: could not create shader
QOpenGLShader: could not create shader
shader compilation failed: 
""
QOpenGLShaderProgram::uniformLocation(qt_Matrix): shader program is not linked

如果您有相关问题,请留下评论而不是答案;如果您认为可以添加更多信息,请发送一个新的答案,链接原始内容并添加您的信息。 - wolmi

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接