Closed hmaarrfk closed 2 years ago
What version of GCC is Ubuntu 22.04 using?
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.
$ 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
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
@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
apt-packages.txt Thank you for your help!
@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
:
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
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.
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).
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.
ln -s libLLVM-13.so $CONDA_PREFIX/lib/libLLVM-13.so.1
removed the linking error for me.
It looks like Ubuntu is ending up with a different SONAME in libLLVM-13.so than we do. This is strange.
I haven't had a chance to read it all, but it seem quite related to: https://github.com/ValveSoftware/steam-runtime/issues/478
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.
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]
This issue is that we are not shipping libstdcxx-ng=12.0.1
. PRs welcome to update the recipe to 12.0.1
Thanks for chiming in @isuruf
@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.
Ah. Never mind then. @hmaarrfk, your only option is to delete $PREFIX/lib/libstdc++*
as you did.
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.
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...
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
?
__glibc=2.35.0
doesn't guarantee that libstdcxx-ng
is 12
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
Not at the moment.
You can create an empty libstdcxx-ng
locally and use that locally.
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
gcc 12 will be released in late April, so we can just wait.
There's a release candidate now. https://gcc.gnu.org/pub/gcc/snapshots/12.1.0-RC-20220429
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 :/
An alternative workaround (perhaps less invasive) that we used in https://github.com/RoboStack/ros-galactic/issues/101 is just to use LD_PRELOAD:
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6 ros2 run rviz2 rviz2
for us it is working, not sure anyhow if it covers all the possible use cases.
gcc 12.1 is released now. PRs welcome
May the issue still be on Ubuntu 22.04 ? I just install and can't run gmsh. Only doing ' sudo gmsh' can launch gmsh. If I try 'gmsh' alone in the command line then I get the following error:
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
XRequest.151: BadMatch (invalid parameter attributes) 0x0
Segmentation fault
how to solve this ? do I need to go back to Ubuntu 20.04 ? thanks
@OlivierMiriel can you post you environment (i.e. the output of conda list?)
I am also facing the same issue. In fact, I read this thread and forcefully bumped up the gcc to 12.0.1 (Ubuntu 22.04 ships with 11.2.0). It did not fix it.
Would reinstalling 22.04 instead of updating to 22.04 from 20.04 help?
@ShantanuKodgirwar can you post your environment (i.e. the output of conda list?) and your exact error? Thanks!
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
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 https://github.com/RoboStack/ros-galactic/issues/101#issuecomment-1118735174 . However, I would kindly ask you to track your problem somewhere else, as it is not related to conda-forge, thanks!
I swapped up the environment with a conda environment and I face the same error.
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
?
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
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.
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
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.
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
As mentioned in https://github.com/conda-forge/ctng-compilers-feedstock/issues/95#issuecomment-1241891097 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?
$ conda list
#
_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
$ 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
te.py is the file with the code I mentioned in https://github.com/conda-forge/ctng-compilers-feedstock/issues/95#issuecomment-1374073080
@homerobse, you are not using conda-forge. Please open an issue with anaconda where you get the packages.
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.
Comment:
Solution to issue cannot be found in the documentation.
Issue
It seems that Ubuntu 22.04 doesn't play well with openGL from conda-forge.
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
Environment info
xref: https://github.com/conda-forge/matplotlib-feedstock/issues/318
My solution was to delete the files
And let things fall back on the the
libstdc++.so
provided by ubuntu. seems to work :/