Closed chrishavlin closed 1 year ago
Quick thought -- could we stick a try/except to and output a pointer to these docs if it crashes? Or is the crash too broad?
oh that's a nice thought! It should be possible. The error is pretty general (OpenGL.error.Error), but maybe I could filter for the error message too ("Attempt to retrieve context when no valid context")? Lemme try...
hey that works pretty nicely. never had reason to use the raise Exception(...) from ...
syntax before :)
Lemme know if you want to modify the message, but right now the end of the stack trace will be:
in getContext
raise error.Error(
OpenGL.error.Error: Attempt to retrieve context when no valid context
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/chavlin/src/yt_general/yt_idv/examples/amr_volume_rendering.py", line 7, in <module>
rc = yt_idv.render_context(height=800, width=800, gui=True)
File "/home/chavlin/src/yt_general/yt_idv/yt_idv/rendering_contexts/__init__.py", line 33, in render_context
raise Exception(extramsg) from oee
Exception: It looks like you have encountered an OpenGL context error while trying to start the GUI. If you are running headless,
try specifying 'osmesa' or 'egl' with the engine argument. If you are running a newer Ubuntu (21+) or Fedora (34+) release, you
may need to enforce Xorg usage in PyOpenGL: see https://yt-idv.readthedocs.io/en/latest/installation.html#extra-steps-for-linux
Stop-gap fix for #81