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

Can I use camera obervation with 1 GPU #199

Closed
huang1997214 opened this issue Mar 3, 2021 · 5 comments
Closed

Can I use camera obervation with 1 GPU #199

huang1997214 opened this issue Mar 3, 2021 · 5 comments

Comments

@huang1997214
Copy link

When I make the environment.

env = nl_guide_lift_env(
robots="Sawyer", # try with other robots like "Sawyer" and "Jaco"
has_renderer=False,
has_offscreen_renderer=True,
use_camera_obs=True,
ignore_done=True,
render_visual_mesh=True,
control_freq=20,
)

The following error occurs
File "mujoco_py/mjrendercontext.pyx", line 45, in mujoco_py.cymj.MjRenderContext.init
File "mujoco_py/mjrendercontext.pyx", line 113, in mujoco_py.cymj.MjRenderContext._setup_opengl_context
File "mujoco_py/opengl_context.pyx", line 130, in mujoco_py.cymj.OffscreenOpenGLContext.init
RuntimeError: Failed to initialize OpenGL

This seems to result in 1 GPU. I wondering if there is some way that I can use 1GPU to get the image observation.
I want to use image observation to train a DQN.
Thanks!

@hermanjakobsen
Copy link
Contributor

This is a known issue with mujoco-py and rendering. I have posted a similar issue some time ago :)

@huang1997214
Copy link
Author

Sorry, I am not familiar with mujoco-py.

@RayYoh
Copy link

RayYoh commented Nov 24, 2021

This is a known issue with mujoco-py and rendering. I have posted a similar issue some time ago :)

So how to solve this problem?

@peterdavidfagan
Copy link

peterdavidfagan commented Nov 25, 2021

@RayYoh it is a bit of a hack but you can use the following from my experience: openai/mujoco-py#268 (comment)

Kudos to @HesNobi for this.

@RayYoh
Copy link

RayYoh commented Nov 26, 2021

@RayYoh it is a bit of a hack but you can use the following from my experience: openai/mujoco-py#268 (comment)

Kudos to @HesNobi for this.

Thanks a lot. Hope it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants