8000 GitHub · Where software is built
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
[BUG] OpenGLRenderer throws an exception during shutdown on Windows #412
Closed
@shi-eric

Description

@shi-eric

Bug Description

When closing example_render_opengl.py on Windows, the following is printed:

Exception ignored in: <function ShapeInstancer.__del__ at 0x000001C3E893F060>
Traceback (most recent call last):
  File "C:\Users\nvidia\warp\warp\render\render_opengl.py", line 694, in __del__
ImportError: sys.meta_path is None, Python is likely shutting down

Similarly, the following example from @christophercrouzet will have a similar message at exit:

import numpy as np
import warp as wp
import warp.render


BOX_POINTS = np.array(
    (
        ( 0.853553, -0.146446,  0.0     ), ( 0.146446, -0.853553,  0.0     ),
        ( 0.353553,  0.353553,  0.707106), (-0.353553, -0.353553,  0.707106),
        (-0.353553, -0.353553, -0.707106), ( 0.353553,  0.353553, -0.707106),
        (-0.853553,  0.146446,  0.0     ), (-0.146446,  0.853553,  0.0     ),
    ),
    dtype=np.float32,
)

BOX_FACE_VERTEX_INDICES = np.array(
    (
        0, 3, 1, 0, 2, 3, 4, 7, 5, 4, 6, 7, 6, 2, 7, 6, 3, 2,
        5, 1, 4, 5, 0, 1, 5, 2, 0, 5, 7, 2, 1, 6, 4, 1, 3, 6,
    ),
    dtype=np.int32,
)


resolution = (512, 384)
num_frames = 24
fps = 24
camera_pos = (0.0, 2.5, 5.0)
camera_front = (0.0, -0.5, -1.0)

renderer = warp.render.OpenGLRenderer(
    fps=fps,
    screen_width=resolution[0],
    screen_height=resolution[1],
    camera_pos=camera_pos,
    camera_front=camera_front,
    vsync=True,
)

rng = np.random.default_rng(123)
for frame in range(num_frames):
    color = wp.sin(float(frame) * 0.05) * 0.5 + 0.5

    renderer.begin_frame(frame / num_frames)
    renderer.render_mesh(
        "box",
        BOX_POINTS,
        BOX_FACE_VERTEX_INDICES,
        colors=(color, 0.5, 0.5),
    )
    renderer.end_frame()

renderer.close()

System Information

Windows only

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0