# Makie live animation not working

**URL:** <https://discourse.julialang.org/t/makie-live-animation-not-working/63353>\
**Category:** General Usage\
**Tags:** makie\
**Created:** [June 22, 2021, 10:33am UTC](https://discourse.julialang.org/t/makie-live-animation-not-working/63353 "2021-06-22T10:33:54Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![peteole](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/peteole/32/209790_2.png) [@peteole](https://discourse.julialang.org/u/peteole)\
**Post date:** [June 22, 2021, 10:33am UTC](https://discourse.julialang.org/t/makie-live-animation-not-working/63353/1 "2021-06-22T10:33:54Z")

</div>

Hi,  
I am trying to visualize a simulation live in makie.  
However my plot is not updated in VSCode when the observable it depends on is changed. The following is my code:

```julia
function getStickPositions(c::Config)
    unitVectorAlongStick=[cos(c.ϕ),sin(c.ϕ)];
    leftPos=c.Rg-l/2*unitVectorAlongStick;
    rightPos=c.Rg+l/2*unitVectorAlongStick;
    return [[leftPos[1],rightPos[1]],[leftPos[2],rightPos[2]]]
end
currentConfig=Node(Config([0,1],0.1,[0,0],0));
fig=CairoMakie.Figure()
axis=Axis(fig[1, 1])
xlims!(axis,(-3,3))
ylims!(axis,(-1,3))
axis.aspect=DataAspect()
xPosObs=lift(c->getStickPositions(c)[1],currentConfig)
yPosObs=lift(c->getStickPositions(c)[2],currentConfig)
#drawConfig(fig,currentConfig)
Makie.lines!(axis,xPosObs,yPosObs)
display(fig)

fps = 20
nframes = 120

for i=1:nframes
    currentConfig[]=updateConfig(currentConfig[],1/fps)
    sleep(1/fps)
end

```

A “Config” is a state in the simulation which can be drawn. “updateConfig” implements the update logic for the simulation.

Once I type “fig” in the terminal, the correct figure is plotted again. However the existing is not updated when the observable it depends on changes.  
What’s going wring here?

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [June 22, 2021, 11:03am UTC](https://discourse.julialang.org/t/makie-live-animation-not-working/63353/2 "2021-06-22T11:03:26Z")

</div>

Cairomakie makes static pngs or svgs that are then shown in the vscode plot pane. Changing an observable updates the relevant axis / figure state but it neither causes a new representation of the figure to be shown, nor is the CairoMakie output in any way backlinked to the figure. The backends that can update displayed figures are GLMakie and WGLMakie. Glmakie uses native windows, wglmakie can be embedded in web contexts, so it should in principle also work in VSCode. But it’s the least polished of the three backends currently

---

<div class="post-metadata">

**Author:** ![peteole](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/peteole/32/209790_2.png) [@peteole](https://discourse.julialang.org/u/peteole)\
**Post date:** [June 22, 2021, 12:51pm UTC](https://discourse.julialang.org/t/makie-live-animation-not-working/63353/3 "2021-06-22T12:51:45Z")

</div>

Ok, that makes sense, thank you!  
Unfortunately I do get a strange error when trying GLMakie:

```julia
libGL error: MESA-LOADER: failed to open radeonsi: /usr/bin/../lib/julia/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /usr/lib/dri/radeonsi_dri.so) (search paths /usr/lib/dri)
libGL error: failed to load driver: radeonsi
libGL error: MESA-LOADER: failed to open radeonsi: /usr/bin/../lib/julia/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /usr/lib/dri/radeonsi_dri.so) (search paths /usr/lib/dri)
libGL error: failed to load driver: radeonsi
libGL error: MESA-LOADER: failed to open swrast: /usr/bin/../lib/julia/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /usr/lib/dri/swrast_dri.so) (search paths /usr/lib/dri)
libGL error: failed to load driver: swrast
┌ Warning: GLFW couldn't create an OpenGL window.
│ This likely means, you don't have an OpenGL capable Graphic Card,
│ or you don't have an OpenGL 3.3 capable video driver installed.
│ Have a look at the troubleshooting section in the GLMakie readme:
│ https://github.com/JuliaPlots/GLMakie.jl#troubleshooting-opengl.
└ @ GLMakie ~/.julia/packages/GLMakie/rcykA/src/screen.jl:324
ERROR: LoadError: GLFWError (VERSION_UNAVAILABLE): GLX: Failed to create context: GLXBadFBConfig
Stacktrace:
  [1] _ErrorCallbackWrapper(code::Int32, description::Cstring)
    @ GLFW ~/.julia/packages/GLFW/BWxfF/src/callback.jl:43
  [2] CreateWindow(width::Int64, height::Int64, title::String, monitor::GLFW.Monitor, share::GLFW.Window)
    @ GLFW ~/.julia/packages/GLFW/BWxfF/src/glfw3.jl:499
  [3] GLFW.Window(; name::String, resolution::Tuple{Int64, Int64}, debugging::Bool, major::Int64, minor::Int64, windowhints::Vector{Tuple{UInt32, Integer}}, contexthints::Vector{Tuple{UInt32, Integer}}, visible::Bool, focus::Bool, fullscreen::Bool, monitor::Nothing, share::GLFW.Window)
    @ GLFW ~/.julia/packages/GLFW/BWxfF/src/glfw3.jl:344
  [4] GLMakie.Screen(; resolution::Tuple{Int64, Int64}, visible::Bool, title::String, kw_args::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ GLMakie ~/.julia/packages/GLMakie/rcykA/src/screen.jl:316
  [5] Screen
    @ ~/.julia/packages/GLMakie/rcykA/src/screen.jl:289 [inlined]
  [6] global_gl_screen
    @ ~/.julia/packages/GLMakie/rcykA/src/screen.jl:235 [inlined]
  [7] global_gl_screen(resolution::Tuple{Int64, Int64}, visibility::Bool, tries::Int64)
    @ GLMakie ~/.julia/packages/GLMakie/rcykA/src/screen.jl:382
  [8] global_gl_screen
    @ ~/.julia/packages/GLMakie/rcykA/src/screen.jl:381 [inlined]
  [9] backend_display
    @ ~/.julia/packages/GLMakie/rcykA/src/display.jl:2 [inlined]
 [10] display(scene::Scene)
    @ AbstractPlotting ~/.julia/packages/AbstractPlotting/M8Nlv/src/display.jl:61
 [11] display(fig::Figure)
    @ AbstractPlotting ~/.julia/packages/AbstractPlotting/M8Nlv/src/display.jl:51
 [12] top-level scope
    @ ~/Documents/Studium/Semester2/EM2/HW/04/simulation.jl:76
in expression starting at /home/olep/Documents/Studium/Semester2/EM2/HW/04/simulation.jl:76

```

(I’m on manjaro linux)  
Do you also have an idea how to fix this?

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [June 22, 2021, 2:37pm UTC](https://discourse.julialang.org/t/makie-live-animation-not-working/63353/4 "2021-06-22T14:37:16Z")

</div>

Maybe google around for that one, I’m not a Linux user, sorry. It seems to me that I’ve seen similar things quite often, there’s some libc issue I think or sometimes graphics driver issues.

---

<div class="post-metadata">

**Author:** ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Post date:** [June 22, 2021, 3:28pm UTC](https://discourse.julialang.org/t/makie-live-animation-not-working/63353/5 "2021-06-22T15:28:21Z")

</div>

> [@peteole](#):
>
> ```julia
> ┌ Warning: GLFW couldn't create an OpenGL window.
> │ This likely means, you don't have an OpenGL capable Graphic Card,
> │ or you don't have an OpenGL 3.3 capable video driver installed.
> │ Have a look at the troubleshooting section in the GLMakie readme:
> │ https://github.com/JuliaPlots/GLMakie.jl#troubleshooting-opengl.
> └ @ GLMakie ~/.julia/packages/GLMakie/rcykA/src/screen.jl:324
> 
> ```

Seems like your system doesn’t have drivers installed - Are you on a headless machine without a graphics card?

---

<div class="post-metadata">

**Author:** ![peteole](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/peteole/32/209790_2.png) [@peteole](https://discourse.julialang.org/u/peteole)\
**Post date:** [June 22, 2021, 4:18pm UTC](https://discourse.julialang.org/t/makie-live-animation-not-working/63353/6 "2021-06-22T16:18:25Z")

</div>

No, it’s a laptop and all other graphics work perfectly…

---

<div class="post-metadata">

**Author:** ![ellocco](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ellocco/32/31331_2.png) [@ellocco](https://discourse.julialang.org/u/ellocco)\
**Post date:** [February 7, 2023, 5:16pm UTC](https://discourse.julialang.org/t/makie-live-animation-not-working/63353/7 "2023-02-07T17:16:22Z")

</div>

I am facing the same problem on ubuntu 22.04. On the Makie homepage I was not able to find advice ☹  
I am hesitating to follow the instructions from this site: [A Beginner’s Guide to Setup OpenGL in Linux](https://medium.com/geekculture/a-beginners-guide-to-setup-opengl-in-linux-debian-2bfe02ccd1e)  
Is there some official advice to handle this issue?

---

<div class="post-metadata">

**Author:** ![Jeff\_Emanuel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeff_emanuel/32/15440_2.png) [@Jeff\_Emanuel](https://discourse.julialang.org/u/Jeff_Emanuel)\
**Post date:** [February 7, 2023, 5:22pm UTC](https://discourse.julialang.org/t/makie-live-animation-not-working/63353/8 "2023-02-07T17:22:45Z")

</div>

Here’s an easy step that may get you going in the right direction:

> <https://askubuntu.com/questions/47062/terminal-command-to-show-opengl-version>

---

<div class="post-metadata">

**Author:** ![ellocco](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ellocco/32/31331_2.png) [@ellocco](https://discourse.julialang.org/u/ellocco)\
**Post date:** [February 7, 2023, 5:43pm UTC](https://discourse.julialang.org/t/makie-live-animation-not-working/63353/9 "2023-02-07T17:43:11Z")

</div>

Thanks! 🙂 Just now I managed also to get it into operation, see:  
[OpenGL/GLFW error building GLMakie](https://discourse.julialang.org/t/opengl-glfw-error-building-glmakie/47598/10)

---

<div class="post-metadata">

**Author:** ![ellocco](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ellocco/32/31331_2.png) [@ellocco](https://discourse.julialang.org/u/ellocco)\
**Post date:** [February 7, 2023, 6:25pm UTC](https://discourse.julialang.org/t/makie-live-animation-not-working/63353/10 "2023-02-07T18:25:36Z")

</div>

> [@Jeff\_Emanuel](#):
>
> Here’s an easy step that may get you going in the right direction:

Maybe for someone more skilled than me. What kind of information do you consider valuable on this link for Julia users on an Ubuntu machine using `VScode`?

---

<div class="post-metadata">

**Author:** ![Jeff\_Emanuel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeff_emanuel/32/15440_2.png) [@Jeff\_Emanuel](https://discourse.julialang.org/u/Jeff_Emanuel)\
**Post date:** [February 7, 2023, 8:31pm UTC](https://discourse.julialang.org/t/makie-live-animation-not-working/63353/11 "2023-02-07T20:31:52Z")

</div>

Your problem earlier was GLFW not finding OpenGL. The error message suggested lack of either hardware or drivers. The glxinfo would tell you whether there’s an OpenGL available and what it’s version is. The version may be to low, so a driver update may be necessary. Or it might be due to discrete graphics vs CPU graphics, the latter of which used to support only lower versions of OpenGL. In that case you might need to update the configuration of which hardware each process uses. Or it might tell you there’s no OpenGL at all. In that case, if you know that you should have the hardware, then you should look for installing the necessary driver for OpenGL support.

---

<div class="post-metadata">

**Author:** ![ellocco](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ellocco/32/31331_2.png) [@ellocco](https://discourse.julialang.org/u/ellocco)\
**Post date:** [February 7, 2023, 9:43pm UTC](https://discourse.julialang.org/t/makie-live-animation-not-working/63353/12 "2023-02-07T21:43:25Z")

</div>

Thanks for your answer! - I still do not know how to cure the issue under VScode after the reading  
of this thread.  
I have the impression that this is simply a bug. The package GLFW.jl shows similar problems.  
The trouble maker is the library `libstdc++.so.6`. The way I see it, is: During the installation a wrong version of this file is installed.

---

<div class="post-metadata">

**Author:** ![aramirezreyes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aramirezreyes/32/42573_2.png) [@aramirezreyes](https://discourse.julialang.org/u/aramirezreyes)\
**Post date:** [February 7, 2023, 10:08pm UTC](https://discourse.julialang.org/t/makie-live-animation-not-working/63353/13 "2023-02-07T22:08:38Z")

</div>

This info is on the [Makie README](https://github.com/MakieOrg/Makie.jl/blob/d49d936e9396fbb03424c8e9f4e976449b0d71a6/GLMakie/README.md), I wonder if it is useful for your case. Do you have AMD graphiscs?

> If you’re using an AMD or Intel gpu on linux, you may run into [GLFW#198](https://github.com/JuliaGL/GLFW.jl/issues/198). A potential fix is then to delete `libstdc++.so.6`. An example path to this file on a system using `juliaup` and version `1.8.2` is `/home/username/.julia/juliaup/julia-1.8.2+0.x64/lib/julia/libstdc++.so.6`.

Other option is to use julia v1.9 latest beta which I think has the issue resolved. Other options are discussed here. [https://github.com/JuliaGL/GLFW.jl/issues/198](https://github.com/JuliaGL/GLFW.jl/issues/198)
