RL with LIBERO on Ascend CANN#
Run the LIBERO RL example on Ascend CANN. This page covers only the CANN-specific dependency installation and runtime access to the host Ascend driver. The LIBERO task description, PPO/GRPO algorithm details, model download, configuration files, metrics, and results are platform independent — see RL with LIBERO Benchmarks.
Installation#
The key difference from the NVIDIA workflow is that dependencies must be
installed with the Ascend backend. install.sh installs the CPU PyTorch wheel
and then adds the matching torch-npu package for Ascend.
Option 1: Docker Image#
Use an Ascend LIBERO image, or build one from the RLinf Dockerfile. The container must be run in privileged mode and the host Ascend driver must be mounted into the container:
docker run -it --rm \
--privileged \
--ipc=host \
--shm-size 20g \
--network host \
--name rlinf-ascend-libero \
-v /usr/local/dcmi:/usr/local/dcmi \
-v /usr/local/Ascend/driver:/usr/local/Ascend/driver \
-v /etc/ascend_install.info:/etc/ascend_install.info \
-v /var/log/npu:/usr/slog \
-v /usr/local/sbin/npu-smi:/usr/local/sbin/npu-smi \
-v /sys/fs/cgroup:/sys/fs/cgroup:ro \
-v .:/workspace/RLinf \
rlinf/rlinf:agentic-rlinf0.3-libero-cann9.0
# For mainland China users, you can use the following for better download speed:
# docker.1ms.run/rlinf/rlinf:agentic-rlinf0.3-libero-cann9.0
If you don’t want to use privileged flag, then you need to add serval devices, and manually add NPU:
# adding text below to the above command
--device=/dev/davinci_manager \
--device=/dev/devmm_svm \
--device=/dev/hisi_hdc \
--device=/dev/davinci0 # first npu for example
Inside the container, switch to the OpenVLA-OFT environment:
source switch_env openvla-oft
If you build the Docker image yourself, pass the Ascend platform and CANN image
version explicitly. CANN_VER includes the hardware tag used by the base
image:
docker build \
--build-arg PLATFORM=ascend \
--build-arg CANN_VER=9.0.0-910b \
--build-arg UBUNTU_VER=22.04 \
--build-arg BUILD_TARGET=embodied-libero \
-t rlinf-libero-cann9 .
The Dockerfile uses the CANN base image:
swr.cn-south-1.myhuaweicloud.com/ascendhub/cann:${CANN_VER}-ubuntu${UBUNTU_VER}-py3.11
Option 2: Native Installation#
Install dependencies with install.sh and pass --platform ascend:
bash requirements/install.sh --platform ascend embodied --model openvla-oft --env libero
source .venv/bin/activate
For faster downloads in mainland China, add --use-mirror:
bash requirements/install.sh --use-mirror --platform ascend embodied --model openvla-oft --env libero
LIBERO CPU Rendering#
Use CPU rendering for LIBERO on Ascend. Set both rendering variables before launching the training script:
export MUJOCO_GL=osmesa
export PYOPENGL_PLATFORM=osmesa
The helper script examples/embodiment/run_embodiment.sh respects these
environment variables. If they are unset, it keeps the default EGL behavior used
by other examples.
Launch LIBERO on Ascend#
After the dependencies and model paths are ready, run the same LIBERO configuration described in the main LIBERO guide, but keep OSMesa enabled:
MUJOCO_GL=osmesa \
PYOPENGL_PLATFORM=osmesa \
ROBOT_PLATFORM=LIBERO \
bash examples/embodiment/run_embodiment.sh libero_10_grpo_openvlaoft
For PPO, use the PPO config from the original LIBERO page:
MUJOCO_GL=osmesa \
PYOPENGL_PLATFORM=osmesa \
ROBOT_PLATFORM=LIBERO \
bash examples/embodiment/run_embodiment.sh libero_10_ppo_openvlaoft
GR00T N1.5 on Ascend#
GR00T N1.5 also runs on Ascend. Install it with the gr00t model and the
maniskill_libero environment, which covers the LIBERO tasks:
bash requirements/install.sh --platform ascend embodied --model gr00t --env maniskill_libero
source .venv/bin/activate
On Ascend, install.sh builds decord from source (no aarch64 wheel is
published) and applies a TensorFlow build pinned for GR00T. flash-attention is
skipped, and GR00T switches to NPU kernels automatically at load time, so no
config changes are required.
Launch a GR00T LIBERO run with OSMesa rendering, using the configs from the GR00T example:
MUJOCO_GL=osmesa \
PYOPENGL_PLATFORM=osmesa \
ROBOT_PLATFORM=LIBERO \
bash examples/embodiment/run_embodiment.sh libero_spatial_ppo_gr00t
What Stays the Same#
Use the same LIBERO configs documented in RL with LIBERO Benchmarks.
Use the same model download and
model_pathconfiguration flow.Use the same PPO/GRPO algorithm settings and placement concepts.
Monitor the same training, rollout, and environment metrics.