Skip to content

[BUG] Closing OpenGL window on Windows leads to exception #488

@shi-eric

Description

@shi-eric

Bug Description

It seems like the self.window.switch_to() added in 172fa0e to render_opengl.py is causing an exception to be throw on Windows when the window is closed in the Drone and OpenGL examples.

self.window.switch_to()

Warp 1.6.0 initialized:
   CUDA Toolkit 12.4, Driver 12.4
   Devices:
     "cpu"      : "Intel64 Family 6 Model 134 Stepping 0, GenuineIntel"
     "cuda:0"   : "NVIDIA L40" (48 GiB, sm_89, mempool enabled)
   Kernel cache:
     C:\Users\horde\AppData\Local\NVIDIA\warp\Cache\1.6.0
Module warp.render.render_opengl d71b08e load on device 'cuda:0' took 65.28 ms  (cached)
Traceback (most recent call last):
  File "C:\Users\horde\code-projects\warp\warp\examples\core\example_render_opengl.py", line 185, in <module>
    example.renderer.clear()
  File "C:\Users\horde\.venv\Lib\site-packages\warp\render\render_opengl.py", line 1438, in clear
    self.window.switch_to()
  File "C:\Users\horde\.venv\Lib\site-packages\pyglet\window\win32\__init__.py", line 385, in switch_to
    self.context.set_current()
    ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'set_current'

Steps to Reproduce

  • On Windows, install pyglet
  • Run the Drone example, which opens a window: python -m warp.examples.optim.example_drone
  • When example has finished running, close the window.

System Information

Windows

Metadata

Metadata

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions