通过 Docker 首次启动可视化工具时出现 Drake libGL 错误

Drake libGL error when starting visualizer for the first time through Docker

我是 运行 全新安装的 Ubuntu 18.04。我将我的 NVIDIA 驱动程序降级到 390.129(尽管说明只提到在安装支持 CUDA 的 Drake 时,我没有这样做)。

我已经安装 Docker 并使用说明 here 构建了 Drake(没有 NVIDIA 支持)。 docker build --file setup/ubuntu/docker/bionic/Dockerfile --tag drake . 有效,docker run --interactive --tty drake bash 启动没有任何问题。

当我尝试使用 xhost +local:root; docker run --env=DISPLAY --env=QT_X11_NO_MITSHM=1 --interactive --ipc=host --privileged --tty --volume=/tmp/.X11-unix:/tmp/.X11-unix:rw drake; xhost -local:root; 通过 GUI 启动 Drake 时,出现此错误:

non-network local connections being added to access control list
+ [[ 0 -eq 0 ]]
+ bazel build //tools:drake_visualizer //examples/acrobot:run_passive
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
INFO: Analyzed 2 targets (100 packages loaded, 20684 targets configured).
INFO: Found 2 targets...
INFO: Elapsed time: 169.872s, Critical Path: 59.75s
INFO: 536 processes: 536 linux-sandbox.
INFO: Build completed successfully, 799 total actions
+ sleep 2
+ ./bazel-bin/tools/drake_visualizer
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast

Drake Scripts:
  Specified: --use_builtin_scripts=all
  Available: --use_builtin_scripts=frame,hydroelastic_contact,image,point_pair_contact,time

Hydroelastic Contact Visualizer subscriber added.
DrakeLcmImageViewer: Defer setup until 'DRAKE_RGBD_CAMERA_IMAGES' is received
Contact Visualizer subscriber added.
QOpenGLWindow::beginPaint: Failed to create context
QOpenGLWindow::beginPaint: Failed to make context current
ERROR: In /vtk/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, line 741
vtkGenericOpenGLRenderWindow (0x55a0b9a5ac60): GLEW could not be initialized: Missing GL version

QOpenGLFunctions created with non-current context
./setup/ubuntu/docker/entrypoint.sh: line 15:  3175 Segmentation fault      (core dumped) ./bazel-bin/tools/drake_visualizer
+ bazel run //examples/acrobot:run_passive
INFO: Analyzed target //examples/acrobot:run_passive (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //examples/acrobot:run_passive up-to-date:
  bazel-bin/examples/acrobot/run_passive
INFO: Elapsed time: 0.444s, Critical Path: 0.00s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action
non-network local connections being removed from access control list

知道问题出在哪里吗?我是否也必须在容器中安装我的 NVIDIA 驱动程序?谢谢。

我可以在我的系统上确认相同的行为:

$ docker pull robotlocomotion/drake:latest
latest: Pulling from robotlocomotion/drake
Digest: sha256:17aa147cc215cb91326facae696720de15fdfe439a22a4ecf1bf79ca524a7d63
Status: Image is up to date for robotlocomotion/drake:latest
docker.io/robotlocomotion/drake:latest

$ (
xhost +local:root;
docker run \
  --env=DISPLAY \
  --env=QT_X11_NO_MITSHM=1 \
  --interactive \
  --privileged \
  --tty \
  --volume=/tmp/.X11-unix:/tmp/.X11-unix:rw \
  --rm \
  robotlocomotion/drake:latest \
  /opt/drake/bin/drake-visualizer
xhost -local:root
)

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
QOpenGLWindow::beginPaint: Failed to create context
QOpenGLWindow::beginPaint: Failed to make context current
ERROR: In /vtk/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, line 741
vtkGenericOpenGLRenderWindow (0x55b45ac8b730): GLEW could not be initialized: Missing GL version

QOpenGLFunctions created with non-current context

将 post 一个 Drake 问题并用它更新此 post。 感谢您报告此事!

编辑:德雷克问题:https://github.com/RobotLocomotion/drake/issues/12483