Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GLMakie errors in interactive mode after immediate use of a figure #4638

Open
3 tasks done
jakubkaczor opened this issue Dec 1, 2024 · 5 comments
Open
3 tasks done
Labels

Comments

@jakubkaczor
Copy link

jakubkaczor commented Dec 1, 2024

GLMakie errors if Figure is used immediately after creation in interactive mode. The following pasted into the interpreter errors, what is unexpected.

using GLMakie
fig = Figure()
Axis(fig[1, 1])  # Raises the error

The following pasted to the interpreter does not error.

using GLMakie
fig = Figure();
Axis(fig[1, 1])
Error output with the stacktrace
ERROR: glGenBuffers returned invalid id. OpenGL Context active?
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] glGenBuffers
    @ ~/.local/share/julia/packages/GLMakie/xG4T9/src/GLAbstraction/GLExtendedFunctions.jl:112
  [3] glGenBuffers
    @ ~/.local/share/julia/packages/GLMakie/xG4T9/src/GLAbstraction/GLExtendedFunctions.jl:108 [inlined]
  [4] GLBuffer
    @ ~/.local/share/julia/packages/GLMakie/xG4T9/src/GLAbstraction/GLBuffer.jl:11
  [5] #GLBuffer#13
    @ ~/.local/share/julia/packages/GLMakie/xG4T9/src/GLAbstraction/GLBuffer.jl:57 [inlined]
  [6] GLBuffer
    @ ~/.local/share/julia/packages/GLMakie/xG4T9/src/GLAbstraction/GLBuffer.jl:52 [inlined]
  [7] #_#9
    @ ~/.local/share/julia/packages/GLMakie/xG4T9/src/GLAbstraction/AbstractGPUArray.jl:194 [inlined]
  [8] GPUArray
    @ ~/.local/share/julia/packages/GLMakie/xG4T9/src/GLAbstraction/AbstractGPUArray.jl:193 [inlined]
  [9] #gl_convert#74
    @ ~/.local/share/julia/packages/GLMakie/xG4T9/src/GLAbstraction/GLUniforms.jl:262 [inlined]
 [10] gl_convert
    @ ~/.local/share/julia/packages/GLMakie/xG4T9/src/GLAbstraction/GLUniforms.jl:259
 [11] RenderObject
    @ ~/.local/share/julia/packages/GLMakie/xG4T9/src/GLAbstraction/GLTypes.jl:373
 [12] RenderObject
    @ ~/.local/share/julia/packages/GLMakie/xG4T9/src/GLAbstraction/GLTypes.jl:346
 [13] assemble_shader
    @ ~/.local/share/julia/packages/GLMakie/xG4T9/src/glshaders/visualize_interface.jl:108
 [14] draw_mesh
    @ ~/.local/share/julia/packages/GLMakie/xG4T9/src/glshaders/mesh.jl:72
 [15] mesh_inner
    @ ~/.local/share/julia/packages/GLMakie/xG4T9/src/drawing_primitives.jl:776
 [16] #315
    @ ~/.local/share/julia/packages/GLMakie/xG4T9/src/drawing_primitives.jl:783
 [17] #213
    @ ~/.local/share/julia/packages/GLMakie/xG4T9/src/drawing_primitives.jl:337
 [18] get!
    @ ./dict.jl:458
 [19] cached_robj!
    @ ~/.local/share/julia/packages/GLMakie/xG4T9/src/drawing_primitives.jl:235
 [20] draw_atomic
    @ ~/.local/share/julia/packages/GLMakie/xG4T9/src/drawing_primitives.jl:780
 [21] insert!
    @ ~/.local/share/julia/packages/GLMakie/xG4T9/src/drawing_primitives.jl:353
 [22] #233
    @ ~/.local/share/julia/packages/GLMakie/xG4T9/src/drawing_primitives.jl:358 [inlined]
 [23] foreach
    @ ./abstractarray.jl:3187
 [24] insert!
    @ ~/.local/share/julia/packages/GLMakie/xG4T9/src/drawing_primitives.jl:355
 [25] #invokelatest#2
    @ ./essentials.jl:1055 [inlined]
 [26] invokelatest
    @ ./essentials.jl:1052 [inlined]
 [27] push!
    @ ~/.local/share/julia/packages/Makie/pFPBw/src/scenes.jl:492
 [28] plot!
    @ ~/.local/share/julia/packages/Makie/pFPBw/src/interfaces.jl:413
 [29] _create_plot!
    @ ~/.local/share/julia/packages/Makie/pFPBw/src/figureplotting.jl:391
 [30] #poly!#60
    @ ~/.local/share/julia/packages/MakieCore/zO6H4/src/recipes.jl:505 [inlined]
 [31] poly!
    @ ~/.local/share/julia/packages/MakieCore/zO6H4/src/recipes.jl:503 [inlined]
 [32] #initialize_block!#1644
    @ ~/.local/share/julia/packages/Makie/pFPBw/src/makielayout/blocks/axis.jl:191
 [33] initialize_block!
    @ ~/.local/share/julia/packages/Makie/pFPBw/src/makielayout/blocks/axis.jl:150
 [34] #_block#1437
    @ ~/.local/share/julia/packages/Makie/pFPBw/src/makielayout/blocks.jl:371
 [35] _block
    @ ~/.local/share/julia/packages/Makie/pFPBw/src/makielayout/blocks.jl:291 [inlined]
 [36] #_block#1436
    @ ~/.local/share/julia/packages/Makie/pFPBw/src/makielayout/blocks.jl:259
 [37] _block
    @ ~/.local/share/julia/packages/Makie/pFPBw/src/makielayout/blocks.jl:258
 [38] #_block#1435
    @ ~/.local/share/julia/packages/Makie/pFPBw/src/makielayout/blocks.jl:253
 [39] _block
    @ ~/.local/share/julia/packages/Makie/pFPBw/src/makielayout/blocks.jl:246 [inlined]
 [40] #_#1434
    @ ~/.local/share/julia/packages/Makie/pFPBw/src/makielayout/blocks.jl:237 [inlined]
 [41] Axis(args::GridPosition)
    @ Makie ~/.local/share/julia/packages/Makie/pFPBw/src/makielayout/blocks.jl:236
 [42] top-level scope
    @ REPL[3]:

  • what version of Makie are you running? (]st -m Makie)
    Makie: v0.21.16, GLMakie: v0.10.16, Julia: 1.11.1
  • can you reproduce the bug with a fresh environment ? (]activate --temp; add Makie)
  • What platform + GPU are you on?
    Platform: Arch Linux using Hyprland, installed with home-manager, and run with NixGL. GPU: AMD Ryzen 5 5600U integrated GPU.
@jakubkaczor jakubkaczor added the bug label Dec 1, 2024
@SimonDanisch
Copy link
Member

Does this happen every time?
I can't reproduce this.

@jakubkaczor
Copy link
Author

jakubkaczor commented Dec 2, 2024

I tried around a dozen of times executing once in a new REPL, and it happened every time. I didn't yet manage to make this not to error. Executing in the same REPL for the second time crashes the interpreter on the same line with

a different output.

X Error:  BadAccess
  Request Major code 150 (GLX)
  Request Minor code 5 ()
  Error Serial #493
  Current Serial #493

Furthermore, I also reproduced it with ]activate --temp; add GLMakie and julia --startup-file=no. After finishing execution of the second snippet in the original post, evaluating fig gives results as expected. Therefore, I suspect this is some race condition problem.

@jakubkaczor
Copy link
Author

The (GLX) in the different output in my previous reply surprised me, as I run Wayland. I confirmed with xeyes program, that the window spawned by the working Julia code is run in XWayland.

@jakubkaczor
Copy link
Author

jakubkaczor commented Dec 2, 2024

In Makie's documentation I found the information that “the underlying GLFW library is not compiled with Wayland support”, so GLX is no more surprising. Despite, I don't expect reported behavior even with XWayland.

@jakubkaczor
Copy link
Author

I am not sure, but perhaps solving #3674 would also solve this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants