Skip to content

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

Open
@SoonminHwang

Description

@SoonminHwang
Owner

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

cgbcgb commented on Oct 24, 2019

@cgbcgb

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

doarnf

doarnf commented on Jul 7, 2021

@doarnf

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

thor7777 commented on Aug 20, 2021

@thor7777

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

ninnyyan1993 commented on Nov 18, 2021

@ninnyyan1993

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

marcusvinicius178 commented on Jan 18, 2022

@marcusvinicius178

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

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @SoonminHwang@cgbcgb@ninnyyan1993@marcusvinicius178@thor7777

        Issue actions

          [docker][mayavi] libGL error: No matching fbConfigs or visuals found · Issue #1 · SoonminHwang/dockers