diff --git a/README.md b/README.md index 4eae21d..6e1e35b 100644 --- a/README.md +++ b/README.md @@ -105,3 +105,8 @@ pip install -e . ![robogauge_levelpipeline](./assets/robogauge_levelpipeline.png) +## 可能的报错 +### Mujoco OpenGL Context Error +```mujoco.FatalError: an OpenGL platform library has not been loaded into this process, this most likely means that a valid OpenGL context has not been created before mjr_makeContext was called``` +问题原因: Mujoco在无头模式下无法创建OpenGL上下文 +解决方案: 在`robogauge/scripts/run.py`和`robogauge/scripts/server.py`中, 将`os.environ['MUJOCO_GL']`设置为`egl`(GPU)或`osmesa`(CPU, 慢) diff --git a/robogauge/scripts/run.py b/robogauge/scripts/run.py index ed41e22..9d0a6ed 100644 --- a/robogauge/scripts/run.py +++ b/robogauge/scripts/run.py @@ -8,7 +8,15 @@ @Desc : Run Robogauge Pipeline ''' import os -os.environ['MUJOCO_GL'] = 'glfw' # avoid mujoco.Renderer EGL context error + +# Headless solution for mujoco +# For GPU +# os.environ['MUJOCO_GL'] = 'egl' +# For CPU (Slow) +# os.environ['MUJOCO_GL'] = 'osmesa' +# With a graphical user interface (GUI) +os.environ['MUJOCO_GL'] = 'glfw' + os.environ["OMP_NUM_THREADS"] = "1" os.environ["MKL_NUM_THREADS"] = "1" diff --git a/robogauge/scripts/server.py b/robogauge/scripts/server.py index 8b8283b..2c1ba85 100644 --- a/robogauge/scripts/server.py +++ b/robogauge/scripts/server.py @@ -8,7 +8,15 @@ @Desc : Asynchronous stress pipeline evaluation server ''' import os -os.environ['MUJOCO_GL'] = 'glfw' # avoid mujoco.Renderer EGL context error + +# Headless solution for mujoco +# For GPU +# os.environ['MUJOCO_GL'] = 'egl' +# For CPU (Slow) +# os.environ['MUJOCO_GL'] = 'osmesa' +# With a graphical user interface (GUI) +os.environ['MUJOCO_GL'] = 'glfw' + os.environ["OMP_NUM_THREADS"] = "1" os.environ["MKL_NUM_THREADS"] = "1"