ARISE-Initiative / robosuite

robosuite: A Modular Simulation Framework and Benchmark for Robot Learning
https://robosuite.ai
Other
1.34k stars 414 forks source link

Error After Initial Installation #432

Closed zjallgood closed 2 months ago

zjallgood commented 12 months ago

I am attempting to run the demo file from the example from the quick start documentation:

import numpy as np import robosuite as suite

create environment instance

env = suite.make( env_name="Lift", # try with other tasks like "Stack" and "Door" robots="Panda", # try with other robots like "Sawyer" and "Jaco" has_renderer=True, has_offscreen_renderer=False, use_camera_obs=False, )

reset the environment

env.reset()

for i in range(1000): action = np.random.randn(env.robots[0].dof) # sample random action obs, reward, done, info = env.step(action) # take action in the environment env.render() # render on display

Upon running the above code, I get the following message

[robosuite WARNING] No private macro file found! (init.py:7) [robosuite WARNING] It is recommended to use a private macro file (init.py:8) [robosuite WARNING] To setup, run: python /home/vboxuser_/PycharmProjects/pythonProject/venv/lib/python3.10/site-packages/robosuite/scripts/setupmacros.py (init.py:9) VMware: No 3D enabled (0, Success). libEGL warning: egl: failed to create dri2 screen VMware: No 3D enabled (0, Success). libEGL warning: egl: failed to create dri2 screen VMware: No 3D enabled (0, Success). libEGL warning: egl: failed to create dri2 screen VMware: No 3D enabled (0, Success). libEGL warning: egl: failed to create dri2 screen Traceback (most recent call last): File "/home/vboxuser/PycharmProjects/pythonProject/main.py", line 5, in env = suite.make( File "/home/vboxuser_/PycharmProjects/pythonProject/venv/lib/python3.10/site-packages/robosuite/environments/base.py", line 40, in make return REGISTERED_ENVS[envname](*args, **kwargs) File "/home/vboxuser/PycharmProjects/pythonProject/venv/lib/python3.10/site-packages/robosuite/environments/manipulation/lift.py", line 183, in init super().init( File "/home/vboxuser_/PycharmProjects/pythonProject/venv/lib/python3.10/site-packages/robosuite/environments/manipulation/manipulationenv.py", line 162, in init super().init( File "/home/vboxuser/PycharmProjects/pythonProject/venv/lib/python3.10/site-packages/robosuite/environments/robotenv.py", line 214, in init super().init( File "/home/vboxuser/PycharmProjects/pythonProject/venv/lib/python3.10/site-packages/robosuite/environments/base.py", line 143, in init self._resetinternal() File "/home/vboxuser/PycharmProjects/pythonProject/venv/lib/python3.10/site-packages/robosuite/environments/manipulation/lift.py", line 389, in _reset_internal super()._resetinternal() File "/home/vboxuser/PycharmProjects/pythonProject/venv/lib/python3.10/site-packages/robosuite/environments/robot_env.py", line 510, in _reset_internal super()._resetinternal() File "/home/vboxuser/PycharmProjects/pythonProject/venv/lib/python3.10/site-packages/robosuite/environments/base.py", line 296, in _reset_internal render_context = MjRenderContextOffscreen(self.sim, device_id=self.render_gpu_deviceid) File "/home/vboxuser/PycharmProjects/pythonProject/venv/lib/python3.10/site-packages/robosuite/utils/binding_utils.py", line 210, in init super().init(sim, offscreen=True, device_id=device_id, max_width=max_width, max_height=maxheight) File "/home/vboxuser/PycharmProjects/pythonProject/venv/lib/python3.10/site-packages/robosuite/utils/binding_utils.py", line 78, in init self.gl_ctx = GLContext(max_width=max_width, max_height=max_height, device_id=self.deviceid) File "/home/vboxuser/PycharmProjects/pythonProject/venv/lib/python3.10/site-packages/robosuite/renderers/context/egl_context.py", line 123, in init raise ImportError( ImportError: Cannot initialize a EGL device display. This likely means that your EGL driver does not support the PLATFORMDEVICE extension, which is required for creating a headless rendering context. Exception ignored in: <function EGLGLContext.del at 0x7f8eede5f370> Traceback (most recent call last): File "/home/vboxuser/PycharmProjects/pythonProject/venv/lib/python3.10/site-packages/robosuite/renderers/context/eglcontext.py", line 155, in del self.free() File "/home/vboxuser/PycharmProjects/pythonProject/venv/lib/python3.10/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 0x7f8eede5f520> Traceback (most recent call last): File "/home/vboxuser/PycharmProjects/pythonProject/venv/lib/python3.10/site-packages/robosuite/utils/binding_utils.py", line 198, in del self.con.free() AttributeError: 'MjRenderContextOffscreen' object has no attribute 'con'

Any guidance on this issue is greatly appreciated. Thank you.

zhuyifengzju commented 11 months ago

Hi, are you running this on a virtual machine? Please consult the mujoco repo to resolve the cause to your error:

ImportError: Cannot initialize an EGL device display. This likely means that your EGL driver does not support the PLATFORM_DEVICE extension, which is required for creating a headless rendering context.