moderngl: Wayland: Context creation failed
Upgrading from moderngl 5.5.3 to 5.6.4
Traceback (most recent call last):
File "/home/istvan/Work/Mollia/mollia_window_linux/test_main_window_mouse.py", line 7, in <module>
ctx = mgl.create_context()
File "/home/istvan/.local/lib/python3.10/site-packages/moderngl/context.py", line 1619, in create_context
ctx.mglo, ctx.version_code = mgl.create_context(glversion=require, mode=mode, **settings)
File "/home/istvan/.local/lib/python3.10/site-packages/glcontext/__init__.py", line 93, in create
return x11.create_context(**kwargs)
Exception: (detect) glXGetCurrentContext: cannot detect OpenGL context
Linux fedora 5.17.12-300.fc36.x86_64 #1 SMP PREEMPT Mon May 30 16:56:53 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 20 (12 by maintainers)
UPDATE: The problem seems to be Wayland related. No crash on X11 session.
just tested it: version 6.0 from the main branch (commit e175d069a13fd7bbc38e34fb8cfce447d91e0ff5) works on wayland !
I have errors on some buffer creation I did not had before, meaning moderngl 6 is less forgiving than 5, anyway I will easily fix that:
For the moment, I think using the main branch of moderngl is fine. I will tell the madcad users to do so as well if they need to run on wayland. Anyway, since moderngl 6 is a major, I will only bump the minimum moderngl required in my projects when you will have introduced the breaking changes.
Thanks for having fixed this and for the quick answers !
I will add an issue for this, I already solved this for zengl, basically
C-contiguous
is not required. When not provided a copy is created temporarily, it is up to the user to provide contig memory to avoid the copy. It is fast anyways.This is only what changed regarding the context management.
The new way we detect opengl contexts is trying for egl and falls back for x11. I reopen the issue until we fix it for your case.
https://github.com/moderngl/moderngl/issues/650
Any news on this ? I get the same error on debian 12 using wayland, and likewise no problem using Xorg (of course xorg tends to be deprecated so I would like not to use it)