Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libGL Error with Ubuntu 22.04 #95

Closed
1 task done
hmaarrfk opened this issue Apr 10, 2022 · 60 comments · Fixed by #98
Closed
1 task done

libGL Error with Ubuntu 22.04 #95

hmaarrfk opened this issue Apr 10, 2022 · 60 comments · Fixed by #98
Labels
question Further information is requested

Comments

@hmaarrfk
Copy link
Contributor

Comment:

Solution to issue cannot be found in the documentation.

  • I checked the documentation.

Issue

It seems that Ubuntu 22.04 doesn't play well with openGL from conda-forge.

mamba create --name dev --channel conda-forge --override-channels matplotlib --yes
mamba activate dev
python -c "from matplotlib import pyplot as plt; plt.plot(range(5)); plt.show()"
libGL error: MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: iris
libGL error: MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: iris
libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast

While the plot shows up, other hardware accelerate stuff (like using vispy) doesn't work. I didn't know where else to post this so I figured I would post it to matplotlib since it seems to have rather high visibility into these issues.

Installed packages

# packages in environment at /home/mark/mambaforge/envs/dev:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       1_gnu    conda-forge
alsa-lib                  1.2.3                h516909a_0    conda-forge
brotli                    1.0.9                h166bdaf_7    conda-forge
brotli-bin                1.0.9                h166bdaf_7    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
ca-certificates           2021.10.8            ha878542_0    conda-forge
certifi                   2021.10.8       py310hff52083_2    conda-forge
cycler                    0.11.0             pyhd8ed1ab_0    conda-forge
dbus                      1.13.6               h5008d03_3    conda-forge
expat                     2.4.8                h27087fc_0    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 hab24e00_0    conda-forge
fontconfig                2.14.0               h8e229c2_0    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
fonttools                 4.32.0          py310h5764c6d_0    conda-forge
freetype                  2.10.4               h0708190_1    conda-forge
gettext                   0.19.8.1          h73d1719_1008    conda-forge
giflib                    5.2.1                h36c2ea0_2    conda-forge
gst-plugins-base          1.20.1               hcf0ee16_1    conda-forge
gstreamer                 1.20.1               hd4edc92_1    conda-forge
icu                       69.1                 h9c3ff4c_0    conda-forge
jbig                      2.1               h7f98852_2003    conda-forge
jpeg                      9e                   h7f98852_0    conda-forge
keyutils                  1.6.1                h166bdaf_0    conda-forge
kiwisolver                1.4.2           py310hbf28c38_1    conda-forge
krb5                      1.19.3               h08a2579_0    conda-forge
lcms2                     2.12                 hddcbb42_0    conda-forge
ld_impl_linux-64          2.36.1               hea4e1c9_2    conda-forge
lerc                      3.0                  h9c3ff4c_0    conda-forge
libblas                   3.9.0           14_linux64_openblas    conda-forge
libbrotlicommon           1.0.9                h166bdaf_7    conda-forge
libbrotlidec              1.0.9                h166bdaf_7    conda-forge
libbrotlienc              1.0.9                h166bdaf_7    conda-forge
libcblas                  3.9.0           14_linux64_openblas    conda-forge
libclang                  13.0.1          default_hc23dcda_0    conda-forge
libdeflate                1.10                 h7f98852_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libevent                  2.1.10               h28343ad_4    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc-ng                 11.2.0              h1d223b6_15    conda-forge
libgfortran-ng            11.2.0              h69a702a_15    conda-forge
libgfortran5              11.2.0              h5c6108e_15    conda-forge
libglib                   2.70.2               h174f98d_4    conda-forge
libgomp                   11.2.0              h1d223b6_15    conda-forge
libiconv                  1.16                 h516909a_0    conda-forge
liblapack                 3.9.0           14_linux64_openblas    conda-forge
libllvm13                 13.0.1               hf817b99_2    conda-forge
libnsl                    2.0.0                h7f98852_0    conda-forge
libogg                    1.3.4                h7f98852_1    conda-forge
libopenblas               0.3.20          pthreads_h78a6416_0    conda-forge
libopus                   1.3.1                h7f98852_1    conda-forge
libpng                    1.6.37               h21135ba_2    conda-forge
libpq                     14.2                 h676c864_0    conda-forge
libstdcxx-ng              11.2.0              he4da1e4_15    conda-forge
libtiff                   4.3.0                h542a066_3    conda-forge
libuuid                   2.32.1            h7f98852_1000    conda-forge
libvorbis                 1.3.7                h9c3ff4c_0    conda-forge
libwebp                   1.2.2                h3452ae3_0    conda-forge
libwebp-base              1.2.2                h7f98852_1    conda-forge
libxcb                    1.13              h7f98852_1004    conda-forge
libxkbcommon              1.0.3                he3ba5ed_0    conda-forge
libxml2                   2.9.12               h885dcf4_1    conda-forge
libzlib                   1.2.11            h166bdaf_1014    conda-forge
lz4-c                     1.9.3                h9c3ff4c_1    conda-forge
matplotlib                3.5.1           py310hff52083_0    conda-forge
matplotlib-base           3.5.1           py310h23f4a51_0    conda-forge
munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
mysql-common              8.0.28               h26416b9_3    conda-forge
mysql-libs                8.0.28               hbc51c84_3    conda-forge
ncurses                   6.3                  h27087fc_1    conda-forge
nspr                      4.32                 h9c3ff4c_1    conda-forge
nss                       3.77                 h2350873_0    conda-forge
numpy                     1.22.3          py310h45f3432_2    conda-forge
openjpeg                  2.4.0                hb52868f_1    conda-forge
openssl                   3.0.2                h166bdaf_1    conda-forge
packaging                 21.3               pyhd8ed1ab_0    conda-forge
pcre                      8.45                 h9c3ff4c_0    conda-forge
pillow                    9.1.0           py310he619898_0    conda-forge
pip                       22.0.4             pyhd8ed1ab_0    conda-forge
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
pyparsing                 3.0.8              pyhd8ed1ab_0    conda-forge
pyqt                      5.12.3          py310hff52083_8    conda-forge
pyqt-impl                 5.12.3          py310h1f8e252_8    conda-forge
pyqt5-sip                 4.19.18         py310h122e73d_8    conda-forge
pyqtchart                 5.12            py310hfcd6d55_8    conda-forge
pyqtwebengine             5.12.1          py310hfcd6d55_8    conda-forge
python                    3.10.4          h2660328_0_cpython    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python_abi                3.10                    2_cp310    conda-forge
qt                        5.12.9               h1304e3e_6    conda-forge
readline                  8.1                  h46c0cb4_0    conda-forge
setuptools                62.0.0          py310hff52083_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
sqlite                    3.37.1               h4ff8645_0    conda-forge
tk                        8.6.12               h27826a3_0    conda-forge
tornado                   6.1             py310h5764c6d_3    conda-forge
tzdata                    2022a                h191b570_0    conda-forge
unicodedata2              14.0.0          py310h5764c6d_1    conda-forge
wheel                     0.37.1             pyhd8ed1ab_0    conda-forge
xorg-libxau               1.0.9                h7f98852_0    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xz                        5.2.5                h516909a_1    conda-forge
zlib                      1.2.11            h166bdaf_1014    conda-forge
zstd                      1.5.2                ha95c52a_0    conda-forge

Environment info

active environment : dev
    active env location : /home/mark/mambaforge/envs/dev
            shell level : 2
       user config file : /home/mark/.condarc
 populated config files : /home/mark/mambaforge/.condarc
                          /home/mark/.condarc
          conda version : 4.12.0
    conda-build version : 3.21.8
         python version : 3.9.12.final.0
       virtual packages : __linux=5.15.0=0
                          __glibc=2.35=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /home/mark/mambaforge  (writable)
      conda av data dir : /home/mark/mambaforge/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/mark.harfouche/linux-64
                          https://conda.anaconda.org/mark.harfouche/noarch
                          https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /home/mark/mambaforge/pkgs
                          /home/mark/.conda/pkgs
       envs directories : /home/mark/mambaforge/envs
                          /home/mark/.conda/envs
               platform : linux-64
             user-agent : conda/4.12.0 requests/2.27.1 CPython/3.9.12 Linux/5.15.0-25-generic ubuntu/22.04 glibc/2.35
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False

xref: conda-forge/matplotlib-feedstock#318

My solution was to delete the files

libstdc++.so  libstdc++.so.6  libstdc++.so.6.0.28-gdb.py  libstdc++.so.6.0.29

And let things fall back on the the libstdc++.so provided by ubuntu. seems to work :/

@hmaarrfk hmaarrfk added the question Further information is requested label Apr 10, 2022
@jakirkham
Copy link
Member

What version of GCC is Ubuntu 22.04 using?

@hmaarrfk
Copy link
Contributor Author

gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@hmaarrfk
Copy link
Contributor Author

$ ls /usr/lib/x86_64-linux-gnu/libstdc++.so.6*
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30

@hmaarrfk
Copy link
Contributor Author

It seems like it is using GLIBCXX_3.4.30 but this is the only note I can find about it:
https://gcc.gnu.org/pipermail/gcc-patches/2021-April/568635.html

@timsnyder
Copy link
Contributor

@hmaarrfk, can you run apt list --installed >& apt-packages.txt and attach that to this ticket? I'm trying to repro this on an Ubuntu 22.04 VM

@hmaarrfk
Copy link
Contributor Author

apt-packages.txt
Thank you for your help!

@timsnyder
Copy link
Contributor

timsnyder commented Apr 11, 2022

@hmaarrfk , to fully reproduce what you're seeing, I probably will need the contents of your /etc/apt/ tree. It looks like you have extra sources configured. I decided to just see if I could repro it without matching the system packages for now.

From AMI ubuntu/images-testing/hvm-ssd/ubuntu-jammy-daily-amd64-server-20220407 on AWS, I:

sudo apt update -y && sudo apt upgrade -y
sudo apt install task-xfce-desktop -y
sudo apt install tigervnc-standalone-server tigervnc-xorg-extension -y

rebooted the vm, fired up a vncserver, installed mambaforge and reran what Mark gave us in the OP for repro instructions.

I see the error message about swrast_dri.so but not the iris_dri.so. Digging into swrast_dri.so, when I run Mark's matplotlib example with LD_DEBUG=files, I see:

      3357:	/home/ubuntu/mambaforge/envs/dev/lib/python3.10/site-packages/PIL/../../../././libstdc++.so.6: error: version lookup error: version `GLIBCXX_3.4.30' not found (required by /lib/x86_64-linux-gnu/libLLVM-13.so.1) (fatal)

That happens while the dynamic linker is trying to link&load /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so.

It looks like the Ubuntu 22.04 swrast_dri.so is compiled using LLVM 13 because it needs libLLVM-13.so:

readelf -d swrast_dri.so output
(dev) ubuntu@ip-192-168-0-41:~$ readelf -d /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so 

Dynamic section at offset 0x17c7b08 contains 42 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libglapi.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libdrm.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libLLVM-13.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libexpat.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libz.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libzstd.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libsensors.so.5]
 0x0000000000000001 (NEEDED)             Shared library: [libdrm_radeon.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libelf.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libdrm_amdgpu.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libdrm_nouveau.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libvulkan.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [ld-linux-x86-64.so.2]
 0x000000000000000e (SONAME)             Library soname: [libgallium_dri.so]
 0x000000000000000c (INIT)               0x90000
 0x000000000000000d (FINI)               0x10d1bc4
 0x0000000000000019 (INIT_ARRAY)         0x1754d70
 0x000000000000001b (INIT_ARRAYSZ)       584 (bytes)
 0x000000000000001a (FINI_ARRAY)         0x1754fb8
 0x000000000000001c (FINI_ARRAYSZ)       8 (bytes)
 0x000000006ffffef5 (GNU_HASH)           0x328
 0x0000000000000005 (STRTAB)             0x4ed0
 0x0000000000000006 (SYMTAB)             0x3d0
 0x000000000000000a (STRSZ)              17560 (bytes)
 0x000000000000000b (SYMENT)             24 (bytes)
 0x0000000000000003 (PLTGOT)             0x17c9000
 0x0000000000000002 (PLTRELSZ)           17592 (bytes)
 0x0000000000000014 (PLTREL)             RELA
 0x0000000000000017 (JMPREL)             0x8b580
 0x0000000000000007 (RELA)               0x9c68
 0x0000000000000008 (RELASZ)             530712 (bytes)
 0x0000000000000009 (RELAENT)            24 (bytes)
 0x000000000000001e (FLAGS)              STATIC_TLS
 0x000000006ffffffe (VERNEED)            0x99a8
 0x000000006fffffff (VERNEEDNUM)         7
 0x000000006ffffff0 (VERSYM)             0x9368
 0x000000006ffffff9 (RELACOUNT)          21575
 0x0000000000000000 (NULL)               0x0

And I definitely see the GLIBCXX_3.4.30 version being needed by /lib/x86_64-linux-gnu/libLLVM-13.so.1.

Here's the full output running with LD_DEBUG=files
ubu2204_mesa_linking_issue_ld_debug_files.txt

@timsnyder
Copy link
Contributor

I guess a good question would be why the linker isn't linking against the libLLVM-13.so we provide? I don't see libLLVM-13.so.1 being provided by the libllvm-13 conda package that I have in my dev environment:

dev) ubuntu@ip-192-168-0-41:~/mambaforge/envs/dev/lib$ conda tree whoneeds libstdcxx-ng
['numpy', 'expat', 'libvorbis', 'krb5', 'pyqtwebengine', 'icu', 'lerc', 'gstreamer', 'nss', 'libllvm13', 'libxkbcommon', 'gst-plugins-base', 'libglib', 'libtiff', 'pyqt5-sip', 'zstd', 'matplotlib-base', 'mysql-common', 'pcre', 'lz4-c', 'qt', 'pyqt-impl', 'mysql-libs', 'openjpeg', 'nspr', 'libclang', 'pyqtchart', 'kiwisolver']
(dev) ubuntu@ip-192-168-0-41:~/mambaforge/envs/dev/lib$ conda tree whoneeds libllvm13
['libclang']
(dev) ubuntu@ip-192-168-0-41:~/mambaforge/envs/dev/lib$ conda tree whoneeds libclang
['qt']

I'm going to go look at the clang recipes to see what's up with that.

@hmaarrfk
Copy link
Contributor Author

It could also be a bug with ubuntu.

I'm somewhat testing out the waters before starting to install ubuntu 22.04 on all our computers. I can't seem to find much documentation on GLIBCXX_3.4.30 so maybe it isn't released yet officially?

It isn't stated in https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html and I can't find documentation from LLVM (though i'm new to using LLVM anyway).

@timsnyder
Copy link
Contributor

timsnyder commented Apr 11, 2022

Looks like the install-llvm.sh script might need to be tweaked at https://github.com/conda-forge/llvmdev-feedstock/blob/e779e84bfa61bf2fdf62ff3660b2dc2579ed9c53/recipe/install_llvm.sh#L16-L18

@isuruf which of our packages (if any) are supposed to be supplying the libLLVM-${VER_ARR[0]}.so.${SONAME} symlink?

It could also be a bug with ubuntu.

Maybe, but it seems like we are missing a symlink in our package.

@timsnyder
Copy link
Contributor

ln -s libLLVM-13.so $CONDA_PREFIX/lib/libLLVM-13.so.1 removed the linking error for me.

@timsnyder
Copy link
Contributor

It looks like Ubuntu is ending up with a different SONAME in libLLVM-13.so than we do. This is strange.

@hmaarrfk
Copy link
Contributor Author

I haven't had a chance to read it all, but it seem quite related to: ValveSoftware/steam-runtime#478

@timsnyder
Copy link
Contributor

timsnyder commented Apr 11, 2022

Ugh. I guess in their package, the debian folks have a patch that appends .1 onto the shared library SONAME https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/blob/11/debian/patches/0044-soname.diff and it looks like they have been doing this for awhile (the last edit to that patch was ~2 years ago). Looks like it was originally added in https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/commit/2009781b418f26cb44848187fa749dcde9fb0d08 and there's not really a reason given in the commit message although, looking at the details of the commit, they had been moving the library filename around to add the .1 suffix prior to that but the actual SONAME stored in the ELF didn't have the .1 suffix before that commit.

Looks like they started adding the .1 suffix to their libLLVM before they moved the package recipe into https://salsa.debian.org/pkg-llvm-team/llvm-toolchain
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=747701 is one of the earliest refrenced tickets in the git history.

So, I retract what I said about needing to tweak https://github.com/conda-forge/llvmdev-feedstock/blob/e779e84bfa61bf2fdf62ff3660b2dc2579ed9c53/recipe/install_llvm.sh#L16-L18. We aren't dropping a symlink that LLVM thinks we should have, the debian folks are imposing their own definition of SONAME on libLLVM.

@timsnyder
Copy link
Contributor

I guess what ubuntu is doing isn't any worse than Centos/RHEL:

readelf -d /lib64/libLLVM-7-rhel.so

 0x000000000000000e (SONAME)             Library soname: [libLLVM-7-rhel.so]

@isuruf
Copy link
Member

isuruf commented Apr 11, 2022

This issue is that we are not shipping libstdcxx-ng=12.0.1. PRs welcome to update the recipe to 12.0.1

@timsnyder
Copy link
Contributor

Thanks for chiming in @isuruf

@timsnyder
Copy link
Contributor

@isuruf, I started looking at opening a PR to update the recipe to provide libstdcxx-ng=12.0.1 but how do we do that when gcc 12 hasn't been released yet? Should we start building from the nightly snapshots? I guess that's what Ubuntu 22.04 is doing based on the version of the installed libstdc++6 I have:

libstdc++6/jammy,now 12-20220319-1ubuntu1 amd64 [installed,automatic]

I'll create a PR that targets the rc channel with the latest snapshot of gcc12 branch.

@isuruf
Copy link
Member

isuruf commented Apr 11, 2022

Ah. Never mind then. @hmaarrfk, your only option is to delete $PREFIX/lib/libstdc++* as you did.

@timsnyder
Copy link
Contributor

And I guess after looking at https://conda-forge.org/docs/maintainer/knowledge_base.html#pre-release-version-sorting again that I should name the version 12.0.1dev20220403? Seems a little strange that Ubuntu is shipping pre-release libstdc++ in 22.04 given that gcc 12 won't release before 22.04 comes out of beta.

@timsnyder
Copy link
Contributor

Yeah, looking at what it would take to create a dev version of the ctng_compilers_feedstock, I'd rather hold off until gcc12 is released in a few months...

@hmaarrfk
Copy link
Contributor Author

hmm. Ok.

I understand and likely agree that I jumped the boat too early.

Would a solution for me be to: libstdcxx-ng version 12.0.1 that doesn't provide any files at all but depends on __glibc=2.35=0?

@isuruf
Copy link
Member

isuruf commented Apr 11, 2022

__glibc=2.35.0 doesn't guarantee that libstdcxx-ng is 12

@hmaarrfk
Copy link
Contributor Author

Can i maybe depend on the user_agent?

             user-agent : conda/4.12.0 requests/2.27.1 CPython/3.9.12 Linux/5.15.0-25-generic ubuntu/22.04 glibc/2.35

@isuruf
Copy link
Member

isuruf commented Apr 11, 2022

Not at the moment.

@isuruf
Copy link
Member

isuruf commented Apr 11, 2022

You can create an empty libstdcxx-ng locally and use that locally.

@hmaarrfk
Copy link
Contributor Author

Thank you all for your help troubleshooting this.

I'm not sure if we will be able to miss this bug. I think many people will install ubuntu 22.04 in late april.

Well given the constraints of time, our desired effort to support experimental gcc, I'm going to upload my own libstdcxx-ng to my channel.

Users that want that can copy the file can do so from
https://anaconda.org/mark.harfouche/libstdcxx-ng

It was generated with the following meta

package:
  name: libstdcxx-ng
  version: 12.0.1+ubuntu2204

build:
  number: 0
  skip: True  # [not linux]

requirements:
  host:
    - __glibc=2.35=0

about:
  summary: Dummy files for libstdc++ for compatibility with Ubuntu 22.04

extra:
  recipe-maintainers:
    - hmaarrfk

Then ran with:

conda mambabuild .

@isuruf
Copy link
Member

isuruf commented Apr 12, 2022

gcc 12 will be released in late April, so we can just wait.

@traversaro
Copy link
Contributor

@ShantanuKodgirwar can you post your environment (i.e. the output of conda list?) and your exact error? Thanks!

@ShantanuKodgirwar
Copy link

ShantanuKodgirwar commented Sep 9, 2022

Sure. Although I am actually using a poetry virtual environment. So I'll give that list.

First of all the error message which is really same as OP.

libGL error: MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: iris
libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast

Here is the result of pip list in my virtual env.

Package                       Version     Editable project location
----------------------------- ----------- ------------------------------
alabaster                     0.7.12
appdirs                       1.4.4
argon2-cffi                   21.3.0
argon2-cffi-bindings          21.2.0
asttokens                     2.0.5
attrs                         21.4.0
Babel                         2.10.3
backcall                      0.2.0
beautifulsoup4                4.11.1
bleach                        5.0.1
build                         0.8.0
cachey                        0.2.1
certifi                       2022.6.15
cffi                          1.15.1
charset-normalizer            2.1.0
click                         8.1.3
cloudpickle                   2.1.0
commonmark                    0.9.1
cycler                        0.11.0
dask                          2022.7.1
debugpy                       1.6.2
decorator                     5.1.1
defusedxml                    0.7.1
docstring-parser              0.14.1
docutils                      0.18.1
entrypoints                   0.4
executing                     0.8.3
fastjsonschema                2.16.1
fonttools                     4.34.4
freetype-py                   2.3.0
fsspec                        2022.5.0
h5py                          3.7.0
HeapDict                      1.0.1
hsluv                         5.0.3
idna                          3.3
imageio                       2.19.5
imagesize                     1.4.1
importlib-metadata            4.12.0
ipykernel                     6.15.1
ipython                       8.4.0
ipython-genutils              0.2.0
ipywidgets                    7.7.1
jedi                          0.18.1
Jinja2                        3.1.2
joblib                        1.1.0
jsonschema                    4.7.2
jupyter                       1.0.0
jupyter-client                7.3.4
jupyter-console               6.4.4
jupyter-core                  4.11.1
jupyterlab-pygments           0.2.2
jupyterlab-widgets            1.1.1
kiwisolver                    1.4.4
locket                        1.0.0
magicgui                      0.5.1
MarkupSafe                    2.1.1
matplotlib                    3.5.2
matplotlib-inline             0.1.3
mistune                       0.8.4
napari                        0.4.16
napari-console                0.0.4
napari-plugin-engine          0.2.0
napari-svg                    0.1.6
nbclient                      0.6.6
nbconvert                     6.5.0
nbformat                      5.4.0
nest-asyncio                  1.5.5
networkx                      2.8.5
notebook                      6.4.12
npe2                          0.5.1
numexpr                       2.8.3
numpy                         1.23.1
numpydoc                      1.4.0
packaging                     21.3
pandas                        1.4.3
pandocfilters                 1.5.0
parso                         0.8.3
partd                         1.2.0
pep517                        0.12.0
pexpect                       4.8.0
pickleshare                   0.7.5
Pillow                        9.2.0
Pint                          0.19.2
pip                           22.2.2
prometheus-client             0.14.1
prompt-toolkit                3.0.30
psutil                        5.9.1
psygnal                       0.3.5
ptycho-hdr                    0.1.0
ptyprocess                    0.7.0
pure-eval                     0.2.2
pycparser                     2.21
pydantic                      1.9.1
Pygments                      2.12.0
PyOpenGL                      3.1.6
pyparsing                     3.0.9
PyQt5                         5.15.7
PyQt5-Qt5                     5.15.2
PyQt5-sip                     12.11.0
pyqtgraph                     0.12.4
pyrsistent                    0.18.1
python-dateutil               2.8.2
pytomlpp                      1.0.11
pytz                          2022.1
PyWavelets                    1.3.0
PyYAML                        6.0
pyzmq                         23.2.0
qtconsole                     5.3.1
QtPy                          2.1.0
requests                      2.28.1
rich                          12.5.1
scikit-image                  0.19.3
scikit-learn                  1.1.1
scipy                         1.9.0
Send2Trash                    1.8.0
setuptools                    60.6.0
setuptools-scm                7.0.5
six                           1.16.0
snowballstemmer               2.2.0
soupsieve                     2.3.2.post1
Sphinx                        5.0.2
sphinxcontrib-applehelp       1.0.2
sphinxcontrib-devhelp         1.0.2
sphinxcontrib-htmlhelp        2.0.0
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          1.0.3
sphinxcontrib-serializinghtml 1.1.5
stack-data                    0.3.0
superqt                       0.3.3
tables                        3.7.0
terminado                     0.15.0
threadpoolctl                 3.1.0
tifffile                      2022.5.4
tinycss2                      1.1.1
tomli                         2.0.1
toolz                         0.12.0
tornado                       6.2
tqdm                          4.64.0
traitlets                     5.3.0
typer                         0.6.1
typing_extensions             4.3.0
urllib3                       1.26.10
vispy                         0.10.0
wcwidth                       0.2.5
webencodings                  0.5.1
wheel                         0.37.1
widgetsnbextension            3.6.1
wrapt                         1.14.1
zipp                          3.8.1

@traversaro
Copy link
Contributor

Sure. Although I am actually using a poetry virtual environment. So I'll give that list.

If you are using poetry, I doubt the problem is related to what is discussed here. In the issue discussed here, the libstdc++.so provided by conda-forge is used in place of the one provided by the system, but the system OpenGL driver required some symbols that were specific of GCC 12 (the version used by the system libstdc++.so), so the loading failed. Updating the conda-forge's libstdc++.so to GCC 12 provide all symbols required by the system OpenGL driver solved the issue. However, if you are not using conda-forge, the problem that you are experiencing is not related.

If you want to debug your problem, I suggest to run your code with LIBGL_DEBUG=verbose as done in RoboStack/ros-galactic#101 (comment) . However, I would kindly ask you to track your problem somewhere else, as it is not related to conda-forge, thanks!

@ShantanuKodgirwar
Copy link

I swapped up the environment with a conda environment and I face the same error.

@traversaro
Copy link
Contributor

traversaro commented Sep 9, 2022

I swapped up the environment with a conda environment and I face the same error.

Then can you provide the conda list and the output of LIBGL_DEBUG=verbose commandthatiscreatingtheproblem?

@ShantanuKodgirwar
Copy link

ShantanuKodgirwar commented Sep 9, 2022

I am sorry. I am not well versed with libGL. I tried to write LIBGL_DEBUG=verbose in terminal before running the file (also after), didn't result in anything other than the below error that is generated every time I run my file.

libGL error: MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: iris
libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast

The output of conda list is

#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main  
_openmp_mutex             4.5                       1_gnu  
blas                      1.0                         mkl  
blosc                     1.21.0               h8c45485_0  
bottleneck                1.3.2            py39hdd57654_1  
brotli                    1.0.9                he6710b0_2  
brunsli                   0.1                  h2531618_0  
bzip2                     1.0.8                h7b6447c_0  
c-ares                    1.18.1               h7f8727e_0  
ca-certificates           2021.10.26           h06a4308_2  
certifi                   2021.10.8        py39h06a4308_2  
cfitsio                   3.470                hf0d0db6_6  
charls                    2.2.0                h2531618_0  
cloudpickle               2.0.0              pyhd3eb1b0_0  
cycler                    0.11.0             pyhd3eb1b0_0  
cytoolz                   0.11.0           py39h27cfd23_0  
dask-core                 2021.10.0          pyhd3eb1b0_0  
dbus                      1.13.18              hb2f20db_0  
expat                     2.4.1                h2531618_2  
fontconfig                2.13.1               h6c09931_0  
fonttools                 4.25.0             pyhd3eb1b0_0  
freetype                  2.11.0               h70c0345_0  
fsspec                    2021.10.1          pyhd3eb1b0_0  
giflib                    5.2.1                h7b6447c_0  
glib                      2.69.1               h5202010_0  
gst-plugins-base          1.14.0               h8213a91_2  
gstreamer                 1.14.0               h28cd5cc_2  
icu                       58.2                 he6710b0_3  
imagecodecs               2021.8.26        py39h4cda21f_0  
imageio                   2.9.0              pyhd3eb1b0_0  
intel-openmp              2021.4.0          h06a4308_3561  
jpeg                      9d                   h7f8727e_0  
jxrlib                    1.1                  h7b6447c_2  
kiwisolver                1.3.1            py39h2531618_0  
krb5                      1.19.2               hac12032_0  
lcms2                     2.12                 h3be6417_0  
ld_impl_linux-64          2.35.1               h7274673_9  
lerc                      3.0                  h295c915_0  
libaec                    1.0.4                he6710b0_1  
libcurl                   7.80.0               h0b77cf5_0  
libdeflate                1.8                  h7f8727e_5  
libedit                   3.1.20210910         h7f8727e_0  
libev                     4.33                 h7f8727e_1  
libffi                    3.3                  he6710b0_2  
libgcc-ng                 9.3.0               h5101ec6_17  
libgfortran-ng            7.5.0               ha8ba4b0_17  
libgfortran4              7.5.0               ha8ba4b0_17  
libgomp                   9.3.0               h5101ec6_17  
libnghttp2                1.46.0               hce63b2e_0  
libpng                    1.6.37               hbc83047_0  
libssh2                   1.9.0                h1ba5d50_1  
libstdcxx-ng              9.3.0               hd4cf53a_17  
libtiff                   4.2.0                h85742a9_0  
libuuid                   1.0.3                h7f8727e_2  
libwebp                   1.2.0                h89dd481_0  
libwebp-base              1.2.0                h27cfd23_0  
libxcb                    1.14                 h7b6447c_0  
libxml2                   2.9.12               h03d6c58_0  
libzopfli                 1.0.3                he6710b0_0  
locket                    0.2.1            py39h06a4308_1  
lz4-c                     1.9.3                h295c915_1  
matplotlib                3.5.0            py39h06a4308_0  
matplotlib-base           3.5.0            py39h3ed280b_0  
mkl                       2021.4.0           h06a4308_640  
mkl-service               2.4.0            py39h7f8727e_0  
mkl_fft                   1.3.1            py39hd3c417c_0  
mkl_random                1.2.2            py39h51133e4_0  
munkres                   1.1.4                      py_0  
ncurses                   6.3                  h7f8727e_2  
networkx                  2.6.3              pyhd3eb1b0_0  
numexpr                   2.8.1            py39h6abb31d_0  
numpy                     1.21.2           py39h20f2e39_0  
numpy-base                1.21.2           py39h79a1101_0  
olefile                   0.46               pyhd3eb1b0_0  
openjpeg                  2.4.0                h3ad879b_0  
openssl                   1.1.1m               h7f8727e_0  
packaging                 21.3               pyhd3eb1b0_0  
pandas                    1.3.5            py39h8c16a72_0  
partd                     1.2.0              pyhd3eb1b0_0  
pcre                      8.45                 h295c915_0  
pillow                    8.4.0            py39h5aabda8_0  
pip                       21.2.4           py39h06a4308_0  
pyparsing                 3.0.4              pyhd3eb1b0_0  
pyqt                      5.9.2            py39h2531618_6  
python                    3.9.7                h12debd9_1  
python-dateutil           2.8.2              pyhd3eb1b0_0  
pytz                      2021.3             pyhd3eb1b0_0  
pywavelets                1.1.1            py39h6323ea4_4  
pyyaml                    6.0              py39h7f8727e_1  
qt                        5.9.7                h5867ecd_1  
readline                  8.1                  h27cfd23_0  
scikit-image              0.18.3           py39h51133e4_0  
scipy                     1.7.1            py39h292c36d_2  
setuptools                58.0.4           py39h06a4308_0  
sip                       4.19.13          py39h2531618_0  
six                       1.16.0             pyhd3eb1b0_0  
snappy                    1.1.8                he6710b0_0  
sqlite                    3.36.0               hc218d9a_0  
tifffile                  2021.7.2           pyhd3eb1b0_2  
tk                        8.6.11               h1ccaba5_0  
toolz                     0.11.2             pyhd3eb1b0_0  
tornado                   6.1              py39h27cfd23_0  
tzdata                    2021e                hda174b7_0  
wheel                     0.37.0             pyhd3eb1b0_1  
xz                        5.2.5                h7b6447c_0  
yaml                      0.2.5                h7b6447c_0  
zfp                       0.5.5                h2531618_6  
zlib                      1.2.11               h7b6447c_3  
zstd                      1.4.9                haebb681_0  

@traversaro
Copy link
Contributor

You need to write LIBGL_DEBUG=verbose right before the command that you are launching, not before. If you speficy the command that is giving you problems, I can show.

@ShantanuKodgirwar
Copy link

Ahhh. Gotcha. :)

The full error message after the command gives this

libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/shantanu/.drirc: No such file or directory.
libGL: using driver i915 for 3
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/shantanu/.drirc: No such file or directory.
libGL: using driver i915 for 3
libGL: pci id for fd 3: 8086:9b41, driver iris
libGL: MESA-LOADER: failed to open /usr/lib/x86_64-linux-gnu/dri/iris_dri.so: /home/shantanu/anaconda3/envs/ImageProcessing_I_2021_2022/lib/python3.9/site-packages/matplotlib/../../../libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /usr/lib/x86_64-linux-gnu/dri/iris_dri.so)
libGL: MESA-LOADER: failed to open \$${ORIGIN}/dri/iris_dri.so: \$${ORIGIN}/dri/iris_dri.so: cannot open shared object file: No such file or directory
libGL: MESA-LOADER: failed to open /usr/lib/dri/iris_dri.so: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory
libGL error: MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: iris
libGL: MESA-LOADER: failed to open /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so: /home/shantanu/anaconda3/envs/ImageProcessing_I_2021_2022/lib/python3.9/site-packages/matplotlib/../../../libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so)
libGL: MESA-LOADER: failed to open \$${ORIGIN}/dri/swrast_dri.so: \$${ORIGIN}/dri/swrast_dri.so: cannot open shared object file: No such file or directory
libGL: MESA-LOADER: failed to open /usr/lib/dri/swrast_dri.so: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory
libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast

@traversaro
Copy link
Contributor

The relevant message is:

/home/shantanu/anaconda3/envs/ImageProcessing_I_2021_2022/lib/python3.9/site-packages/matplotlib/../../../libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /usr/lib/x86_64-linux-gnu/dri/iris_dri.so)
libGL: MESA-LOADER: failed to open \$${ORIGIN}/dri/iris_dri.so: \$${ORIGIN}/dri/iris_dri.so: cannot open shared object file: No such file or directory

From the version numbers, I guess you are using the default channels, instead of the conda-forge channel? To benefit from the fix discussed here, you should switch to use the conda-forge channel, for example passing -c conda-forge when you create the environemnt. Apparently issue described in this issue was not solved in the default channel.

@homerobse
Copy link

homerobse commented Jan 6, 2023

I have the same issue just trying to plot with matplotlib on a Windows 11, WSL2 installed Python:

import numpy as np
import matplotlib.pyplot as plt

print("run")
print("before figure")
plt.figure()
print("begin")
xs = np.arange(0,10, .1)
plt.plot(xs, np.sin(xs))
print("middle")
print("goodbye")
plt.show()

And I get the error message:

libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast

@traversaro
Copy link
Contributor

As mentioned in
#95 (comment) can you post the output of conda list, the output of conda info, the Linux distro you are using and the output of the command that is giving you the error after setting LIBGL_DEBUG to 1?

@homerobse
Copy link

$ conda list

packages in environment at /home/homero/software/miniconda3:

Name Version Build Channel

_libgcc_mutex 0.1 main
_openmp_mutex 4.5 1_gnu
asttokens 2.0.5 pyhd3eb1b0_0
backcall 0.2.0 pyhd3eb1b0_0
blas 1.0 mkl
brotli 1.0.9 h5eee18b_7
brotli-bin 1.0.9 h5eee18b_7
brotlipy 0.7.0 py39h27cfd23_1003
ca-certificates 2022.10.11 h06a4308_0
certifi 2022.9.24 py39h06a4308_0
cffi 1.15.0 py39hd667e15_1
charset-normalizer 2.0.4 pyhd3eb1b0_0
colorama 0.4.4 pyhd3eb1b0_0
conda 22.11.0 py39h06a4308_1
conda-content-trust 0.1.1 pyhd3eb1b0_0
conda-package-handling 1.8.1 py39h7f8727e_0
cryptography 36.0.0 py39h9ce1e76_0
cycler 0.11.0 pyhd3eb1b0_0
dbus 1.13.18 hb2f20db_0
decorator 5.1.1 pyhd3eb1b0_0
executing 0.8.3 pyhd3eb1b0_0
expat 2.4.9 h6a678d5_0
fontconfig 2.13.1 hef1e5e3_1
fonttools 4.25.0 pyhd3eb1b0_0
freetype 2.11.0 h70c0345_0
giflib 5.2.1 h7b6447c_0
glib 2.69.1 h4ff587b_1
gst-plugins-base 1.14.0 h8213a91_2
gstreamer 1.14.0 h28cd5cc_2
icu 58.2 he6710b0_3
idna 3.3 pyhd3eb1b0_0
intel-openmp 2021.4.0 h06a4308_3561
ipython 8.6.0 py39h06a4308_0
jedi 0.18.1 py39h06a4308_1
jpeg 9e h7f8727e_0
kiwisolver 1.4.2 py39h295c915_0
krb5 1.19.2 hac12032_0
lcms2 2.12 h3be6417_0
ld_impl_linux-64 2.35.1 h7274673_9
lerc 3.0 h295c915_0
libbrotlicommon 1.0.9 h5eee18b_7
libbrotlidec 1.0.9 h5eee18b_7
libbrotlienc 1.0.9 h5eee18b_7
libclang 10.0.1 default_hb85057a_2
libdeflate 1.8 h7f8727e_5
libedit 3.1.20210910 h7f8727e_0
libevent 2.1.12 h8f2d780_0
libffi 3.3 he6710b0_2
libgcc-ng 11.2.0 h1234567_1
libgomp 11.2.0 h1234567_1
libllvm10 10.0.1 hbcb73fb_5
libpng 1.6.37 hbc83047_0
libpq 12.9 h16c4e8d_3
libstdcxx-ng 11.2.0 h1234567_1
libtiff 4.4.0 hecacb30_0
libuuid 1.41.5 h5eee18b_0
libwebp 1.2.4 h11a3e52_0
libwebp-base 1.2.4 h5eee18b_0
libxcb 1.15 h7f8727e_0
libxkbcommon 1.0.1 hfa300c1_0
libxml2 2.9.14 h74e7548_0
libxslt 1.1.35 h4e12654_0
lz4-c 1.9.3 h295c915_1
matplotlib 3.5.2 py39h06a4308_0
matplotlib-base 3.5.2 py39hf590b9c_0
matplotlib-inline 0.1.6 py39h06a4308_0
mkl 2021.4.0 h06a4308_640
mkl-service 2.4.0 py39h7f8727e_0
mkl_fft 1.3.1 py39hd3c417c_0
mkl_random 1.2.2 py39h51133e4_0
munkres 1.1.4 py_0
natsort 7.1.1 pyhd3eb1b0_0
ncurses 6.3 h7f8727e_2
nspr 4.33 h295c915_0
nss 3.74 h0370c37_0
numpy 1.23.4 py39h14f4228_0
numpy-base 1.23.4 py39h31eccc5_0
openssl 1.1.1s h7f8727e_0
packaging 21.3 pyhd3eb1b0_0
parso 0.8.3 pyhd3eb1b0_0
pcre 8.45 h295c915_0
pexpect 4.8.0 pyhd3eb1b0_3
pickleshare 0.7.5 pyhd3eb1b0_1003
pillow 9.2.0 py39hace64e9_1
pip 21.2.4 py39h06a4308_0
pluggy 1.0.0 py39h06a4308_1
ply 3.11 py39h06a4308_0
prompt-toolkit 3.0.20 pyhd3eb1b0_0
ptyprocess 0.7.0 pyhd3eb1b0_2
pure_eval 0.2.2 pyhd3eb1b0_0
pycosat 0.6.3 py39h27cfd23_0
pycparser 2.21 pyhd3eb1b0_0
pygments 2.11.2 pyhd3eb1b0_0
pyopenssl 22.0.0 pyhd3eb1b0_0
pyparsing 3.0.9 py39h06a4308_0
pyqt 5.15.7 py39h6a678d5_1
pyqt5-sip 12.11.0 py39h6a678d5_1
pysocks 1.7.1 py39h06a4308_0
python 3.9.12 h12debd9_0
python-dateutil 2.8.2 pyhd3eb1b0_0
qt-main 5.15.2 h327a75a_7
qt-webengine 5.15.9 hd2b0992_4
qtwebkit 5.212 h4eab89a_4
readline 8.1.2 h7f8727e_1
requests 2.27.1 pyhd3eb1b0_0
ruamel.yaml 0.16.12 py39h5eee18b_3
ruamel.yaml.clib 0.2.6 py39h5eee18b_1
ruamel_yaml 0.15.100 py39h27cfd23_0
setuptools 61.2.0 py39h06a4308_0
sip 6.6.2 py39h6a678d5_0
six 1.16.0 pyhd3eb1b0_1
sqlite 3.39.3 h5082296_0
stack_data 0.2.0 pyhd3eb1b0_0
tk 8.6.11 h1ccaba5_0
toml 0.10.2 pyhd3eb1b0_0
toolz 0.12.0 py39h06a4308_0
tornado 6.2 py39h5eee18b_0
tqdm 4.63.0 pyhd3eb1b0_0
traitlets 5.1.1 pyhd3eb1b0_0
tzdata 2022a hda174b7_0
urllib3 1.26.8 pyhd3eb1b0_0
wcwidth 0.2.5 pyhd3eb1b0_0
wheel 0.37.1 pyhd3eb1b0_0
xz 5.2.5 h7b6447c_0
yaml 0.2.5 h7b6447c_0
zlib 1.2.12 h7f8727e_1
zstd 1.5.2 ha4553b6_0

@homerobse
Copy link

$ python te.py
run
before figure
begin
middle
goodbye
libGL: MESA-LOADER: failed to open /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so: /home/homero/software/miniconda3/lib/python3.9/site-packages/PIL/../../../././libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /lib/x86_64-linux-gnu/libLLVM-13.so.1)
libGL: MESA-LOADER: failed to open $${ORIGIN}/dri/swrast_dri.so: $${ORIGIN}/dri/swrast_dri.so: cannot open shared object file: No such file or directory
libGL: MESA-LOADER: failed to open /usr/lib/dri/swrast_dri.so: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory
libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast

@homerobse
Copy link

homerobse commented Jan 10, 2023

te.py is the file with the code I mentioned in #95 (comment)

@isuruf
Copy link
Member

isuruf commented Jan 10, 2023

@homerobse, you are not using conda-forge. Please open an issue with anaconda where you get the packages.

@homerobse
Copy link

homerobse commented Jan 11, 2023

Thanks for looking into it. Can you give me a little more detail of how to fix it? What exactly should I change to be using conda-forge and how can I do that? This error happens both in my base conda environment and in others.

@jakirkham
Copy link
Member

Please read this doc

@homerobse
Copy link

homerobse commented Jan 11, 2023

Thank you. I have done that and it works for environments that are not the base. How can I change my base environment to use libGL from conda-forge?

@traversaro
Copy link
Contributor

Thank you. I have done that and it works for environments that are not the base. How can I change my base environment to use libGL from conda-forge?

If you are not interested to use the defaults channel at all, probably the cleanest solution is to uninstall miniconda3 and use mambaforge from https://github.com/conda-forge/miniforge as your installer.

@homerobse
Copy link

Thanks. I will take a look.

Regarding starting an issue at Anaconda: which repository from among https://github.com/Anaconda-Platform should I use to start an issue?

@homerobse
Copy link

Thank you. I have done that and it works for environments that are not the base. How can I change my base environment to use libGL from conda-forge?

If you are not interested to use the defaults channel at all, probably the cleanest solution is to uninstall miniconda3 and use mambaforge from https://github.com/conda-forge/miniforge as your installer.

I have found a way that doesn't involve using mamba. After adding conda-forge channel by conda config --add channels conda-forge (as instructed here https://conda-forge.org/docs/user/introduction.html#how-can-i-install-packages-from-conda-forge), I just updated conda by doing conda update conda.

It solved my problem at the base environment.

@jfdev001
Copy link

jfdev001 commented Mar 1, 2023

I received a similar error when calling plt.show() from a script using matplotlib. Here are some system specs:

OS: Lubuntu 22.04.2 LTS x86_64
DE: LXQt 0.17.1
CPU: AMD Ryzen 5 4600H with Radeon Graphics (12)
GPU: AMD ATI 04:00.0 Renoir

This was the error I received even though the plot gets displayed:

libGL error: MESA-LOADER: failed to open radeonsi: /usr/lib/dri/radeonsi_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: radeonsi
libGL error: MESA-LOADER: failed to open radeonsi: /usr/lib/dri/radeonsi_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: radeonsi
libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast

The solution I found is in this stack overflow post: and it's simply to edit the ~/.bashrc file and add the following line:

# In ~/.bashrc
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6

@pwaltman
Copy link

I received a similar error when calling plt.show() from a script using matplotlib. Here are some system specs:

OS: Lubuntu 22.04.2 LTS x86_64
DE: LXQt 0.17.1
CPU: AMD Ryzen 5 4600H with Radeon Graphics (12)
GPU: AMD ATI 04:00.0 Renoir

This was the error I received even though the plot gets displayed:

libGL error: MESA-LOADER: failed to open radeonsi: /usr/lib/dri/radeonsi_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: radeonsi
libGL error: MESA-LOADER: failed to open radeonsi: /usr/lib/dri/radeonsi_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: radeonsi
libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast

The solution I found is in this stack overflow post: and it's simply to edit the ~/.bashrc file and add the following line:

# In ~/.bashrc
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6

This resolved the issue for me. I'm running wsl2, with ubuntu 22.10, and just installed the latest version of anaconda on the system.

@isque03
Copy link

isque03 commented Apr 17, 2023

Thanks @pwaltman
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
Worked for me also using Windows 11, WSL2

gcc --version
gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0

@OSobky
Copy link

OSobky commented Jul 16, 2023

Thank you so much @pwaltman.

After hours of searching this was the solution to my problem.

Running Open3D Visualizer using Windows 10, WSL2.

I had the following error message even though xeyes & open3d example visualization/draw were running

libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri) libGL error: failed to load driver: swrast

@nouicer
Copy link

nouicer commented Oct 1, 2023

Thanks @pwaltman
I received the same issue using getdist-gui under cobaya. I solved it by adding
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
to the .bashrc

I use:gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.