14

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

我运行以下命令

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

(IP 取自我的 en0:inet using ifconfig)

我收到以下错误:

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 操作系统上运行,没有任何问题。

任何想法是什么导致了这个错误?

4

3 回答 3

1

如果您的容器尝试在脚本中运行 Chrome,那么您可以使用 Chrome 的SwiftShader软件渲染器 - 它适用于 XQuartz 2.7.11:

chromium-browser --use-gl=swiftshader
于 2020-02-25T14:19:17.117 回答
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
于 2019-08-01T14:50:03.650 回答
0

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

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

我仍然收到错误,但 GUI 确实有效。

于 2018-08-04T08:07:25.057 回答