Open dilshan-dev opened 1 year ago
Hello,
This issue may be caused by openGL not being installed properly.
The MuJoCo Python bindings support three different OpenGL rendering backends: EGL (headless, hardware-accelerated), GLFW (windowed, hardware-accelerated), and OSMesa (purely software-based). At least one of these three backends must be available in order render through dm_control.
GLEW: http://glew.sourceforge.net/ http://glew.sourceforge.net/ The OpenGL Extension Wrangler Library (GLEW) is a cross-platform open-source C/C++ extension loading library.
Mesa: https://anaconda.org/conda-forge/mesalib https://anaconda.org/conda-forge/mesalib The Mesa project began as an open-source implementation of the OpenGL https://www.opengl.org/ specification - a system for rendering interactive 3D graphics. Mesa is an open-source implementation of the OpenGL specification - a system for rendering interactive 3D graphics.
GLFW GLFW is an Open Source, multi-platform library for OpenGL, OpenGL ES and Vulkan development on the desktop. It provides a simple API for creating windows, contexts and surfaces, receiving input and events.
Here are installation instructions that may be helpful https://github.com/openai/mujoco-py/issues/627#issuecomment-1007658905 https://github.com/openai/mujoco-py/issues/627#issuecomment-1007658905
Best regards
On Mar 1, 2023, at 10:20, dilshan-dev @.***> wrote:
Any help that can be offered is much appreciated
Hello, Thank you for your reply. Actually I have done a clean installation of the OS (after the error occurred) and I have tried dm_control and DrQv2 (repo) separately, which work fine (earlier dm_control did not work in the base system and DrQv2 did not work with conda).
I then came back to this repository and in the conda env I separately installed all three backends with the use of your reply, and when I run the experiment I am faced with the following error.
Traceback (most recent call last): File "/home/acar/Documents/RMBench-2022/00_DrQv2/drqv2_train.py", line 24, in
import dmc File "/home/acar/Documents/RMBench-2022/00_DrQv2/../dmc.py", line 11, in from dm_control import manipulation, suite File "/home/acar/anaconda3/envs/rmb/lib/python3.9/site-packages/dm_control/manipulation/init.py", line 20, in from dm_control import composer as _composer File "/home/acar/anaconda3/envs/rmb/lib/python3.9/site-packages/dm_control/composer/init.py", line 18, in from dm_control.composer.arena import Arena File "/home/acar/anaconda3/envs/rmb/lib/python3.9/site-packages/dm_control/composer/arena.py", line 20, in from dm_control import mjcf File "/home/acar/anaconda3/envs/rmb/lib/python3.9/site-packages/dm_control/mjcf/init.py", line 18, in from dm_control.mjcf.attribute import Asset File "/home/acar/anaconda3/envs/rmb/lib/python3.9/site-packages/dm_control/mjcf/attribute.py", line 28, in from dm_control.mujoco.wrapper import util File "/home/acar/anaconda3/envs/rmb/lib/python3.9/site-packages/dm_control/mujoco/init.py", line 18, in from dm_control.mujoco.engine import action_spec File "/home/acar/anaconda3/envs/rmb/lib/python3.9/site-packages/dm_control/mujoco/engine.py", line 41, in from dm_control import _render File "/home/acar/anaconda3/envs/rmb/lib/python3.9/site-packages/dm_control/_render/init.py", line 67, in Renderer = import_func() # pylint: disable=invalid-name File "/home/acar/anaconda3/envs/rmb/lib/python3.9/site-packages/dm_control/_render/init.py", line 46, in _import_osmesa from dm_control._render.pyopengl.osmesa_renderer import OSMesaContext File "/home/acar/anaconda3/envs/rmb/lib/python3.9/site-packages/dm_control/_render/pyopengl/osmesa_renderer.py", line 35, in from OpenGL import GL File "/home/acar/anaconda3/envs/rmb/lib/python3.9/site-packages/OpenGL/GL/init.py", line 4, in from OpenGL.GL.VERSION.GL_1_1 import File "/home/acar/anaconda3/envs/rmb/lib/python3.9/site-packages/OpenGL/GL/VERSION/GL_1_1.py", line 14, in from OpenGL.raw.GL.VERSION.GL_1_1 import File "/home/acar/anaconda3/envs/rmb/lib/python3.9/site-packages/OpenGL/raw/GL/VERSION/GL_1_1.py", line 7, infrom OpenGL.raw.GL import _errors File "/home/acar/anaconda3/envs/rmb/lib/python3.9/site-packages/OpenGL/raw/GL/_errors.py", line 4, in _error_checker = _ErrorChecker( _p, _p.GL.glGetError ) AttributeError: 'NoneType' object has no attribute 'glGetError'
I faced this error before as well and I sidestepped it with the instructions given in https://github.com/MPI-IS/mesh/issues/23#issuecomment-770860939, which then lead to the error I first mentioned.
When I do the same now, I am still faced with the initial error. Any further help you can offer is highly appreciated.
Thank you!
Hello,
Please note this issue:
File "/home/acar/Documents/RMBench-2022/00_DrQv2/drqv2_train.py", line 24, in import dmc File "/home/acar/Documents/RMBench-2022/00_DrQv2/../dmc.py", line 11, in from dm_control import manipulation, suite
This seems to be a problem with dm_control. But you mentioned that dm_control works fine. I have no idea with this.
Please make sure that dm_control is running properly and that the openGL related packages are installed.
Best regards.
On Mar 2, 2023, at 13:31, dilshan-dev @.***> wrote:
dm_control
Hello,
Thank you for your reply.
I was able to proceed without errors and run the experiments by using GLFW instead of OSMesa (setting os.environ['MUJOCO_GL'] = 'glfw'
instead of os.environ['MUJOCO_GL'] = 'osmesa'
in the [ALGORITHM_NAME].py
file).
I also had to change the gpu_id:
to 0 (in my case) in config.yaml
file under /[ALGORITHM_FOLDER]/cfgs/
.
Many thanks for your prompt replies and for making this work available.
Cheers.
You're welcome, I'm glad to be of help.
Best regards.
On Mar 6, 2023, at 08:28, dilshan-dev @.***> wrote:
Hello,
Thank you for your reply.
I was able to proceed without errors and run the experiments by using GLFW instead of OSMesa (setting os.environ['MUJOCO_GL'] = 'glfw' instead of os.environ['MUJOCO_GL'] = 'osmesa' in the [ALGORITHM_NAME].py file).
I also had to change the gpu_id: to 0 (in my case) in config.yaml file under /[ALGORITHM_FOLDER]/cfgs/.
Many thanks for your prompt replies and for making this work available.
Cheers.
— Reply to this email directly, view it on GitHub https://github.com/xiangyanfei212/RMBench-2022/issues/1#issuecomment-1455265646, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQY4HQTC6KVZT5C4UNBQVRLW2UVTZANCNFSM6AAAAAAVLO4RVM. You are receiving this because you commented.
Hello, I tried to run the experiment using
python vpg_train.py task=reach_site
and I get the following error.I tried various solutions related to PyOpenGL and osmesa but I couldn't resolve it. I am using Ubuntu 22.04 and I created a conda env with the packages. The same error is present when running with other algorithms such as SAC and DrQv2. Any help that can be offered is much appreciated. Thank you!