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

In a headless environment with no display, I got this error because it checked with GetCurrentContext instead of eglGetCurrentContext. #113

Open
M-mckim opened this issue Jan 23, 2024 · 0 comments

Comments

@M-mckim
Copy link

M-mckim commented Jan 23, 2024

I'm using a headless environment with no display.
I create a context with eglCreateContext and bind it with eglMakeCurrent.
After that, I use the context in the opengl es environment to do opengl tasks, but pyopengl keeps checking the context with GetCurrentContext().
eglGetCurrentContext() gets the context, but GetCurrentContext() only gets the value None, so I keep getting an error.
Do I need something more?

GL Context <OpenGL._opaque.EGLContext_pointer object at 0x7f7f5af2f940>
Traceback (most recent call last):
File "/lvmdata/mckim/Eagle/nvidia_hdless_opengl.py", line 136, in
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 24, ctypes.c_void_p(0))
File "src/latebind.pyx", line 51, in OpenGL_accelerate.latebind.Curry.call
File "/lvmdata/mckim/anaconda3/envs/headless_opengl/lib/python3.9/site-packages/OpenGL/GLES2/VERSION/GLES2_2_0.py", line 444, in glVertexAttribPointer
contextdata.setValue( key, array )
File "/lvmdata/mckim/anaconda3/envs/headless_opengl/lib/python3.9/site-packages/OpenGL/contextdata.py", line 58, in setValue
context = getContext( context )
File "/lvmdata/mckim/anaconda3/envs/headless_opengl/lib/python3.9/site-packages/OpenGL/contextdata.py", line 40, in getContext
raise error.Error(
OpenGL.error.Error: Attempt to retrieve context when no valid context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant