SoonminHwang / dockers

Dockerfiles for my working environments
6 stars 3 forks source link

[docker][mayavi] libGL error: No matching fbConfigs or visuals found #1

Open SoonminHwang opened 6 years ago

SoonminHwang commented 6 years ago

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}
cgbcgb commented 5 years ago

完美的解决了docker的UI显示问题,哈哈,thanks

doarnf commented 3 years ago

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}

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:

ls /usr/lib/ | grep nvidia

And I got:

libnvidia-gtk2.so.418.74
libnvidia-gtk3.so.418.74
nvidia

So I ls to dig deeper:

ls /usr/lib/nvidia

Got:

alternate-install-present               current                 nvidia_drv.so
bumblebee                               libglxserver_nvidia.so  pre-install
check-for-conflicting-opengl-libraries  nvidia
check-for-mismatching-nvidia-module     nvidia-bug-report.sh
ls /usr/lib/nvidia/nvidia

Got:

libglxserver_nvidia.so             nvidia-debugdump  nvidia-settings.1.gz
libglxserver_nvidia.so.418.197.02  nvidia_drv.so     nvidia-settings.desktop
nv-control-dpy                     nvidia.ids
nvidia-bug-report.sh               nvidia-settings

Is /usr/lib/nvidia/nvidia the right directory?

thor7777 commented 3 years ago

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}

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:

ls /usr/lib/ | grep nvidia

And I got:

libnvidia-gtk2.so.418.74
libnvidia-gtk3.so.418.74
nvidia

So I ls to dig deeper:

ls /usr/lib/nvidia

Got:

alternate-install-present               current                 nvidia_drv.so
bumblebee                               libglxserver_nvidia.so  pre-install
check-for-conflicting-opengl-libraries  nvidia
check-for-mismatching-nvidia-module     nvidia-bug-report.sh
ls /usr/lib/nvidia/nvidia

Got:

libglxserver_nvidia.so             nvidia-debugdump  nvidia-settings.1.gz
libglxserver_nvidia.so.418.197.02  nvidia_drv.so     nvidia-settings.desktop
nv-control-dpy                     nvidia.ids
nvidia-bug-report.sh               nvidia-settings

Is /usr/lib/nvidia/nvidia the right directory?

Did you fix this problem?

ninnyyan1993 commented 3 years ago

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}

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 commented 2 years ago

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 :(