libGL error: MESA... after (unintended) Plots update

Today, after installing some new packages (Ipopt and JuMP), for some reason Plots got updated as well. After that, every time I plot something, I get these errors. Any tip on how to get rid of them? (the plots themselves continue to appear, for now).

julia> libGL error: MESA-LOADER: failed to open iris (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: iris
libGL error: MESA-LOADER: failed to open iris (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: iris
libGL error: MESA-LOADER: failed to open swrast (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: swrast

Additional question: how to prevent Plots from getting updated when I install some other package, particularly does which do not have Plots as a dependency?

It may be that julia's libstdc++ is not compatible with the graphic driver’s. You may safely delete or rename /path-to-julia/lib/julia/libstdc++.so.6 and try again plotting. Maybe you switched to another graphic driver and you get this, not that because Plots.jl is updated. Anyway, you can use Pkg.pin or ]pin command to restrict a package’s version.

2 Likes

Thank you for the insight. Yet, I was in the same Julia section when that happened, that is not something that happened with opening/closing/updating systems, in between. Of course, it is hard to reproduce the exact state of things here, but as much as I recall, I was plotting normally, then I installed JuMP and Ipopt, and the next time I tried to plot, Plots got recompiled and the error started to appear.

I updated all the system (which included an update to a Nvidia driver), rebooted, and the problem is gone.

This issues is well known problem. It can relapse when the builtin graphics driver(mesa) is used again such as if Nvidia driver is in on-demand mode and you can face it intermittently. The only known solution is just to use system provided stdc++ library rather than old stdc++ in julia’s library folder.

2 Likes

I had the same issue after the update of my ubuntu distribution to 20.04 and the update of MESA driver for intel graphics and your solution worked, thanks !

Note that replacing Julia’s libstdc++ shouldn’t be necessary with Julia v1.6

2 Likes

Thanks a lot. It solved my issue, as well.