Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dockerfile #14

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM nvidia/cuda:12.6.3-cudnn-devel-ubuntu22.04

# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV NVIDIA_DRIVER_CAPABILITIES=all
ENV DISPLAY=unix$DISPLAY

# Install necessary packages
RUN apt-get update && apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
sudo \
software-properties-common \
python-is-python3 \
git \
python3-pip \
libgl1-mesa-glx \
libglu1-mesa \
libxrandr2 \
libxinerama1 \
libxcursor1 \
libxi6 \
libx11-dev \
&& rm -rf /var/lib/apt/lists/*

# Clone the repository
WORKDIR /root/
RUN git clone https://github.com/LeCar-Lab/dial-mpc.git --depth 1

# Install the package
WORKDIR /root/dial-mpc
RUN pip3 install -e .

# Default command
CMD ["/bin/bash"]
45 changes: 45 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Docker Tutorial for [DIAL-MPC](https://github.com/LeCAR-Lab/dial-mpc)

This folder contains the Dockerfile of the DIAL-MPC.
DIAL-MPC is an impressive framework for legged robot ***full-order torque-level*** control with both precision and agility in a ***training-free*** manner.
You can find the DIAL-MPC in [here](https://github.com/LeCAR-Lab/dial-mpc).

## Requirenments
> [!CAUTION]
> You need a Linux or Ubuntu system with Nvidia-driver (>=525.60.13) to support CUDA 12.*

## Docker and Nvidia-toolkit installation
### Step 1. Docker install
``` bash
curl -fsSL https://get.docker.com -o get-docker.sh
sudo bash get-docker.sh
```
### Step 2. Docker Postinstall(Follow [here](https://docs.docker.com/engine/install/linux-postinstall/))
### Step 3. Docker Nvidia Toolkit(Follow [here](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html))

### Step 4. (Optional) Install xhost
``` bash
sudo apt install x11-xserver-utils
```
## Build Docker Env
``` bash
git clone https://github.com/XuXinhangNTU/dial-mpc-docker
cd dial-mpc-docker
docker build -t dial-mpc .
```
### First Time Run (Create the container)
```bash
xhost +
docker run -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY --gpus all --name <Your Name> dial-mpc
```
### Second Time Run
```bash
xhost +
docker start <Your Name> && docker exec -it <Your Name> bash
```
## Tips
The vscode plugin "Dev Containers" is very easy to use when you do docker development.

## Notice
> [!CAUTION]
> If the demo looks odd, check your GPU usage! RTX 3090 is tested.