UT-Austin-RPL / Lotus

14 stars 0 forks source link

How to run Lotus on server? #4

Closed Charlie0257 closed 3 weeks ago

Charlie0257 commented 1 month ago

Hi, @wkwan7 Thanks for your great work!

When I try to run Lotus on server, there are some errors——

OpenGL.raw.EGL._errors.EGLError: EGLError(                                                                                                                                    
        err = EGL_BAD_ALLOC,                                                                                                                                                  
        baseOperation = eglCreateContext,                                                                                                                                     
        cArguments = (                                                                                                                                                        
                <OpenGL._opaque.EGLDisplay_pointer object at 0x7fa826429940>,                                                                                                 
                <OpenGL._opaque.EGLConfig_pointer object at 0x7fa8264298c0>,                                                                                                  
                <OpenGL._opaque.EGLContext_pointer object at 0x7fa9350525c0>,                                                                                                 
                None,                                                                                                                                                         
        ),                                                                                                                                                                    
        result = <OpenGL._opaque.EGLContext_pointer object at 0x7fa826429c40>                                                                                                 
)                                                                                                                                                                             
Exception ignored in: <function EGLGLContext.__del__ at 0x7fa932c11af0>                                                                                                       
Traceback (most recent call last):                                                                                                                                            
  File "/home/zhanghao/anaconda3/envs/lotus/lib/python3.9/site-packages/robosuite/renderers/context/egl_context.py", line 155, in __del__                                     
    self.free()                                                                                                                                                               
  File "/home/zhanghao/anaconda3/envs/lotus/lib/python3.9/site-packages/robosuite/renderers/context/egl_context.py", line 146, in free                                        
    if self._context:                                                                                                                                                         
AttributeError: 'EGLGLContext' object has no attribute '_context'                                                                                                             
Exception ignored in: <function MjRenderContext.__del__ at 0x7fa932c11ca0>                                                                                                    
Traceback (most recent call last):                                                                                                                                            
  File "/home/zhanghao/anaconda3/envs/lotus/lib/python3.9/site-packages/robosuite/utils/binding_utils.py", line 198, in __del__                                               
    self.con.free()                                                                                                                                                           
AttributeError: 'MjRenderContextOffscreen' object has no attribute 'con'

Looks like an EGL issue, how do I set it up on the service to match offscreen or headless scenarios?

Thanks for any help:) Best, Charlie

wkwan7 commented 4 weeks ago

Hi @Charlie0257, I guess this is a robosuite issue. You can follow some solutions from robosuite repo to make sure the offscreen rendering for robosuite works on your machine.

https://github.com/ARISE-Initiative/robosuite/issues/469 https://github.com/ARISE-Initiative/robosuite/issues/424

Charlie0257 commented 4 weeks ago

Thanks for your help! I have proposed a comment on https://github.com/ARISE-Initiative/robosuite/issues/469. Look forward to the solution!

wkwan7 commented 4 weeks ago

maybe you can try the following: sudo apt-get update sudo apt install libgl1-mesa-dev libgl1-mesa-glx libglew-dev libosmesa6-dev libgl1-mesa-glx libglfw3 libglfw3-dev

Charlie0257 commented 4 weeks ago

@wkwan7 Thanks for your advice! However, it doesn't work on the server:(

There are lots of files in LOTUS, Could you tell where you set the following variable for ROBOSUITE?

has_renderer=False,
has_offscreen_renderer=False,
BrightMoonStar commented 4 weeks ago

I have the same problem. Have you solved it? Thanks!

Charlie0257 commented 3 weeks ago

Hi, @wkwan7 @BrightMoonStar I solve this problem by MUJOCO_GL="osmesa" python xxx.py