Won't run on school's compute
This is the last thing the system admin said:
yeah I saw seg faults as well. I think at this point we might have to throw up our hands. this code seems to be somewhat ubuntu specific and I’m not sure if it’s been tested on RHEL. we could try posting an issue on github
Hi! Could you please give us the native stack trace at the point where you hit a segfault?
Thanks! Yeah, it’s on a web interface to their servers, so I can send a screenshot I uploaded: https://drive.google.com/file/d/1XKcgdsqN-9uRI27C_IXB0VB4dhVwfe9s/view?usp=drivesdk
Can you go up further than that? Looks like there's more error message there. (Also, if it's possible to copy the text and paste it here rather than a screenshot that would be even more useful.)
Actually, it depends. First, when I run while including the line os.environ['MUJOCO_GL'] = 'egl', I get:
(/scratch/slerman/myenvs/drqv2) [slerman@bhg0002 drqv2]$ python train.py task=quadruped_walk
Traceback (most recent call last):
File "train.py", line 19, in <module>
import dmc
File "/gpfs/fs1/home/slerman/drqv2/dmc.py", line 10, in <module>
from dm_control import manipulation, suite
File "/scratch/slerman/myenvs/drqv2/lib/python3.8/site-packages/dm_control/manipulation/__init__.py", line 20, in <module>
from dm_control import composer as _composer
File "/scratch/slerman/myenvs/drqv2/lib/python3.8/site-packages/dm_control/composer/__init__.py", line 18, in <module>
from dm_control.composer.arena import Arena
File "/scratch/slerman/myenvs/drqv2/lib/python3.8/site-packages/dm_control/composer/arena.py", line 20, in <module>
from dm_control import mjcf
File "/scratch/slerman/myenvs/drqv2/lib/python3.8/site-packages/dm_control/mjcf/__init__.py", line 18, in <module>
from dm_control.mjcf.attribute import Asset
File "/scratch/slerman/myenvs/drqv2/lib/python3.8/site-packages/dm_control/mjcf/attribute.py", line 28, in <module>
from dm_control.mujoco.wrapper import util
File "/scratch/slerman/myenvs/drqv2/lib/python3.8/site-packages/dm_control/mujoco/__init__.py", line 18, in <module>
from dm_control.mujoco.engine import action_spec
File "/scratch/slerman/myenvs/drqv2/lib/python3.8/site-packages/dm_control/mujoco/engine.py", line 41, in <module>
from dm_control import _render
File "/scratch/slerman/myenvs/drqv2/lib/python3.8/site-packages/dm_control/_render/__init__.py", line 67, in <module>
Renderer = import_func() # pylint: disable=invalid-name
File "/scratch/slerman/myenvs/drqv2/lib/python3.8/site-packages/dm_control/_render/__init__.py", line 36, in _import_egl
from dm_control._render.pyopengl.egl_renderer import EGLContext
File "/scratch/slerman/myenvs/drqv2/lib/python3.8/site-packages/dm_control/_render/pyopengl/egl_renderer.py", line 75, in <module>
raise ImportError('Cannot initialize a headless EGL display.')
ImportError: Cannot initialize a headless EGL display.
Then, when I comment that line out as the author of the repo (officially released by Facebook) suggested, I get this error:
(/scratch/slerman/myenvs/drqv2) [slerman@bhg0002 drqv2]$ python train.py task=quadruped_walk
/home/slerman/.local/lib/python3.8/site-packages/glfw/__init__.py:834: GLFWError: (65544) b'X11: The DISPLAY environment variable is missing'
warnings.warn(message, GLFWError)
workspace: /gpfs/fs1/home/slerman/drqv2/exp_local/2021.10.15/210551_task=quadruped_walk
/home/slerman/.local/lib/python3.8/site-packages/glfw/__init__.py:834: GLFWError: (65537) b'The GLFW library is not initialized'
warnings.warn(message, GLFWError)
python: /builds/florianrhiem/pyGLFW/glfw-3.3.4/src/posix_thread.c:64: _glfwPlatformGetTls: Assertion `tls->posix.allocated == 1' failed.
Aborted (core dumped)
To this, the system admin recommended that I try the web interface interactive GPU. So I tried there and that yielded the different error that I screenshoted above. However, that's all there is to the error. The before part was just because I hadn't loaded glew and glfw
Sorry, made some typos. Updated them just now.
Thanks for any help! We're trying an older version of mujoco now to see if that works. The system admin just sent me this, wondering if you can answer it: if you’re in touch with any of the developers … can you ask them what versions of mujuco_py, dm_control, etc might still work with mujoco131 ?
Hi, I still get an error on school compute about OpenGL (same one that I get on my M1 MacBook). I tried both
pip install PyOpenGL-accelerate
and
conda install pyopengl
- Does software rendering work for you (
MUJOCO_GL=osmesa)? This depends on GLX and OSMesa - see the instructions here. - In the case where you are running on your school's remote server and seeing the error message in the screenshot starting with
OpenGL version 1.5 or higher required, what is the output ofglxinfo | grep -i "opengl\|glx"? - In the case where you are seeing
X11: The DISPLAY environment variable is missing, are you connecting to a remote server over SSH? GLFW requires an X display, and X11 forwarding (ssh -X) uses indirect rendering, which probably won't support a high enough version of OpenGL for MuJoCo to work (see here).
can you ask them what versions of mujuco_py, dm_control, etc might still work with mujoco131 ?
I can't speak for mujoco_py, but the earliest version of MuJoCo that dm_control ever supported was 1.5, which was released back in 2017.
Coming back to this now in the context of MuJoCo 2.1.1 release, I'm now fairly certain that neither MuJoCo nor dm_control make Ubuntu-specific assumptions. The 2.1.1 MuJoCo build for x86_64 is compliant with the manylinux2010 ABI requirements so should work on the vast majority of Linux distros over the past 10 years.
Can you get a list of installed packages on the machine? After having looked at #214 it seems that one possible issue is that the Nvidia GL driver isn't installed.
I have the same problem. Can you tell me how did you solve it? @slerman12
/opt/conda/lib/python3.8/site-packages/glfw/init.py:906: GLFWError: (65537) b'The GLFW library is not initialized' warnings.warn(message, GLFWError) python: /builds/florianrhiem/pyGLFW/glfw-3.3.6/src/posix_thread.c:64: _glfwPlatformGetTls: Assertion `tls->posix.allocated == 1' failed.
I found that if I run my scripts locally, I would not get this error. But when I visit my computer via ssh tool, this happens. So I doubt that this may cause by "headless hardware". Solve this issue in the following steps.
This link(https://github.com/deepmind/dm_control#rendering)](https://github.com/deepmind/dm_control#rendering) illustrates how mujoco renders.
Firstly
sudo apt-get -y install libglfw3 libglew2.0 libgl1-mesa-glx libosmesa6 libglew-dev
Then setting
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libGLEW.so
Then setting the render mode in code
os.environ['MUJOCO_GL']="egl"
My code works.
@saran-t
I have the same problem. Can you tell me how did you solve it? @slerman12我也有同样的问题。你能告诉我你是怎么解决的吗? @slerman12
/opt/conda/lib/python3.8/site-packages/glfw/init.py:906: GLFWError: (65537) b'The GLFW library is not initialized'/opt/conda/lib/python3.8/site-packages/glfw/init.py:906: GLFWError: (65537) b'The GLFW library is not initialized' warnings.warn(message, GLFWError)警告。警告(消息,GLFWError) python: /builds/florianrhiem/pyGLFW/glfw-3.3.6/src/posix_thread.c:64: _glfwPlatformGetTls: Assertion
tls->posix.allocated == 1' failed.python:/builds/florianrhiem/pyGLFW/glfw-3.3.6/src/posix_thread.c:64:_glfwPlatformGetTls:断言tls->posix.allocated == 1'失败。
I got same problem!!!,But when you set os.environ['MUJOCO_GL'] = 'osmesa' it will not happen!