forked from dusty-nv/jetson-containers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
164 lines (140 loc) · 5.14 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#---
# name: genesis-world
# group: robots
# config: config.py
# depends: [cuda, rust, cmake, torch, torchvision, torchaudio, vtk, pymeshlab, taichi, opencv:4.11.0, splashsurf]
# requires: '>=36.0.0'
# test: test.sh
# notes: https://github.com/Genesis-Embodied-AI/Genesis
#---
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
ARG GENESIS_VERSION \
FORCE_BUILD=off
ARG CUDAARCHS
ENV DEBIAN_FRONTEND=noninteractive
RUN PYTHON_TAG=$(python3 -c "import sys; print('{}.{}'.format(sys.version_info.major, sys.version_info.minor))") \
&& echo "PYTHON_TAG=${PYTHON_TAG}"
ARG PYTHON_VERSION=${PYTHON_TAG}
# Install necessary packages including extra dependencies for core and GUI module
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
manpages-dev \
zlib1g-dev \
xorg-dev libglu1-mesa-dev \
libsnappy-dev \
software-properties-common \
git \
curl \
wget \
ninja-build \
uuid-dev \
libglfw3-dev \
libxinerama-dev \
libxcursor-dev \
libxi-dev \
libvulkan-dev \
patchelf
RUN add-apt-repository ppa:ubuntu-toolchain-r/test && \
apt update && \
apt install -y --no-install-recommends \
gcc-11 \
g++-11 \
gcc-11 g++-11 patchelf && \
rm -rf /var/lib/apt/lists/*
# Set GCC-11 and G++-11 as the default
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 110 && \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 110
RUN pip3 install "pybind11[global]"
RUN rustup self uninstall -y && \
rm -rf /root/.cargo /root/.rustup
# ===============================================================
# BUILD LUISA RENDER
# ===============================================================
WORKDIR /workspace
RUN git clone --recursive https://github.com/Genesis-Embodied-AI/Genesis /opt/genesis
COPY build_luisa.sh /workspace/build_luisa.sh
RUN ./build_luisa.sh ${PYTHON_VERSION}
RUN pip3 install PyOpenGL PyOpenGL_accelerate --verbose
RUN pip3 install coacd libigl pymeshlab --verbose
# ===============================================================
# MORE PACKAGES
# ===============================================================
# Install runtime dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
tmux \
git \
curl \
wget \
bash-completion \
libgl1 \
libglx-mesa0 \
libegl-dev \
libegl1 \
libxrender1 \
libglib2.0-0 \
ffmpeg \
libgtk2.0-dev \
pkg-config \
libvulkan-dev \
libgles2 \
libglvnd0 \
libglx0 \
libtbb-dev \
zlib1g-dev \
libboost-iostreams-dev \
libblosc-dev \
vim \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*
RUN wget https://apt.llvm.org/llvm.sh && \
chmod +x llvm.sh && \
./llvm.sh 18 && \
rm llvm.sh
WORKDIR /workspace
# ===============================================================
# GENESIS BUILD
# ===============================================================
# FIX: More robust removal of blinker
RUN find / -name "blinker*" -print0 | xargs -0 -r rm -rf
RUN pip3 install open3d tetgen trimesh --verbose && \
cd /opt/genesis && \
sed -i '/numpy ==/d; /taichi/d; /tetgen/d' pyproject.toml && \
pip3 install "numpy<2.1" && \
pip3 install .
# ===============================================================
# INSTALL OMPL
# ===============================================================
# RUN wget https://ompl.kavrakilab.org/core/install-ompl-ubuntu.sh \
# && chmod u+x install-ompl-ubuntu.sh \
# && ./install-ompl-ubuntu.sh --python --github \
# && rm install-ompl-ubuntu.sh
RUN pip3 install ompl
# ===============================================================
# PATH
# ===============================================================
RUN if [ -d /opt/genesis/genesis/ext/LuisaRender/build/bin ]; then \
echo "Content in /opt/genesis/genesis/ext/LuisaRender/build/bin:" && \
ls -la /opt/genesis/genesis/ext/LuisaRender/build/bin; \
else \
echo "Folder /opt/genesis/genesis/ext/LuisaRender/build/bin not found"; \
fi
RUN mkdir -p /usr/local/lib/python${PYTHON_VERSION}/dist-packages/genesis/ext/LuisaRender/build/ && \
cp -r /opt/genesis/genesis/ext/LuisaRender/build/bin /usr/local/lib/python${PYTHON_VERSION}/dist-packages/genesis/ext/LuisaRender/build/
RUN echo "export LD_LIBRARY_PATH=/opt/genesis/genesis/ext/ParticleMesher/ParticleMesherPy:$LD_LIBRARY_PATH" >> ~/.bashrc && \
cd /opt/genesis/ && \
pip3 install --force-reinstall "numpy<2.1"
RUN ldconfig
RUN cd /tmp && \
wget https://us.download.nvidia.com/XFree86/aarch64/570.124.04/NVIDIA-Linux-aarch64-570.124.04.run && \
chmod +x NVIDIA-Linux-aarch64-570.124.04.run && \
sh NVIDIA-Linux-aarch64-570.124.04.run --extract-only && \
cd NVIDIA-Linux-aarch64-570.124.04 && \
cp -R ./libnvoptix.so.570.124.04 /usr/lib/aarch64-linux-gnu/ && \
cp -R ./libnvidia-rtcore.so.570.124.04 /usr/lib/aarch64-linux-gnu/ && \
cp -R ./nvoptix.bin /usr/lib/aarch64-linux-gnu/ && \
ln -sf /usr/lib/aarch64-linux-gnu/libnvoptix.so.570.124.04 /usr/lib/aarch64-linux-gnu/libnvoptix.so.1 && \
# Clean up
rm -rf /tmp/NVIDIA-Linux-aarch64-570.124.04.run /tmp/NVIDIA-Linux-aarch64-570.124.04
WORKDIR /opt/genesis/
CMD ["/bin/bash"]