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

OpenGL.error.Error: Attempt to retrieve context when no valid context #270

Closed
HJWoods opened this issue Dec 23, 2024 · 3 comments
Closed

Comments

@HJWoods
Copy link

HJWoods commented Dec 23, 2024

File "/home/my_name/Desktop/genesis-world/venv/lib/python3.10/site-packages/genesis/ext/pyrender/renderer.py", line 141, in render
self._update_context(scene, flags)
File "/home/my_name/Desktop/genesis-world/venv/lib/python3.10/site-packages/genesis/ext/pyrender/renderer.py", line 899, in _update_context
p._add_to_context()
File "/home/my_name/Desktop/genesis-world/venv/lib/python3.10/site-packages/genesis/ext/pyrender/primitive.py", line 359, in _add_to_context
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, FLOAT_SZ * 3, ctypes.c_void_p(0))
File "/home/my_name/Desktop/genesis-world/venv/lib/python3.10/site-packages/OpenGL/latebind.py", line 63, in call
return self.wrapperFunction( self.baseFunction, *args, **named )
File "/home/my_name/Desktop/genesis-world/venv/lib/python3.10/site-packages/OpenGL/GL/VERSION/GL_2_0.py", line 469, in glVertexAttribPointer
contextdata.setValue( key, array )
File "/home/my_name/Desktop/genesis-world/venv/lib/python3.10/site-packages/OpenGL/contextdata.py", line 58, in setValue
context = getContext( context )
File "/home/my_name/Desktop/genesis-world/venv/lib/python3.10/site-packages/OpenGL/contextdata.py", line 40, in getContext
raise error.Error(
OpenGL.error.Error: Attempt to retrieve context when no valid context

I'm running this on an ubuntu laptop with an intel CPU, no GPU and the corresponding cuda-less version of torch. I got a similar error on Windows, but I saw from another issue that rendering isn't supported on Windows yet. On windows no window opened but on linux a black window opens. The opengl context is definitely there.

It looks like the error is on another thread, as the program keeps running. If I had to guess it looks like the OpenGL context isn't visible to whatever thread is giving this message.
(pressing ctrl+c gives the standard KeyboardInterrupt message)

@HJWoods
Copy link
Author

HJWoods commented Dec 23, 2024

The OpenGl method in question is this one:
File "/home/my_user/Desktop/genesis-world/venv/lib/python3.10/site-packages/genesis/ext/pyrender/primitive.py", line 359, in _add_to_context
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, FLOAT_SZ * 3, ctypes.c_void_p(0))

@HJWoods
Copy link
Author

HJWoods commented Dec 23, 2024

Upgrading PyOpenGL PyOpenGL_accelerate and pyrender fixed this, but I have the same issue as #227 now

Maybe add the correct version of these packages to the requirements?

@HJWoods
Copy link
Author

HJWoods commented Dec 24, 2024

The solution from #227 also fixed my issue here (tested on a fresh virtualenv)

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