Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rendering environment error #16

Closed
LSQsjtu opened this issue Sep 13, 2024 · 8 comments
Closed

Rendering environment error #16

LSQsjtu opened this issue Sep 13, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@LSQsjtu
Copy link

LSQsjtu commented Sep 13, 2024

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
Copy link
Owner

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
Copy link
Owner

@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:
mmatl/pyrender#148 (comment)
mmatl/pyrender#86

Please, let me know if any of these help!

garment_render_front

@maria-korosteleva maria-korosteleva added the bug Something isn't working label Oct 9, 2024
@LSQsjtu
Copy link
Author

LSQsjtu commented Oct 10, 2024

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
Copy link
Owner

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

@acrefoot
Copy link

acrefoot commented Dec 3, 2024

@LSQsjtu In Linux I had to install some non-python packages. On Ubuntu I installed the following with apt:
libgl1-mesa-dev
libgl1-mesa-glx
libgles2-mesa-dev
libegl1-mesa-dev
libglu1-mesa-dev

Does that resolve the issue for you?

Btw, not sure if there are nvidia versions of these opengl packages. From what I remember 15 years ago, the mesa packages were not nearly as accelerated as the nvidia versions. If you figure out ways to improve the sim on Linux I'd love to know!

@LSQsjtu
Copy link
Author

LSQsjtu commented Dec 5, 2024

I have tried to install these non-python packages. But the rendering error using mesa still exists.

@maria-korosteleva
Copy link
Owner

Unfortunately, I was not able to reproduce the issue. I have installed the project on RedHat Linux, and it worked flawlessly

@LSQsjtu
Copy link
Author

LSQsjtu commented Dec 21, 2024

Thanks for your continuous assistance. I believe the main reason lies in my system configuration, so I have switched to the Windows system for simulation rendering and will close this issue. Nevertheless, thank you for your selfless help.

@LSQsjtu LSQsjtu closed this as completed Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants