forked from princeton-vl/infinigen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: datashaman <[email protected]> Co-authored-by: David Yan <[email protected]>
- Loading branch information
1 parent
a27e620
commit 887eb82
Showing
5 changed files
with
172 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
ARG APP_IMAGE=continuumio/miniconda3 | ||
FROM ${APP_IMAGE} | ||
ARG APP_IMAGE | ||
ENV PATH="/root/miniconda3/bin:${PATH}" | ||
RUN if [ "$APP_IMAGE" = "nvidia/cuda:12.0.0-devel-ubuntu22.04" ]; then \ | ||
echo "Using CUDA image" && \ | ||
apt-get update && \ | ||
apt-get install -y unzip sudo git g++ libglm-dev libglew-dev libglfw3-dev libgles2-mesa-dev zlib1g-dev wget cmake vim libxi6 libgconf-2-4 && \ | ||
wget \ | ||
https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \ | ||
&& mkdir /root/.conda \ | ||
&& bash Miniconda3-latest-Linux-x86_64.sh -b \ | ||
&& rm -f Miniconda3-latest-Linux-x86_64.sh; \ | ||
else \ | ||
echo "Using Conda image" && \ | ||
apt-get update -yq \ | ||
&& apt-get install -yq \ | ||
cmake \ | ||
g++ \ | ||
libgconf-2-4 \ | ||
libgles2-mesa-dev \ | ||
libglew-dev \ | ||
libglfw3-dev \ | ||
libglm-dev \ | ||
libxi6 \ | ||
sudo \ | ||
unzip \ | ||
vim \ | ||
zlib1g-dev; \ | ||
fi | ||
|
||
RUN mkdir /opt/infinigen | ||
WORKDIR /opt/infinigen | ||
COPY . . | ||
RUN chmod +x worldgen/tools/compile_opengl.sh | ||
RUN conda init bash \ | ||
&& . ~/.bashrc \ | ||
&& conda create --name infinigen python=3.10 \ | ||
&& conda activate infinigen \ | ||
&& ./install.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
DOCKER_BUILD_PROGRESS ?= auto | ||
DOCKER_TAG ?= infinigen_docker_img | ||
|
||
PWD = $(shell pwd) | ||
|
||
XSOCK=/tmp/.X11-unix | ||
XAUTH=/tmp/.docker.xauth | ||
|
||
default: | ||
|
||
docker-build: | ||
git submodule init | ||
git submodule update | ||
docker build \ | ||
--tag $(DOCKER_TAG) \ | ||
--progress $(DOCKER_BUILD_PROGRESS) . | ||
|
||
docker-build-cuda: | ||
git submodule init | ||
git submodule update | ||
docker build \ | ||
--tag $(DOCKER_TAG) \ | ||
--progress $(DOCKER_BUILD_PROGRESS) \ | ||
--build-arg APP_IMAGE=nvidia/cuda:12.0.0-devel-ubuntu22.04 . | ||
|
||
docker-clean: | ||
echo "Removing infinigen docker image if already exists..." | ||
-docker rmi -f $(DOCKER_TAG) | ||
|
||
docker-setup: | ||
sudo apt-get install x11-xserver-utils \ | ||
&& touch ~/.Xauthority \ | ||
&& xauth add $(HOST):0 . $(shell xxd -l 16 -p /dev/urandom) \ | ||
&& touch "$(XAUTH)" \ | ||
&& xauth nlist "$(DISPLAY)" | sed -e 's/^..../ffff/' | xauth -f "$(XAUTH)" nmerge - \ | ||
&& xhost +local:docker | ||
|
||
docker-run: | ||
docker run -td --privileged --net=host --ipc=host \ | ||
--name="infinigen" \ | ||
--gpus=all \ | ||
--env NVIDIA_DISABLE_REQUIRE=1 \ | ||
-e "BLENDER=/opt/infinigen/blender/blender" \ | ||
-e "DISPLAY=$(DISPLAY)" \ | ||
-e "QT_X11_NO_MITSHM=1" \ | ||
-v "/tmp/.X11-unix:/tmp/.X11-unix:rw" \ | ||
-v $(PWD)/worldgen/outputs:/opt/infinigen/worldgen/outputs \ | ||
-e "XAUTHORITY=$(XAUTH)" \ | ||
-e ROS_IP=127.0.0.1 \ | ||
--cap-add=SYS_PTRACE \ | ||
-v /etc/group:/etc/group:ro \ | ||
"$(DOCKER_TAG)" /bin/bash \ | ||
|| docker run -td --privileged --net=host --ipc=host \ | ||
--name="infinigen" \ | ||
--device /dev/dri \ | ||
-e "BLENDER=/opt/infinigen/blender/blender" \ | ||
-e "DISPLAY=$(DISPLAY)" \ | ||
-e "QT_X11_NO_MITSHM=1" \ | ||
-v "/tmp/.X11-unix:/tmp/.X11-unix:rw" \ | ||
-v $(PWD)/worldgen/outputs:/opt/infinigen/worldgen/outputs \ | ||
-e "XAUTHORITY=$(XAUTH)" \ | ||
-e ROS_IP=127.0.0.1 \ | ||
--cap-add=SYS_PTRACE \ | ||
-v /etc/group:/etc/group:ro \ | ||
"$(DOCKER_TAG)" bash | ||
|
||
docker exec infinigen /bin/bash -c worldgen/tools/compile_opengl.sh | ||
|
||
docker-run-no-opengl: | ||
echo "Launching Docker image without OpenGL ground truth" | ||
docker run -td --rm --privileged --net=host --ipc=host \ | ||
--name="infinigen" \ | ||
--gpus=all \ | ||
--env NVIDIA_DISABLE_REQUIRE=1 \ | ||
-e "BLENDER=/opt/infinigen/blender/blender" \ | ||
-v $(PWD)/worldgen/outputs:/opt/infinigen/worldgen/outputs \ | ||
"$(DOCKER_TAG)" /bin/bash | ||
|
||
docker-run-no-gpu: | ||
echo "Launching Docker image without GPU passthrough" | ||
docker run -td --privileged --net=host --ipc=host \ | ||
--name="infinigen" \ | ||
-e "BLENDER=/opt/infinigen/blender/blender" \ | ||
-e "DISPLAY=$(DISPLAY)" \ | ||
-e "QT_X11_NO_MITSHM=1" \ | ||
-v "/tmp/.X11-unix:/tmp/.X11-unix:rw" \ | ||
-v $(PWD)/worldgen/outputs:/opt/infinigen/worldgen/outputs \ | ||
-e "XAUTHORITY=$(XAUTH)" \ | ||
-e ROS_IP=127.0.0.1 \ | ||
--cap-add=SYS_PTRACE \ | ||
-v /etc/group:/etc/group:ro \ | ||
"$(DOCKER_TAG)" /bin/bash \ | ||
|
||
docker exec infinigen /bin/bash -c worldgen/tools/compile_opengl.sh | ||
|
||
docker-run-no-gpu-opengl: | ||
echo "Launching Docker image without GPU passthrough or OpenGL" | ||
docker run -td --rm --privileged --net=host --ipc=host \ | ||
--name="infinigen" \ | ||
-e "BLENDER=/opt/infinigen/blender/blender" \ | ||
-v $(PWD)/worldgen/outputs:/opt/infinigen/worldgen/outputs \ | ||
"$(DOCKER_TAG)" /bin/bash | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,5 +116,5 @@ rm -rf build | |
cd - | ||
|
||
if [ "$1" = "opengl" ]; then | ||
|
||
bash ./worldgen/tools/compile_opengl.sh | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
# Compile process_mesh (i.e. OpenGL-based ground truth) | ||
cd ./process_mesh | ||
cmake -S . -Bbuild -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_BUILD_TYPE=Release | ||
cmake --build build --target all | ||
./build/process_mesh -in x -out x --height 100 --width 10 --frame 0 | ||
if [ $? -eq 174 ]; then | ||
echo "OpenGL/EGL ground truth is working." | ||
else | ||
echo "WARNING: OpenGL/EGL is not supported on this machine. If you are running from a cluster head-node, this is likely not an issue." | ||
fi | ||
cd - |