Closed chenzhaiyu closed 3 years ago
Update:
This was solved by
import os
os.environ['PYOPENGL_PLATFORM'] = 'egl'
I encountered the same issue, and then I had to use egl instead of pyplet. Wonder if anyone knows the issue with pyplet.
i meet the same problem, use egl can't help, any solutions?
I know the reason why the process being stuck.
In my case, there are too many renderers are created in this function in mesh_to_sdf/pyrender_wrapper.py
.
def render_normal_and_depth_buffers(mesh, camera, camera_transform, resolution):
global suppress_multisampling
suppress_multisampling = True
scene = pyrender.Scene()
scene.add(pyrender.Mesh.from_trimesh(mesh, smooth = False))
scene.add(camera, pose=camera_transform)
renderer = pyrender.OffscreenRenderer(resolution, resolution)
renderer._renderer._program_cache = CustomShaderCache()
color, depth = renderer.render(scene, flags=pyrender.RenderFlags.SKIP_CULL_FACES)
suppress_multisampling = False
return color, depth
So, I only create the renderer once to tackle the problem successfully.
resolution = 400
global renderer_g
renderer_g = pyrender.OffscreenRenderer(resolution, resolution)
renderer_g._renderer._program_cache = CustomShaderCache()
def render_normal_and_depth_buffers(mesh, camera, camera_transform, resolution):
global suppress_multisampling
suppress_multisampling = True
scene = pyrender.Scene()
scene.add(pyrender.Mesh.from_trimesh(mesh, smooth = False))
scene.add(camera, pose=camera_transform)
# renderer = pyrender.OffscreenRenderer(resolution, resolution)
# renderer._renderer._program_cache = CustomShaderCache()
# color, depth = renderer.render(scene, flags=pyrender.RenderFlags.SKIP_CULL_FACES)
color, depth = renderer_g.render(scene, flags=pyrender.RenderFlags.SKIP_CULL_FACES)
suppress_multisampling = False
return color, depth
Description
The process being stuck forever after calling
sample_sdf_near_surface()
for certain amount of times in a loop. In my case, it's always stuck after sampling 327 meshes, and it has nothing to do with the 328th mesh itself (working fine as input alone, or in a small batch). It seemspyrender
/pyglet
is just hanging. Could you please give some clues?Traceback (when KeyboardInterrupt)
Env
Ubuntu 18.04 Python 3.8 pyrender 0.1.43 pyglet 1.5.11