Crashes when requested OpenGL context cannot be created
See original GitHub issueHello!
On a system with limited OpenGL support (specifically, in an X2go session without OpenGL core and ES3 profiles), PyVista (VTK?) doesn’t gracefully handle this lack of advanced technologies and crashes.
To Reproduce
On a Linux system with the following glxinfo |grep OpenGL
output:
OpenGL vendor string: Mesa/X.org
OpenGL renderer string: llvmpipe (LLVM 12.0.0, 256 bits)
OpenGL version string: 3.1 Mesa 21.0.3
OpenGL shading language version string: 1.40
OpenGL context flags: (none)
OpenGL extensions:
(core and ES profiles missing), the following code snippets:
from pyvista import GPUInfo
GPUInfo()
from pyvista.utilities import check_depth_peeling
check_depth_peeling()
both result in:
2022-02-07 14:49:00.635 ( 15.831s) [ E0112740]vtkXOpenGLRenderWindow.:266 ERR| vtkXOpenGLRenderWindow (0x55935b917270): Could not find a decent config
ERROR:root:Could not find a decent config
2022-02-07 14:49:00.636 ( 15.832s) [ E0112740]vtkXOpenGLRenderWindow.:484 ERR| vtkXOpenGLRenderWindow (0x55935b917270): Could not find a decent visual
ERROR:root:Could not find a decent visual
[1] 2925781 abort (core dumped)
According to the docs, depth peeling requires ES3, which isn’t supported on this system.
I can reproduce this crash on the VTK level alone:
import vtk
w = vtk.vtkRenderWindow()
w.Render()
Expected behavior would be for things not to crash.
System Information:
# Get system info
import pyvista as pv
print(pv.Report())
Unfortunately, running this code leads to the same crash as reported above.
I’m using pyvista
0.7 with vtk
9.1.0 from conda-forge
(their qt
build variant; see recipe)
I verified that the installation itself is working in principle by running the above commands via X11 forwarding through SSH (ssh -X
), and everything works as expected.
It should also be noted that rather complex 3D visualizations can be produced (tested with MNE-Python’s Coregistration UI, which generates an interactive skull surface with numerous overlays) as long as I don’t try to enable depth peeling (probably requesting other “advanced” features would produce the same issues; I’m just reporting here what I experienced so far 😃)
Any advice would be greatly appreciated!
Thanks, Richard
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:20 (14 by maintainers)
Top GitHub Comments
@GuillaumeFavelier Unfortunately, this produces the same error as soon as
Render
is called (usingconda-forge
’sqt
build of VTK (i.e., no OSMesa support)What I found in
vtkOpenGLRenderWindow.cxx
in the functionReportCapabilities()
is strangely similar to the gist 😄https://github.com/Kitware/VTK/blob/master/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx#L261-L293
So I made another gist:
https://gist.github.com/GuillaumeFavelier/02d7a51ef6aba3cae449bd33777d2c1d
This is what I have on my system:
Feel free to try it @hoechenberger