Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update build, np 2 compatibility #122

Closed
wants to merge 5 commits into from

Conversation

chrishavlin
Copy link
Contributor

@chrishavlin chrishavlin commented Jun 25, 2024

Fixing the failures in #121

Update:
Turns out the issue was actually PyOpenGl-accelerate, which we only have as a dependency for testing.

@chrishavlin chrishavlin added the infrastructure Related to CI, versioning, websites, organizational issues, etc label Jun 25, 2024
@chrishavlin
Copy link
Contributor Author

failure was from pypa/twine#1125

@chrishavlin
Copy link
Contributor Author

trying to unpin np, i think it's related to using PyOpenGL_accelerate. in a fresh env locally, I get a clearer error message:

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 25, in render_context
    return PygletRenderingContext(**kwargs)
  File "/home/chavlin/src/yt_general/yt_idv/yt_idv/rendering_contexts/pyglet_context.py", line 61, in __init__
    gui = SimpleGUI(self)
  File "/home/chavlin/src/yt_general/yt_idv/yt_idv/simple_gui.py", line 20, in __init__
    self.renderer = create_renderer(window)
  File "/home/chavlin/.pyenv/versions/yt_idv_np2/lib/python3.10/site-packages/imgui/integrations/pyglet.py", line 245, in create_renderer
    return PygletProgrammablePipelineRenderer(window, attach_callbacks)
  File "/home/chavlin/.pyenv/versions/yt_idv_np2/lib/python3.10/site-packages/imgui/integrations/pyglet.py", line 213, in __init__
    super(PygletProgrammablePipelineRenderer, self).__init__()
  File "/home/chavlin/.pyenv/versions/yt_idv_np2/lib/python3.10/site-packages/imgui/integrations/pyglet.py", line 55, in __init__
    super(PygletMixin, self).__init__()
  File "/home/chavlin/.pyenv/versions/yt_idv_np2/lib/python3.10/site-packages/imgui/integrations/opengl.py", line 60, in __init__
    super(ProgrammablePipelineRenderer, self).__init__()
  File "/home/chavlin/.pyenv/versions/yt_idv_np2/lib/python3.10/site-packages/imgui/integrations/base.py", line 17, in __init__
    self._create_device_objects()
  File "/home/chavlin/.pyenv/versions/yt_idv_np2/lib/python3.10/site-packages/imgui/integrations/opengl.py", line 84, in _create_device_objects
    last_texture = gl.glGetIntegerv(gl.GL_TEXTURE_BINDING_2D)
  File "src/latebind.pyx", line 39, in OpenGL_accelerate.latebind.LateBind.__call__
  File "src/wrapper.pyx", line 303, in OpenGL_accelerate.wrapper.Wrapper.__call__
  File "src/wrapper.pyx", line 88, in OpenGL_accelerate.wrapper.CArgCalculator.c_call
  File "src/wrapper.pyx", line 69, in OpenGL_accelerate.wrapper.CArgCalculatorElement.c_call
  File "src/wrapper.pyx", line 64, in OpenGL_accelerate.wrapper.CArgCalculatorElement.c_call
  File "src/arraydatatype.pyx", line 355, in OpenGL_accelerate.arraydatatype.SizedOutputOrInput.c_call
  File "src/arraydatatype.pyx", line 224, in OpenGL_accelerate.arraydatatype.ArrayDatatype.c_zeros
  File "src/arraydatatype.pyx", line 69, in OpenGL_accelerate.arraydatatype.HandlerRegistry.c_get_output_handler
  File "src/arraydatatype.pyx", line 80, in OpenGL_accelerate.arraydatatype.HandlerRegistry.c_handler_by_plugin_name
  File "/home/chavlin/.pyenv/versions/yt_idv_np2/lib/python3.10/site-packages/OpenGL/plugins.py", line 18, in load
    return importByName( self.import_path )
  File "/home/chavlin/.pyenv/versions/yt_idv_np2/lib/python3.10/site-packages/OpenGL/plugins.py", line 45, in importByName
    module = __import__( ".".join(moduleName), {}, {}, moduleName)
  File "/home/chavlin/.pyenv/versions/yt_idv_np2/lib/python3.10/site-packages/OpenGL/arrays/numpymodule.py", line 28, in <module>
    from OpenGL_accelerate.numpy_formathandler import NumpyHandler
  File "src/numpy_formathandler.pyx", line 1, in init OpenGL_accelerate.numpy_formathandler
ValueError: ('numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject', 1, <OpenGL.platform.baseplatform.glGetIntegerv object at 0x7f53fc174780>)

likely that it's not compatible with np 2.

@chrishavlin chrishavlin changed the title pin numpy to < 2 update build, np 2 compatibility Jun 26, 2024
@matthewturk
Copy link
Member

I do think we should check performance hits for this, in case there are any. I'm not sure the current state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Related to CI, versioning, websites, organizational issues, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants