# Problem with surface() when using plots.jl and gr() backend

**URL:** <https://discourse.julialang.org/t/problem-with-surface-when-using-plots-jl-and-gr-backend/81458>\
**Category:** General Usage\
**Tags:** plots, gr\
**Created:** [May 22, 2022, 9:30am UTC](https://discourse.julialang.org/t/problem-with-surface-when-using-plots-jl-and-gr-backend/81458 "2022-05-22T09:30:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcreel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mcreel/32/30088_2.png) [@mcreel](https://discourse.julialang.org/u/mcreel)\
**Post date:** [May 22, 2022, 9:30am UTC](https://discourse.julialang.org/t/problem-with-surface-when-using-plots-jl-and-gr-backend/81458/1 "2022-05-22T09:30:36Z")

</div>

I’m having a problem with a surface plot, using Plots.jl and the gr() backend. A minimal example is

```julia
using Plots
gr()
#plotlyjs()
x = range(0.9, length=100, stop=1.1)
y= range(0.9, length=100, stop=1.1)
p1 = surface(x, y, (x,y)->x+y)

```

with the plotlyjs() backend, the plot appears as expected, using the REPL, or VS Code. With the gr() backend, I get a crash out of julia, with the following message:

```julia
julia> include("MWE.jl")
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
X Error: BadMatch
  Request Major code 152 (GLX)
  Request Minor code 26 ()
  Error Serial #45
  Current Serial #45
❯ 

```

I am using Julia v1.7.2, GR v0.64.3, Plots v1.29.0. I recently installed and then removed Nvidia drivers. This is Debian testing. I’m not sure if this is a problem with my Linux installation, or with GR.

---

<div class="post-metadata">

**Author:** ![Paul\_Soderlind](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paul_soderlind/32/1753_2.png) [@Paul\_Soderlind](https://discourse.julialang.org/u/Paul_Soderlind)\
**Post date:** [May 22, 2022, 10:08am UTC](https://discourse.julialang.org/t/problem-with-surface-when-using-plots-jl-and-gr-backend/81458/2 "2022-05-22T10:08:54Z")

</div>

your example works on Win10, Julia 1.8.0-beta3

---

<div class="post-metadata">

**Author:** ![mcreel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mcreel/32/30088_2.png) [@mcreel](https://discourse.julialang.org/u/mcreel)\
**Post date:** [May 23, 2022, 5:02am UTC](https://discourse.julialang.org/t/problem-with-surface-when-using-plots-jl-and-gr-backend/81458/3 "2022-05-23T05:02:31Z")

</div>

A solution I found in another discourse thread is to copy the system libstdc++ over the one included with the Julia pre-compiled binary.

`cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 julia-1.8.0-beta3/lib/julia/`

---

<div class="post-metadata">

**Author:** ![jheinen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jheinen/32/2787_2.png) [@jheinen](https://discourse.julialang.org/u/jheinen)\
**Post date:** [May 23, 2022, 7:25am UTC](https://discourse.julialang.org/t/problem-with-surface-when-using-plots-jl-and-gr-backend/81458/4 "2022-05-23T07:25:36Z")

</div>

Could you please try

```julia
using GR
x = range(0.9, length=100, stop=1.1)
y= range(0.9, length=100, stop=1.1)
surface(x, y, (x,y)->x+y)

```

 ![Screenshot 2022-05-23 at 09.26.37](https://global.discourse-cdn.com/julialang/original/3X/5/0/5014bfb6fa5046896cbaf2f3ed47d133952041b4.png)

> `cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 julia-1.8.0-beta3/lib/julia/`

But this `cp` command doesn’t change anything in you Julia v1.7.2 environment!?

---

<div class="post-metadata">

**Author:** ![mcreel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mcreel/32/30088_2.png) [@mcreel](https://discourse.julialang.org/u/mcreel)\
**Post date:** [May 23, 2022, 7:49am UTC](https://discourse.julialang.org/t/problem-with-surface-when-using-plots-jl-and-gr-backend/81458/5 "2022-05-23T07:49:59Z")

</div>

Sorry, I have both 1.7.2 and 1.8.0-beta3 installed, and I switched between my messages. The problem occurs with both, and the solution fixes the problem for both. The code using GR directly without Plots has the same problem, and is fixed by copying the library. This is not a GR or Plot issue, I believe. I think (?) it has to do with libraries having been updated on my rolling release Linux (Debian testing). Thanks for GR.jl, love it!

I found the solution here: [GLIBCXX\_3.4.26 not found in RCall - #10 by laborg](https://discourse.julialang.org/t/glibcxx-3-4-26-not-found-in-rcall/29113/10)
