How to run a Julia page example using GLMakie?

I just can’t run the example available here
https://juliadynamics.github.io/InteractiveDynamics.jl/dev/cobweb/

I copied and pasted this code and when I run it doesn’t work. I’ve already tried ]build GLMakie .

using InteractiveDynamics, GLMakie, DynamicalSystems

# the second range is a convenience for intermittency example of logistic
rrange = 1:0.001:4.0
# rrange = (rc = 1 + sqrt(8); [rc, rc - 1e-5, rc - 1e-3])

lo = Systems.logistic(0.4; r=rrange[1])

interactive_cobweb(lo, rrange, 5)

This should return me an interactive diagram, but appears to me:

ERROR: LoadError: No backend available (GLMakie, CairoMakie, WGLMakie)!
Maybe you imported GLMakie but it didn't build correctly.
In that case, try `]build GLMakie` and watch out for any warnings.
If that's not the case, make sure to explicitely import any of the mentioned backends.

Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] backend_display(#unused#::Missing, #unused#::Scene)
   @ Makie ~/.julia/packages/Makie/c5WJV/src/display.jl:43
 [3] display
   @ ~/.julia/packages/Makie/c5WJV/src/display.jl:62 [inlined]
 [4] display
   @ ~/.julia/packages/Makie/c5WJV/src/display.jl:52 [inlined]
 [5] interactive_cobweb(ds::DiscreteDynamicalSystem{false, Float64, 1, typeof(DynamicalSystemsBase.Systems.logistic_rule), Vector{Float64}, typeof(DynamicalSystemsBase.Systems.logistic_jacob), Float64, false}, prange::StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, O::Int64; fkwargs::Vector{NamedTuple{(:linewidth, :color), Tuple{Float64, ColorTypes.RGBA{Float32}}}}, trajcolor::Symbol, pname::String, xmin::Float64, xmax::Float64, Tmax::Int64, pindex::Int64, x0s::StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}})
   @ InteractiveDynamics ~/.julia/packages/InteractiveDynamics/rKq1q/src/chaos/cobweb.jl:132
 [6] interactive_cobweb(ds::DiscreteDynamicalSystem{false, Float64, 1, typeof(DynamicalSystemsBase.Systems.logistic_rule), Vector{Float64}, typeof(DynamicalSystemsBase.Systems.logistic_jacob), Float64, false}, prange::StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, O::Int64)
   @ InteractiveDynamics ~/.julia/packages/InteractiveDynamics/rKq1q/src/chaos/cobweb.jl:36
 [7] top-level scope
   @ ~/Disciplinas/Dinâmica de Sistemas Não-lineares/exemplo_cobweb.jl:11
 [8] include(fname::String)
   @ Base.MainInclude ./client.jl:444
 [9] top-level scope
   @ REPL[5]:1
in expression starting at /home

I’ve already tried ]add GLMakie, Makie, CairoMakie.; update my packages using the update command from the package manager prompt; in the main Julia project, type using Pkg; Pkg.precompile().
What can I do?

The error message suggests trying ]build GLMakie, did that produce any errors or warnings?

What is the output of ]st?

This example works for me in this temporary environment:

(@v1.6) pkg> activate --temp
  Activating new environment at `/tmp/jl_B4xk0q/Project.toml`

(jl_B4xk0q) pkg> add InteractiveDynamics GLMakie DynamicalSystems

<snip installation>

(jl_B4xk0q) pkg> st
      Status `/tmp/jl_B4xk0q/Project.toml`
  [61744808] DynamicalSystems v2.0.1
  [e9467ef8] GLMakie v0.4.4
  [ec714cd0] InteractiveDynamics v0.17.2

Yes, I’ve already tried ]build GLMakie.
Here is the output of ]st:

Now I realized that GLMakie was for some reason out of date. So I typed add WebIO#master and updated everything and now GLMakie is updated to version 0.4.4.
However it is still giving the following problem:

 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/Makie.jl/tree/master/GLMakie#troubleshooting-opengl.
└ @ GLMakie ~/.julia/packages/GLMakie/rXGL8/src/screen.jl:336
ERROR: LoadError: GLFWError (API_UNAVAILABLE): GLX: No GLXFBConfigs returned
Stacktrace:```

You probably need to restart Julia after doing that update.

Yes, I restarted Julia. I even restarted my computer.

Huh, I may be out of ideas then. Can you run other OpenGL tools outside of Julia? Maybe glxgears?

Yes!

1 Like

OK, that’s a start! How about the output of these 2 commands:

$ glxinfo -B

The important line from this one is “OpenGL core profile version string”, that is the one that must be 3.3 or greater as described in the error message you got.

and

$ glxinfo | grep GLXFB

I get 311 GLXFBConfigs: for this one, I suspect any non-empty output is good.

If both of these look good, then I am out of ideas. If one of these is off, then you may need to investigate newer drivers or newer hardware.

So I think you must be out of ideas, because it looks like it’s ok.

This discussion looks relevant, perhaps something here might help:

https://github.com/JuliaGL/GLFW.jl/issues/194

https://github.com/JuliaPackaging/Yggdrasil/pull/3192

I will read. Thank you very much!