maria-korosteleva / GarmentCode

A modular programming framework for designing parametric sewing patterns
MIT License
151 stars 16 forks source link

Rendering environment error #16

Open LSQsjtu opened 2 months ago

LSQsjtu commented 2 months ago

While testing the garment simulation, I encountered an error when rendering the garment garment_specification.json.

 File "/data/lsq/GarmentCode/pygarment/meshgen/render/pythonrender.py", line 197, in render_images
    render(pyrender_garm_mesh, pyrender_body_mesh, side, paths, render_props)
  File "/data/lsq/GarmentCode/pygarment/meshgen/render/pythonrender.py", line 155, in render
    color, _ = renderer.render(scene, flags=pyrender.RenderFlags.RGBA)
  File "/home/liushengqi/miniconda3/envs/torch2/lib/python3.10/site-packages/pyrender/offscreen.py", line 104, in render
    self._renderer.render(scene, flags, seg_node_map)
  File "/home/liushengqi/miniconda3/envs/torch2/lib/python3.10/site-packages/pyrender/renderer.py", line 125, in render
    self._update_context(scene, flags)
  File "/home/liushengqi/miniconda3/envs/torch2/lib/python3.10/site-packages/pyrender/renderer.py", line 755, in _update_context
    texture._add_to_context()
  File "/home/liushengqi/miniconda3/envs/torch2/lib/python3.10/site-packages/pyrender/texture.py", line 197, in _add_to_context
    glTexImage2D(
  File "/home/liushengqi/miniconda3/envs/torch2/lib/python3.10/site-packages/OpenGL/latebind.py", line 45, in __call__
    return self._finalCall( *args, **named )
  File "/home/liushengqi/miniconda3/envs/torch2/lib/python3.10/site-packages/OpenGL/wrapper.py", line 885, in wrapperCall
    raise err
  File "/home/liushengqi/miniconda3/envs/torch2/lib/python3.10/site-packages/OpenGL/wrapper.py", line 878, in wrapperCall
    result = wrappedOperation( *cArguments )
  File "/home/liushengqi/miniconda3/envs/torch2/lib/python3.10/site-packages/OpenGL/error.py", line 228, in glCheckError
    raise GLError(
OpenGL.error.GLError: GLError(
        err = 1281,
        description = b'invalid value',
        baseOperation = glTexImage2D,
        pyArgs = (
                GL_TEXTURE_2D,
                0,
                GL_RGBA,
                9416,
                7618,
                0,
                GL_RGBA,
                GL_UNSIGNED_BYTE,
                array([ 51,  51,  51, ...,  83,  84, 255], dtype=uint8),
        ),
        cArgs = (
                GL_TEXTURE_2D,
                0,
                GL_RGBA,
                9416,
                7618,
                0,
                GL_RGBA,
                GL_UNSIGNED_BYTE,
                array([ 51,  51,  51, ...,  83,  84, 255], dtype=uint8),
        ),
        cArguments = (
                GL_TEXTURE_2D,
                0,
                GL_RGBA,
                9416,
                7618,
                0,
                GL_RGBA,
                GL_UNSIGNED_BYTE,
                array([ 51,  51,  51, ...,  83,  84, 255], dtype=uint8),
        )
)

It appears to be an error related to the pyrender version. Could you provide any assistance with the installation of pyrender and PyOpenGL?

I am using Ubuntu 20.04.6 LTS with CUDA 11.3. My Python version is 3.10, Pyrender is at version 0.1.45, and PyOpenGL is at version 3.1.0.

maria-korosteleva commented 2 months ago

Hi, sorry for delay in my replies

At first glance it seems like versions conflict

I will double check within a few days and return back to you

maria-korosteleva commented 1 month ago

@LSQsjtu again, many apologies for delay, unfortunately, I have limited capacity to answer the issues in timely manner, but if you still encounter the problem, here is what I found.

Here is my setup with versions of libs which successfully render your example: python 3.10.6 CUDA 12.5 pyrender 0.1.45 PyOpenGL 3.1.0 Pillow 10.1.0 trimesh 4.0.7 imageio 2.33.1

And, I'm using Windows as my OS. It seems like the setup is the same except for CUDA version and OS, so maybe you could try some suggestions from pyrender community: https://github.com/mmatl/pyrender/issues/148#issuecomment-844102585 https://github.com/mmatl/pyrender/issues/86

Please, let me know if any of these help!

garment_render_front

LSQsjtu commented 1 month ago

Thanks for your reply. It works on Windows, but is still not working on my Linux machine. The rendering error might be my environment error in my environment. Because the EGL is not working on my Linux machine, and I change to OSMesa.

maria-korosteleva commented 1 month ago

Unfortunately, I've never tested this on Linux, but I might be soon I will update this issue if any new info shows up