ARISE-Initiative / robosuite

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

using robosuite without opengl on linux server #459

Closed nutsintheshell closed 2 months ago

nutsintheshell commented 8 months ago

I 'm using a linux server without opengl. when I runimport robosuite, the following error occurs:

`Traceback (most recent call last): File "/root/miniconda3/envs/tapnet/lib/python3.10/site-packages/OpenGL/platform/osmesa.py", line 22, in GL return ctypesloader.loadLibrary( File "/root/miniconda3/envs/tapnet/lib/python3.10/site-packages/OpenGL/platform/ctypesloader.py", line 45, in loadLibrary return dllType( name, mode ) File "/root/miniconda3/envs/tapnet/lib/python3.10/ctypes/init.py", line 374, in init self._handle = _dlopen(self._name, mode) OSError: ('OSMesa: cannot open shared object file: No such file or directory', 'OSMesa', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in File "/root/miniconda3/envs/tapnet/lib/python3.10/site-packages/robosuite/init.py", line 1, in from robosuite.environments.base import make File "/root/miniconda3/envs/tapnet/lib/python3.10/site-packages/robosuite/environments/init.py", line 1, in from .base import REGISTERED_ENVS, MujocoEnv File "/root/miniconda3/envs/tapnet/lib/python3.10/site-packages/robosuite/environments/base.py", line 12, in from robosuite.utils.binding_utils import MjRenderContextOffscreen, MjSim File "/root/miniconda3/envs/tapnet/lib/python3.10/site-packages/robosuite/utils/binding_utils.py", line 12, in import mujoco File "/root/miniconda3/envs/tapnet/lib/python3.10/site-packages/mujoco/init.py", line 47, in from mujoco.gl_context import File "/root/miniconda3/envs/tapnet/lib/python3.10/site-packages/mujoco/gl_context.py", line 38, in from mujoco.osmesa import GLContext as _GLContext File "/root/miniconda3/envs/tapnet/lib/python3.10/site-packages/mujoco/osmesa/init.py", line 31, in from OpenGL import GL File "/root/miniconda3/envs/tapnet/lib/python3.10/site-packages/OpenGL/GL/init.py", line 3, in from OpenGL import error as _error File "/root/miniconda3/envs/tapnet/lib/python3.10/site-packages/OpenGL/error.py", line 12, in from OpenGL import platform, _configflags File "/root/miniconda3/envs/tapnet/lib/python3.10/site-packages/OpenGL/platform/init.py", line 35, in _load() File "/root/miniconda3/envs/tapnet/lib/python3.10/site-packages/OpenGL/platform/init.py", line 32, in _load plugin.install(globals()) File "/root/miniconda3/envs/tapnet/lib/python3.10/site-packages/OpenGL/platform/baseplatform.py", line 92, in install namespace[ name ] = getattr(self,name,None) File "/root/miniconda3/envs/tapnet/lib/python3.10/site-packages/OpenGL/platform/baseplatform.py", line 14, in get value = self.fget( obj ) File "/root/miniconda3/envs/tapnet/lib/python3.10/site-packages/OpenGL/platform/osmesa.py", line 66, in GetCurrentContext function = self.OSMesa.OSMesaGetCurrentContext File "/root/miniconda3/envs/tapnet/lib/python3.10/site-packages/OpenGL/platform/baseplatform.py", line 14, in get value = self.fget( obj ) File "/root/miniconda3/envs/tapnet/lib/python3.10/site-packages/OpenGL/platform/osmesa.py", line 60, in OSMesa def OSMesa( self ): return self.GL File "/root/miniconda3/envs/tapnet/lib/python3.10/site-packages/OpenGL/platform/baseplatform.py", line 14, in get value = self.fget( obj ) File "/root/miniconda3/envs/tapnet/lib/python3.10/site-packages/OpenGL/platform/osmesa.py", line 28, in GL raise ImportError("Unable to load OpenGL library", err.args) ImportError: ('Unable to load OpenGL library', 'OSMesa: cannot open shared object file: No such file or directory', 'OSMesa', None)`

I wonder if there is a way to solve the problem or if I can run robosuite without opengl(I don't need to visualize any image on server). thanks

zhuyifengzju commented 8 months ago

You would need to install one of the GL packages (egl, osmesa, glx) for mujoco to run properly.

kevin-thankyou-lin commented 2 months ago

Osmesa installation: https://github.com/larskanis/osmesa/blob/master/README.md