thliebig / AppCSXCAD

Minimal GUI Application using the QCSXCAD library.
http://openEMS.de
GNU General Public License v3.0
6 stars 12 forks source link

"vtkGenericOpenGLRenderWindow: GLEW could not be initialized: Unknown Error" on Wayland #11

Open biergaizi opened 1 month ago

biergaizi commented 1 month ago

If running under Wayland, vtkGenericOpenGLRenderWindow cannot be initialized and fails with an error message "GLEW could not be initialized: Unknown Error". This is caused by an known Wayland incompatibility issue in the upstream GLEW project, and is already known to affect 20+ GLEW-based downstream projects, including VTK, see [1] for details.

The root cause is that GLEW's glewInit() attempts to use GLX, which is nonexistent on Wayland. I've reported the problem to the upstream as [2]. Fortunately, it's easy to work around the problem - just ignore the error code GLEW_ERROR_NO_GLX_DISPLAY, and GLEW will otherwise work without problems. This requires a fix in the upstream VTK code, and I plan to submit a patch soon.

For now, AppCSXCAD under Wayland can use:

env WAYLAND_DISPLAY= /path/to/application/you/want/to/run

to force-run AppCSXCAD under XWayland instead.

For documentation propose, keep this bug open until it's fixed upstream.

[1] https://github.com/nigels-com/glew/issues/172 [2] https://gitlab.kitware.com/vtk/vtk/-/issues/19357

biergaizi commented 1 month ago

Patch submitted to VTK upstream: