Open
Description
Error:
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
ERROR: In /work/standalone-x64-build/VTK-source/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, line 785
vtkXOpenGLRenderWindow (0x3a54650): GLEW could not be initialized.
Segmentation fault (core dumped)
Solution:
Connect nvidia-driver volume when docker image runs, add proper path to ${PATH} and ${LD_LIBRARY_PATH}.
Example:
docker run -it \
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \\
--privileged \
-e DISPLAY=$DISPLAY \
-v /usr/lib/nvidia-384:/usr/lib/nvidia-384 \
-v /usr/lib32/nvidia-384:/usr/lib32/nvidia-384 \
--device /dev/dri \
YOUR_DOCKER_IMAGE_NAME
In docker container,
export PATH="/usr/lib/nvidia-384/bin":${PATH}
export LD_LIBRARY_PATH="/usr/lib/nvidia-384:/usr/lib32/nvidia-384":${LD_LIBRARY_PATH}
Activity
cgbcgb commentedon Oct 24, 2019
完美的解决了docker的UI显示问题,哈哈,thanks
doarnf commentedon Jul 7, 2021
Hi, there.
I am new to docker. In this case, I wonder to know what is
/usr/lib/nvidia-384
about.Is it specific for different host(I guess so)? And how to get the correct directory in my host?
I use the commands:
And I got:
So I
ls
to dig deeper:Got:
Got:
Is
/usr/lib/nvidia/nvidia
the right directory?thor7777 commentedon Aug 20, 2021
Did you fix this problem?
ninnyyan1993 commentedon Nov 18, 2021
Is the directory
/usr/lib/nvidia-384
and/usr/lib32/nvidia-384
should be exist already on ubuntu file system? If not, it will be automatically created, which not works for my case. Besides, I am using nvidia driver 470, and I've change my case to 470 instead of 384.Hope your reply. Thanks.
marcusvinicius178 commentedon Jan 18, 2022
Hi @SoonminHwang thanks for this tutorial. I am struggling with these issues in the last week to connect CARLA with APollo and launch the simulator: https://github.com/AuroAi/carla_apollo_bridge
Can you please help me? I have already tried a lot of approaches: https://askubuntu.com/questions/541343/problems-with-libgl-fbconfigs-swrast-through-each-update/566522#566522
Any one of them worked.
I think the Docker commands you suggested can work , however did not work on my system. i tried to adjust your commands to my case:
In my case I am using nvidia-470 and in the folder /usr/lib I have the folder "nvidia" not the folder "nvidia-470"....
Then I have modified the command and issued:
Command 1
docker run -it
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
--privileged
-e DISPLAY=$DISPLAY
-v /usr/lib/nvidia:/usr/lib/nvidia
-v /usr/lib32/nvidia:/usr/lib32/nvidia
--device /dev/dri
carla-server
Command 2
export PATH="/usr/lib/nvidia/bin":${PATH}
export LD_LIBRARY_PATH="/usr/lib/nvidia/usr/lib32/nvidia":${LD_LIBRARY_PATH}
have added in addition other flags to enable NVIDIA and opengl library communicates with Docker, however the error persists...
In addition, I Have already reinstalled nvidia-drivers, installed clang compilers, ninja-build, nvidia-container toolkit, nvidia-docker2, libvulkan, mesa-grip driver, have also added ENV Nvidia_capabilities, display in Docker image, have exported paths, set symbolic links to libGl versions, restarted docker,daemon and gdm, etc, etc but nothing worked :(
1 remaining item