openGL visualization error when trying to run basic example with newton?

I followed the instructions here:

To set up newton properly. I was able to clone the directory and then cd into it and run:

curl -LsSf https://astral.sh/uv/install.sh | sh

When I run this example:

uv run -m newton.examples basic_pendulum --viewer null

it executes successfully, as I have specified the viewer as null. But when I run the next example on the installation guide:

uv run --extra examples -m newton.examples robot_humanoid --num-worlds 16

I run into this error:

”Traceback (most recent call last):
File “”, line 198, in _run_module_as_main
File “”, line 88, in _run_code
File “/media/sameer/ss/newton/newton/examples/main.py”, line 21, in
main()
File “/media/sameer/ss/newton/newton/examples/init.py”, line 502, in main
runpy.run_module(target_module, run_name=“main”)
File “”, line 229, in run_module
File “”, line 88, in _run_code
File “/media/sameer/ss/newton/newton/examples/robot/example_robot_humanoid.py”, line 150, in
viewer, args = newton.examples.init(parser)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/media/sameer/ss/newton/newton/examples/init.py”, line 362, in init
viewer = newton.viewer.ViewerGL(headless=args.headless)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/media/sameer/ss/newton/newton/_src/viewer/viewer_gl.py”, line 116, in init
self.ui = UI(self.renderer.window)
^^^^^^^^^^^^^^^^^^^^^^^^
File “/media/sameer/ss/newton/newton/_src/viewer/gl/gui.py”, line 38, in init
self.impl = pyglet_backend.create_renderer(self.window)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/media/sameer/ss/newton/.venv/lib/python3.11/site-packages/imgui_bundle/python_backends/pyglet_backend.py”, line 304, in create_renderer
return PygletProgrammablePipelineRenderer(window, attach_callbacks)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/media/sameer/ss/newton/.venv/lib/python3.11/site-packages/imgui_bundle/python_backends/pyglet_backend.py”, line 285, in init
super(PygletProgrammablePipelineRenderer, self).init()
File “/media/sameer/ss/newton/.venv/lib/python3.11/site-packages/imgui_bundle/python_backends/pyglet_backend.py”, line 31, in init
super(PygletMixin, self).init()
File “/media/sameer/ss/newton/.venv/lib/python3.11/site-packages/imgui_bundle/python_backends/opengl_backend_programmable.py”, line 62, in init
super(ProgrammablePipelineRenderer, self).init()
File “/media/sameer/ss/newton/.venv/lib/python3.11/site-packages/imgui_bundle/python_backends/opengl_base_backend.py”, line 20, in init
self._create_device_objects()
File “/media/sameer/ss/newton/.venv/lib/python3.11/site-packages/imgui_bundle/python_backends/opengl_backend_programmable.py”, line 113, in _create_device_objects
gl.glVertexAttribPointer(
File “/media/sameer/ss/newton/.venv/lib/python3.11/site-packages/OpenGL/latebind.py”, line 63, in call
return self.wrapperFunction( self.baseFunction, *args, **named )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/media/sameer/ss/newton/.venv/lib/python3.11/site-packages/OpenGL/GL/VERSION/GL_2_0.py”, line 515, in glVertexAttribPointer
contextdata.setValue(key, array)
File “/media/sameer/ss/newton/.venv/lib/python3.11/site-packages/OpenGL/contextdata.py”, line 58, in setValue
context = getContext( context )
^^^^^^^^^^^^^^^^^^^^^
File “/media/sameer/ss/newton/.venv/lib/python3.11/site-packages/OpenGL/contextdata.py”, line 40, in getContext
raise error.Error(
OpenGL.error.Error: Attempt to retrieve context when no valid context”

How do I resolve this? I have tried installing all possible dependencies, resetting uv. Should I try a conda env next? Is this some driver issue?

1 Like