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

**URL:** <https://discourse.julialang.org/t/libgl-error-mesa-after-unintended-plots-update/48265>\
**Category:** General Usage\
**Created:** [October 13, 2020, 12:09am UTC](https://discourse.julialang.org/t/libgl-error-mesa-after-unintended-plots-update/48265 "2020-10-13T00:09:48Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [October 13, 2020, 12:09am UTC](https://discourse.julialang.org/t/libgl-error-mesa-after-unintended-plots-update/48265/1 "2020-10-13T00:09:48Z")

</div>

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
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?

---

<div class="post-metadata">

**Author:** ![tomaklutfu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomaklutfu/32/2411_2.png) [@tomaklutfu](https://discourse.julialang.org/u/tomaklutfu)\
**Post date:** [October 13, 2020, 7:04am UTC](https://discourse.julialang.org/t/libgl-error-mesa-after-unintended-plots-update/48265/2 "2020-10-13T07:04:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [October 13, 2020, 9:58am UTC](https://discourse.julialang.org/t/libgl-error-mesa-after-unintended-plots-update/48265/3 "2020-10-13T09:58:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [October 13, 2020, 3:01pm UTC](https://discourse.julialang.org/t/libgl-error-mesa-after-unintended-plots-update/48265/4 "2020-10-13T15:01:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tomaklutfu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomaklutfu/32/2411_2.png) [@tomaklutfu](https://discourse.julialang.org/u/tomaklutfu)\
**Post date:** [October 13, 2020, 5:07pm UTC](https://discourse.julialang.org/t/libgl-error-mesa-after-unintended-plots-update/48265/5 "2020-10-13T17:07:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![moudbis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/moudbis/32/8046_2.png) [@moudbis](https://discourse.julialang.org/u/moudbis)\
**Post date:** [January 15, 2021, 8:09pm UTC](https://discourse.julialang.org/t/libgl-error-mesa-after-unintended-plots-update/48265/6 "2021-01-15T20:09:23Z")

</div>

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 !

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [January 15, 2021, 8:26pm UTC](https://discourse.julialang.org/t/libgl-error-mesa-after-unintended-plots-update/48265/7 "2021-01-15T20:26:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![amir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amir/32/22820_2.png) [@amir](https://discourse.julialang.org/u/amir)\
**Post date:** [March 12, 2021, 7:22pm UTC](https://discourse.julialang.org/t/libgl-error-mesa-after-unintended-plots-update/48265/8 "2021-03-12T19:22:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Patriarca](https://avatars.discourse-cdn.com/v4/letter/p/b5e925/32.png) [@Patriarca](https://discourse.julialang.org/u/Patriarca)\
**Post date:** [October 27, 2022, 3:19pm UTC](https://discourse.julialang.org/t/libgl-error-mesa-after-unintended-plots-update/48265/9 "2022-10-27T15:19:08Z")

</div>

Thank you very much for the solution, this solved also my problem, I had forgotten that I had made a change of Nvidia drivers!
