napari: Painting error on linux

🐛 Bug

When drawing I sometimes got this error (which ends program with SIGSEGV):

WARNING: Error drawing visual <Image at 0x7f589a273be0>
13:02:05 WARNING Error drawing visual <Image at 0x7f589a273be0>
13:02:05 ERROR Unhandled exception:
Traceback (most recent call last):
  File "/home/czaki/.pyenv/versions/napari/lib/python3.8/site-packages/vispy/app/backends/_qt.py", line 825, in paintGL
    self._vispy_canvas.events.draw(region=None)
  File "/home/czaki/.pyenv/versions/napari/lib/python3.8/site-packages/vispy/util/event.py", line 455, in __call__
    self._invoke_callback(cb, event)
  File "/home/czaki/.pyenv/versions/napari/lib/python3.8/site-packages/vispy/util/event.py", line 473, in _invoke_callback
    _handle_exception(self.ignore_callback_errors,
  File "/home/czaki/.pyenv/versions/napari/lib/python3.8/site-packages/vispy/util/event.py", line 471, in _invoke_callback
    cb(event)
  File "/home/czaki/.pyenv/versions/napari/lib/python3.8/site-packages/vispy/scene/canvas.py", line 217, in on_draw
    self._draw_scene()
  File "/home/czaki/.pyenv/versions/napari/lib/python3.8/site-packages/vispy/scene/canvas.py", line 266, in _draw_scene
    self.draw_visual(self.scene)
  File "/home/czaki/.pyenv/versions/napari/lib/python3.8/site-packages/vispy/scene/canvas.py", line 304, in draw_visual
    node.draw()
  File "/home/czaki/.pyenv/versions/napari/lib/python3.8/site-packages/vispy/scene/visuals.py", line 99, in draw
    self._visual_superclass.draw(self)
  File "/home/czaki/.pyenv/versions/napari/lib/python3.8/site-packages/vispy/visuals/visual.py", line 442, in draw
    self._program.draw(self._vshare.draw_mode,
  File "/home/czaki/.pyenv/versions/napari/lib/python3.8/site-packages/vispy/visuals/shaders/program.py", line 101, in draw
    Program.draw(self, *args, **kwargs)
  File "/home/czaki/.pyenv/versions/napari/lib/python3.8/site-packages/vispy/gloo/program.py", line 533, in draw
    canvas.context.flush_commands()
  File "/home/czaki/.pyenv/versions/napari/lib/python3.8/site-packages/vispy/gloo/context.py", line 176, in flush_commands
    self.glir.flush(self.shared.parser)
  File "/home/czaki/.pyenv/versions/napari/lib/python3.8/site-packages/vispy/gloo/glir.py", line 572, in flush
    self._shared.flush(parser)
  File "/home/czaki/.pyenv/versions/napari/lib/python3.8/site-packages/vispy/gloo/glir.py", line 494, in flush
    parser.parse(self._filter(self.clear(), parser))
  File "/home/czaki/.pyenv/versions/napari/lib/python3.8/site-packages/vispy/gloo/glir.py", line 819, in parse
    self._parse(command)
  File "/home/czaki/.pyenv/versions/napari/lib/python3.8/site-packages/vispy/gloo/glir.py", line 787, in _parse
    ob.set_data(*args)
  File "/home/czaki/.pyenv/versions/napari/lib/python3.8/site-packages/vispy/gloo/glir.py", line 929, in set_data
    raise RuntimeError("Shader compilation error in %s:\n%s" %
RuntimeError: Shader compilation error in GL_VERTEX_SHADER:

To Reproduce

Steps to reproduce the behavior:

  1. load image
  2. add label layer
  3. try paint
  4. repeat

Expected behavior

Not end with

Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

Environment

napari: 0.4.1rc1 Platform: Linux-5.4.0-53-generic-x86_64-with-glibc2.2.5 Python: 3.8.3 (default, Jun 26 2020, 19:57:39) [GCC 9.3.0] Qt: 5.15.1 PyQt5: 5.15.1 NumPy: 1.19.0 SciPy: 1.5.1 Dask: 2.1.0 VisPy: 0.6.5

GL version: 4.6.0 NVIDIA 390.138 MAX_TEXTURE_SIZE: 32768

Plugins:

  • napari_plugin_engine: 0.1.8

  • ome_zarr: 0.0.14

  • svg: 0.1.4

  • Please copy and paste the information at napari info option in help menubar here:

  • Any other relevant information:

Additional context

Any suggestion for debug?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (9 by maintainers)

Most upvoted comments

Since this time, we have rewritten shader codes a few times, so I think this may be closed.

Did You already meet RuntimeError: Program validation error: when switching onto 3d view? Or I should open the second issue?

Nope, does it also get fixed by disabling welcome visual? If yes fine to leave here, if no then new issue is best

Unfortunately no. see #1905

i.e. if you dropped the TextNode then everything would be fine (I saw that in what is likely a related crash).

Many places to comment out but I could confirm. This is strange because I have already loaded the image, so welcome visuals should not be visible.

If it causes crashes maybe should be disabled for this release to find what is done wrong?