From eb33a0e7a154d66828330b7c787c4c1c3f5d9acb Mon Sep 17 00:00:00 2001 From: Rui Luo Date: Tue, 13 Oct 2026 15:21:17 +0800 Subject: [PATCH] fix(samples): waive glInteropMipmapLod when the pyglet window cannot open Match glInteropFluid and glInteropPlasma so a failure to open the pyglet window is a sample waiver. --- samples/cuda_core/glInteropMipmapLod/glInteropMipmapLod.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/samples/cuda_core/glInteropMipmapLod/glInteropMipmapLod.py b/samples/cuda_core/glInteropMipmapLod/glInteropMipmapLod.py index 00e8d2a7564..04f98ca3006 100644 --- a/samples/cuda_core/glInteropMipmapLod/glInteropMipmapLod.py +++ b/samples/cuda_core/glInteropMipmapLod/glInteropMipmapLod.py @@ -463,7 +463,11 @@ def main(argv=None): ) # --- Step 4: Open a window and set up the GL/CUDA bridge --- - window, gl, pyglet = create_window() + try: + window, gl, pyglet = create_window() + except Exception as exc: + print(f"Could not open a pyglet window ({exc}); waiving glInteropMipmapLod.", file=sys.stderr) + sys.exit(EXIT_WAIVED) shader_prog, quad_vao, tex_id = create_display_resources(gl, WIDTH, HEIGHT) pbo_id, _ = create_pixel_buffer(gl, WIDTH, HEIGHT) resource = GraphicsResource.from_gl_buffer(pbo_id, flags="write_discard")