napari: Program validation error on 3D activation

🐛 Bug

To Reproduce

Steps to reproduce the behavior:

  1. see https://github.com/ome/ome-zarr-py/pull/9
>>> from tests.create_test_data import create_zarr
>>> create_zarr("test_data.zarr")
  1. napari test_data.zarr
  2. activate 3D
stack trace
(py36) /opt/ome-zarr-py $napari /tmp/test_data.zarr/
INFO:napari_plugin_engine.manager:loaded 3 plugins:
  <module 'napari.plugins._builtins' from '/opt/anaconda/envs/py36/lib/python3.6/site-packages/napari/plugins/_builtins.py'>
  <module 'napari_svg' from '/opt/anaconda/envs/py36/lib/python3.6/site-packages/napari_svg/__init__.py'>
  <module 'ome_zarr' from '/opt/ome-zarr-py/ome_zarr.py'>
  <module 'napari_plugin_engine' from '/opt/anaconda/envs/py36/lib/python3.6/site-packages/napari_plugin_engine/__init__.py'>
root_attrs {'multiscales': [{'datasets': [{'path': '0'}, {'path': '1'}, {'path': '2'}, {'path': '3'}, {'path': '4'}], 'version': '0.1'}]}
resolutions ['0', '1', '2', '3', '4']
resolution 0 shape (t, c, z, y, x) (1, 3, 1, 1024, 1024) chunks ['1', '1', '1', '256', '256'] dtype float64
resolution 1 shape (t, c, z, y, x) (1, 3, 1, 512, 512) chunks ['1', '1', '1', '256', '256'] dtype float64
resolution 2 shape (t, c, z, y, x) (1, 3, 1, 256, 256) chunks ['1', '2 (+ 1)', '1', '128', '128'] dtype float64
resolution 3 shape (t, c, z, y, x) (1, 3, 1, 128, 128) chunks ['1', '2 (+ 1)', '1', '128', '128'] dtype float64
resolution 4 shape (t, c, z, y, x) (1, 3, 1, 64, 64) chunks ['1', '3', '1', '64', '64'] dtype float64
INFO:OpenGL.acceleratesupport:No OpenGL_accelerate module loaded: No module named 'OpenGL_accelerate'
WARNING: Error drawing visual <Volume at 0x7fd2e0640ac8>
WARNING:vispy:Error drawing visual <Volume at 0x7fd2e0640ac8>
WARNING: Traceback (most recent call last):
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/app/backends/_qt.py", line 825, in paintGL
    self._vispy_canvas.events.draw(region=None)
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/util/event.py", line 455, in __call__
    self._invoke_callback(cb, event)
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/util/event.py", line 475, in _invoke_callback
    self, cb_event=(cb, event))
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/util/event.py", line 471, in _invoke_callback
    cb(event)
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/scene/canvas.py", line 217, in on_draw
    self._draw_scene()
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/scene/canvas.py", line 266, in _draw_scene
    self.draw_visual(self.scene)
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/scene/canvas.py", line 304, in draw_visual
    node.draw()
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/scene/visuals.py", line 99, in draw
    self._visual_superclass.draw(self)
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/visuals/visual.py", line 443, in draw
    self._vshare.index_buffer)
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/visuals/shaders/program.py", line 101, in draw
    Program.draw(self, *args, **kwargs)
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/gloo/program.py", line 533, in draw
    canvas.context.flush_commands()
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/gloo/context.py", line 176, in flush_commands
    self.glir.flush(self.shared.parser)
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/gloo/glir.py", line 572, in flush
    self._shared.flush(parser)
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/gloo/glir.py", line 494, in flush
    parser.parse(self._filter(self.clear(), parser))
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/gloo/glir.py", line 819, in parse
    self._parse(command)
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/gloo/glir.py", line 779, in _parse
    ob.draw(*args)
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/gloo/glir.py", line 1329, in draw
    self._pre_draw()
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/gloo/glir.py", line 1289, in _pre_draw
    self._validate()
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/gloo/glir.py", line 1301, in _validate
    % gl.glGetProgramInfoLog(self._handle))
RuntimeError: Program validation error:
WARNING:vispy:Traceback (most recent call last):
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/app/backends/_qt.py", line 825, in paintGL
    self._vispy_canvas.events.draw(region=None)
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/util/event.py", line 455, in __call__
    self._invoke_callback(cb, event)
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/util/event.py", line 475, in _invoke_callback
    self, cb_event=(cb, event))
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/util/event.py", line 471, in _invoke_callback
    cb(event)
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/scene/canvas.py", line 217, in on_draw
    self._draw_scene()
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/scene/canvas.py", line 266, in _draw_scene
    self.draw_visual(self.scene)
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/scene/canvas.py", line 304, in draw_visual
    node.draw()
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/scene/visuals.py", line 99, in draw
    self._visual_superclass.draw(self)
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/visuals/visual.py", line 443, in draw
    self._vshare.index_buffer)
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/visuals/shaders/program.py", line 101, in draw
    Program.draw(self, *args, **kwargs)
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/gloo/program.py", line 533, in draw
    canvas.context.flush_commands()
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/gloo/context.py", line 176, in flush_commands
    self.glir.flush(self.shared.parser)
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/gloo/glir.py", line 572, in flush
    self._shared.flush(parser)
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/gloo/glir.py", line 494, in flush
    parser.parse(self._filter(self.clear(), parser))
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/gloo/glir.py", line 819, in parse
    self._parse(command)
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/gloo/glir.py", line 779, in _parse
    ob.draw(*args)
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/gloo/glir.py", line 1329, in draw
    self._pre_draw()
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/gloo/glir.py", line 1289, in _pre_draw
    self._validate()
  File "/opt/anaconda/envs/py36/lib/python3.6/site-packages/vispy/gloo/glir.py", line 1301, in _validate
    % gl.glGetProgramInfoLog(self._handle))
RuntimeError: Program validation error:
Abort trap: 6

Expected behavior

Not exactly sure. I’d assume a very flat 3D representation.

Environment

  • napari==0.3.0
  • ome-zarr-py==0.0.2

About this issue

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

Most upvoted comments

SOOO much has happened since then, I am more than happy for this to be closed and I’ll re-open when/if it occurs. Thanks for the reminder, @psobolewskiPhD

making a little progress on this, I used anaconda to set up the env as @jni had, I can see the same error when running napari test_data.zarr, so I made a bit more experimentation. I opened napari directly, and tried to drag and drop the test_data into the viewer afterwards, then I don’t see a crash immediately, the error only happens when I try to switch to 3D mode.

interestingly, then I tried the same thing from pycharm while using the anaconda environment as the python interpreter, everything works fine, so there is something about the shell from anaconda that is glitching with vispy

from the message below, I suspect anaconda shell might be having some issue accessing GL resource/graphic card?

btw to reproduce I did:

conda create -n napari-cf --channel conda-forge python=3.8 napari=0.3.6
conda activate napari-cf
pip install ome-zarr==0.0.8  # 0.0.11 had the missing mask issue discussed on Zulip
napari https://s3.embassy.ebi.ac.uk/idr/zarr/v0.1/6001240.zarr

then I absentmindedly played around with the 3D volume for about 1-2 minutes while chatting with @joshmoore. 😂 Unfortunately I don’t know what actually caused the error! One possibility is the macOS automatic graphics card switching? 🤷

Anyway, as I said, I’d love to keep these open until we understand them, or maybe until VisPy makes a new release and then neither I nor @joshmoore can find these errors again.

I don’t know of any particular reason this would be happening in the Python 3.6 environment. I’m happy to test things, but I assume there are diminishing returns.

Agreed. Let’s close after we get that additional test in, and then we can always re-open if a new error appears. We’ll be dropping Python 3.6 relatively soon too (likely the release after our next one)

In a fresh 3.8.5 environment, it works fine:

  515  conda create -n napari -c conda-forge napari
  516  pip install -e '.[qt]'
  517  napari test_data.zarr/

👍

I was reproducing from the zarr test dataset, I was running napari test_data.zarr. let me include that in the gif as well

Amazing, sorry I didn’t understand the astronauts came from the zarr dataset!!! Likely also this was fixed by #1360.

It looks like this is fixed on our main branch now, so maybe @joshmoore can confirm this now works for him and then we can get to closing.

Looking through our tests though, and remembering what happened on #1360 I don’t think we have an explicit test for this though. Maybe @ziyangczi you can add the minimal example from @jni

napari.view_image(np.ones((4, 4)), ndisplay=3)

Into our tests here https://github.com/napari/napari/blob/master/napari/_tests/test_view_layers.py#L175 and then we can close this issue, confident it won’t come back!!!

I was reproducing from the zarr test dataset, I was running napari test_data.zarr. let me include that in the gif as well

weird that it says 0.3.5 since we are on 0.3.6 now

You would need to fetch tags and run pip install -e . to update your local version