facebookresearch / r3m

Pre-training Reusable Representations for Robotic Manipulation Using Diverse Human Video Data
https://sites.google.com/view/robot-r3m/
MIT License
292 stars 45 forks source link

Can not run evaluation on V100 GPU #17

Closed zhengsipeng closed 2 years ago

zhengsipeng commented 2 years ago

Thank you for your great work, However, I have some problems when running your evaluation code. My GPU enviroment is Tesla V100-32 GPU, and it always reports such rendering error:

Found 0 GPUs for rendering. Using device 0.
File "mjsim.pyx", line 156, in mujoco_py.cymj.MjSim.render
  File "mjsim.pyx", line 158, in mujoco_py.cymj.MjSim.render
  File "mjrendercontext.pyx", line 46, in mujoco_py.cymj.MjRenderContext.__init__
  File "mjrendercontext.pyx", line 114, in mujoco_py.cymj.MjRenderContext._setup_opengl_context
  File "opengl_context.pyx", line 130, in mujoco_py.cymj.OffscreenOpenGLContext.__init__
RuntimeError: Failed to initialize OpenGL

The bug happens here in L184-L191 of obs_wrappers.py

def get_image(self):
        if self.camera_name == "default":
            img = self.sim.render(width=self.width, height=self.height, depth=self.depth,
                            device_id=self.device_id)
        else:
            img = self.sim.render(width=self.width, height=self.height, depth=self.depth,
                              camera_name=self.camera_name, device_id=self.device_id)
        img = img[::-1,:,:]
        return img

So I wonder what GPU enviroment do you use in your evaluation experiments? Is it the problem of GPU type or the problem of my installation mistake?

aravindr93 commented 2 years ago

Thanks for your interest.

I believe we use V100 for our experiments, so the issue is unlikely to be the GPU type.

This might be more related to compilation of mujoco-py and headless rendering. Can you refer to install instructions and pointers in this page and try again? https://github.com/aravindr93/mjrl/tree/master/setup

suraj-nair-1 commented 2 years ago

Agreed, I don't think this is a GPU specific issue. It looks like a mujoco-py install issue - MuJoCo cannot find your GPU and thus cannot use it for rendering: Found 0 GPUs for rendering. Using device 0.

zhengsipeng commented 2 years ago

Thanks for your interest.

I believe we use V100 for our experiments, so the issue is unlikely to be the GPU type.

This might be more related to compilation of mujoco-py and headless rendering. Can you refer to install instructions and pointers in this page and try again? https://github.com/aravindr93/mjrl/tree/master/setup

Thanks for your interest.

I believe we use V100 for our experiments, so the issue is unlikely to be the GPU type.

This might be more related to compilation of mujoco-py and headless rendering. Can you refer to install instructions and pointers in this page and try again? https://github.com/aravindr93/mjrl/tree/master/setup

Thank you for your reply, I will try it again, Just make sure: do you render your observation images under headless server as well?

suraj-nair-1 commented 2 years ago

Yes, we use headless rendering. I'd recommend first verifying that you can headless render images from any standard mujoco env (e.g. hopper). If that works, rendering for the R3M eval should work as well.

suraj-nair-1 commented 2 years ago

Closing this for now as this is not an r3m issue, but rather a mujoco-py rendering issue.