Skip to content

Commit 981483d

Browse files
authored
use EGL for headless GPU rendering in libero example (#837)
This PR updates the libero example Docker configuration to use EGL-based headless rendering instead of X11, removing the need for privileged mode and X11 socket access. This PR also enables GPU acceleration for faster environment steps.
2 parents bd70b8f + 75db10c commit 981483d

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

examples/libero/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ RUN apt-get update && \
1616
clang \
1717
libosmesa6-dev \
1818
libgl1-mesa-glx \
19+
libegl1 \
1920
libglew-dev \
2021
libglfw3-dev \
2122
libgles2-mesa-dev \
@@ -56,4 +57,6 @@ datasets: /app/third_party/libero/libero/datasets
5657
assets: /app/third_party/libero/libero/libero/assets
5758
EOF
5859

60+
RUN mkdir -p /usr/share/glvnd/egl_vendor.d && echo '{"file_format_version" : "1.0.0", "ICD" : { "library_path" : "libEGL_nvidia.so.0" }}' > /usr/share/glvnd/egl_vendor.d/10_nvidia.json
61+
5962
CMD ["/bin/bash", "-c", "source /.venv/bin/activate && python examples/libero/main.py $CLIENT_ARGS"]

examples/libero/compose.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ services:
2020
- CLIENT_ARGS
2121
- DISPLAY=$DISPLAY
2222
- MUJOCO_GL=${MUJOCO_GL:-egl}
23+
- MUJOCO_EGL_DEVICE_ID=0
24+
- NVIDIA_DRIVER_CAPABILITIES=all
25+
- PYOPENGL_PLATFORM=egl
2326
deploy:
2427
resources:
2528
reservations:

0 commit comments

Comments
 (0)