openai / mujoco-py

MuJoCo is a physics engine for detailed, efficient rigid body simulations with contacts. mujoco-py allows using MuJoCo from Python 3.
Other
2.81k stars 810 forks source link

Found 0 GPUs for rendering. Using device 0.RuntimeError: Failed to initialize OpenGL #717

Open xuweiqiang486 opened 2 years ago

xuweiqiang486 commented 2 years ago

Describe the bug viewer = mujoco_py.MjRenderContextOffscreen(sim)

Error Messages Found 0 GPUs for rendering. Using device 0. Device id outside of range of available devices. Traceback (most recent call last): File "/home/xwq/桌面/robustified/shiyan.py", line 86, in viewer = mujoco_py.MjRenderContextOffscreen(sim) 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

Desktop (please complete the following information):

Environment

yhogewind commented 2 years ago

For offscreen rendering you should not preload libGLEW. So execute the following in your terminal: unset LD_PRELOAD

Unless you must use mujoco-py, you are probably best off moving over to deepmind/mujoco