8000 [Bug}: When using pyimgui some users of my program have `GLError`s · Issue #368 · pyimgui/pyimgui · GitHub
[go: up one dir, main page]

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

[Bug}: When using pyimgui some users of my program have GLErrors #368

Open
ajh123 opened this issue Dec 27, 2023 · 8 comments
Open

[Bug}: When using pyimgui some users of my program have GLErrors #368

ajh123 opened this issue Dec 27, 2023 · 8 comments
Labels

Comments

@ajh123
Copy link
ajh123 commented Dec 27, 2023

Not sure how I can reproduce the following error, anyway, some users (Linux with NVIDIA's X drivers) have the following error. I'm on Windows with the NVIDA's drivers and I cannot reproduce the error.

Traceback (most recent call last):
  File "/tmp/python-minecraft-clone/community/main.py", line 460, in <module>
    main()
  File "/tmp/python-minecraft-clone/community/main.py", line 457, in main
    game.run()
  File "/tmp/python-minecraft-clone/community/main.py", line 436, in run
    pyglet.app.run(interval = 0)
  File "/home/obiwac/.local/lib/python3.11/site-packages/pyglet/app/__init__.py", line 76, in run
    event_loop.run(interval)
  File "/home/obiwac/.local/lib/python3.11/site-packages/pyglet/app/base.py", line 163, in run
    timeout = self.idle()
              ^^^^^^^^^^^
  File "/home/obiwac/.local/lib/python3.11/site-packages/pyglet/app/base.py", line 224, in idle
    self.clock.call_scheduled_functions(dt)
  File "/home/obiwac/.local/lib/python3.11/site-packages/pyglet/clock.py", line 180, in call_scheduled_functions
    item.func(dt, *item.args, **item.kwargs)
  File "/home/obiwac/.local/lib/python3.11/site-packages/pyglet/app/base.py", line 118, in _redraw_windows
    window.dispatch_event('on_draw')
  File "/home/obiwac/.local/lib/python3.11/site-packages/pyglet/window/__init__.py", line 671, in dispatch_event
    super().dispatch_event(*args)
  File "/home/obiwac/.local/lib/python3.11/site-packages/pyglet/event.py", line 387, in dispatch_event
    if getattr(self, event_type)(*args):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/python-minecraft-clone/community/main.py", line 420, in on_draw
    self.impl.render(imgui.get_draw_data())
  File "/home/obiwac/.local/lib/python3.11/site-packages/imgui/integrations/pyglet.py", line 219, in render
    super(PygletProgrammablePipelineRenderer, self).render(draw_data)
  File "/home/obiwac/.local/lib/python3.11/site-packages/imgui/integrations/opengl.py", line 149, in render
    common_gl_state_tuple = get_common_gl_state()
                            ^^^^^^^^^^^^^^^^^^^^^
  File "/home/obiwac/.local/lib/python3.11/site-packages/imgui/integrations/opengl.py", line 347, in get_common_gl_state
    last_texture = gl.glGetIntegerv(gl.GL_TEXTURE_BINDING_2D)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/obiwac/.local/lib/python3.11/site-packages/OpenGL/latebind.py", line 43, in __call__
    return self._finalCall( *args, **named )
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/obiwac/.local/lib/python3.11/site-packages/OpenGL/wrapper.py", line 678, in wrapperCall
    raise err
  File "/home/obiwac/.local/lib/python3.11/site-packages/OpenGL/wrapper.py", line 671, in wrapperCall
    result = wrappedOperation( *cArguments )
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/obiwac/.local/lib/python3.11/site-packages/OpenGL/error.py", line 230, in glCheckError
    raise self._errorClass(
OpenGL.error.GLError: GLError(
        err = 1280,
        description = b'invalid enumerant',
        baseOperation = glGetIntegerv,
        pyArgs = (
                GL_TEXTURE_BINDING_2D,
                <object object at 0x83e0c7d60>,
        ),
        cArgs = (
                GL_TEXTURE_BINDING_2D,
                array([3], dtype=int32),
        ),
        cArguments = (
                GL_TEXTURE_BINDING_2D,
                array([3], dtype=int32),
        )
)

Python dependencies

pyglet >= 2.0.10
nbtlib >= 2.0.4
base36 >= 0.1.1
pyglm >= 2.7.1
numpy >= 1.26.2
imgui[pyglet] >= 2.0.0
pillow >= 9.3.0
PyOpenGL >= 3.1.6

More information in obiwac/python-minecraft-clone#104. The code in question is https://github.com/ajh123/python-minecraft-clone/tree/ui_rewrite/community. Currently I am not sure on the environment the user is running the program in.

@ajh123 ajh123 changed the title [Bug}: When using pyimgui some users of my program have errors [Bug}: When using pyimgui some users of my program have GLErrors Dec 27, 2023
@obiwac
Copy link
obiwac commented Dec 27, 2023

Have you tried setting debug_gl yet? Here are my logs, but I don't think there's anything in there which can help debugging:

[LOGS]
[2023-12-27 13:52:53,192] [MainProcess/MainThread/INFO] (main.py/__init__) System Info: Python: CPython 3.11.5
System: amd64 FreeBSD 13.2-RELEASE-p2 FreeBSD 13.2-RELEASE-p2 GENERIC
CPU: amd64
Display: NVIDIA GeForce GTX 1060 3GB/PCIe/SSE2 
(3, 3)

I can help debugging, I'm just a bit busy for the next couple days :)

@ajh123
Copy link
Author
ajh123 commented Dec 27, 2023

@obiwac For me with pyglet.options["debug_gl"] = True I do not get any errors. Strange, isn't it?

@obiwac
Copy link
obiwac commented Dec 27, 2023

Indeed 🤔

I'll have a look then in a little while.

@ajh123
Copy link
Author
ajh123 commented Dec 27, 2023

no_errors_here

@obiwac
Copy link
obiwac commented Dec 27, 2023

ah but have you tried this without your changes? i.e. in the main branch of mcpy?

@ajh123
Copy link
Author
ajh123 commented Dec 27, 2023

@obiwac In episode 12 (not modified) with pyglet.options["debug_gl"] = True I get no errors.

@obiwac
Copy link
obiwac commented Dec 27, 2023

yes but in community I mean

@ajh123
Copy link
Author
ajh123 commented Dec 27, 2023

Same results in community, no errors. Seems like NVIDIA's Windows and Linux (X) drivers behave very differently.

@tayler6000 tayler6000 added the bug label Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants
0