open3D error show in docker
I want to show pointcloud in docker, however ,there are errors report as below:
[Open3D WARNING] GLFW Error: X11: Failed to open display unix:1 [Open3D WARNING] Failed to initialize GLFW
make sure xhost is executed in host:
sudo xhost +
and check host $DISPLAY env. If $DISPLAY is unix:1 or :1, the $DISPLAY in docker should be set to unix:1
make sure xhost is executed in host:
sudo xhost +and check host
$DISPLAYenv. If$DISPLAYisunix:1or:1, the$DISPLAYin docker should be set tounix:1
My host $DISPLAY env is unix:1 and I run xhost + ,then I got another error below: libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast [Open3D WARNING] GLFW Error: GLX: Failed to create context: BadMatch (invalid parameter attributes) [Open3D WARNING] Failed to create window
Hi @fellenB your docker container needs access to the GPU for visualization to work. This is GPU specific:
- For Intel and AMD GPUs: http://wiki.ros.org/docker/Tutorials/Hardware%20Acceleration
- For NVIDIA GPUs: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html
I've some issue similar with that, and fixed by checking opengl library version with nvidia driver version.
For example, the nvidia-smi shows:
Fri Jan 14 18:15:14 2022
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.86 Driver Version: 470.86 CUDA Version: 11.4 |
|-------------------------------+----------------------+----------------------+
here the driver version is 470.86, so you need to install libnvidia-gl-470 with same minor version. This is apt searching result:
$ apt search libnvidia-gl-470
libnvidia-gl-465/focal-updates,focal-security 470.86-0ubuntu0.20.04.2 amd64
Transitional package for libnvidia-gl-470
libnvidia-gl-470/focal-updates,focal-security,now 470.86-0ubuntu0.20.04.2 amd64 [已安装,自动]
NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
Note now 470.86-0ubuntu0.20.04.2 amd64 here must be 470.86