SW777SW commited on
Commit
305ab14
·
verified ·
1 Parent(s): 8b9a89c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +101 -51
Dockerfile CHANGED
@@ -1,68 +1,118 @@
1
- # Use the pre-built PyTorch Docker image with CUDA
2
- FROM pytorch/pytorch:2.1.2-cuda11.8-cudnn8-devel
3
 
4
- # Install build deps
5
- RUN apt-get update -y && apt-get install -y wget git vim ninja-build \
6
- && apt-get clean && rm -f /var/lib/apt/lists/*_*
7
 
8
- # Set up environment variables
9
- ENV CUDA_HOME=/usr/local/cuda
10
- # ENV CONDA_DIR=/opt/conda
11
- # ENV PATH=$CONDA_DIR/bin:$PATH
12
 
13
- # Set CUDA architecture flags
14
- ENV TORCH_CUDA_ARCH_LIST="7.0;7.5;8.0;8.6"
15
 
16
- WORKDIR /app
17
 
18
- # Clone the InstantSplat repository and download the pre-trained model
19
- RUN git clone --recursive https://github.com/NVlabs/InstantSplat.git . && \
20
- git submodule update --init --recursive && \
21
- cd submodules/dust3r/ && \
22
- mkdir -p checkpoints/ && \
23
- wget https://download.europe.naverlabs.com/ComputerVision/DUSt3R/DUSt3R_ViTLarge_BaseDecoder_512_dpt.pth -P checkpoints/
24
 
25
- RUN pip install submodules/simple-knn && \
26
- sed -i '154s/p_view.z <= 0.2f/p_view.z <= 0.001f/' submodules/diff-gaussian-rasterization/cuda_rasterizer/auxiliary.h && \
27
- pip install submodules/diff-gaussian-rasterization && \
28
- cd submodules/dust3r/croco/models/curope/ && \
29
- python setup.py build_ext --inplace
30
-
31
- # Create the conda environment and install dependencies
32
- # RUN conda update -n base -c defaults conda
33
-
34
- # RUN conda create -n instantsplat python=3.11 cmake=3.14.0 -y && \
35
- # echo "source activate instantsplat" > ~/.bashrc && \
36
- # /bin/bash -c "source activate instantsplat" && \
37
- # conda install pytorch torchvision pytorch-cuda=11.8 -c pytorch -c nvidia -y && \
38
- # cd InstantSplat && \
39
- # pip install -r requirements.txt && \
40
- # pip install submodules/simple-knn && \
41
  # sed -i '154s/p_view.z <= 0.2f/p_view.z <= 0.001f/' submodules/diff-gaussian-rasterization/cuda_rasterizer/auxiliary.h && \
42
- # pip install submodules/diff-gaussian-rasterization
 
 
43
 
44
- RUN pip install -r requirements.txt
45
- RUN pip install imageio[ffmpeg]
46
 
47
- # Set the working directory
48
- RUN useradd -m -u 1000 user
49
- RUN chown -R user:user /app
50
- USER user
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
- COPY --chown=user . /app
53
- # COPY --chown=user ./requirements.txt requirements.txt
54
- # COPY ./requirements.txt requirements.txt
55
 
56
- ENV PATH="/home/user/.local/bin:$PATH"
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
- # COPY --chown=user ./run_train_infer.sh run_train_infer.sh
59
- # COPY ./run_train_infer.sh run_train_infer.sh
60
- RUN chmod +x run_train_infer.sh
61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
 
63
- # Default command to run when the container starts
64
- # CMD ["/bin/bash", "run_train_infer.sh"]
65
 
66
- # Copy the current directory contents into the container at $HOME/app setting the owner to the user
67
 
68
  CMD ["python", "app.py"]
 
1
+ # # Use the pre-built PyTorch Docker image with CUDA
2
+ # FROM pytorch/pytorch:2.1.2-cuda11.8-cudnn8-devel
3
 
4
+ # # Install build deps
5
+ # RUN apt-get update -y && apt-get install -y wget git vim ninja-build \
6
+ # && apt-get clean && rm -f /var/lib/apt/lists/*_*
7
 
8
+ # # Set up environment variables
9
+ # ENV CUDA_HOME=/usr/local/cuda
10
+ # # ENV CONDA_DIR=/opt/conda
11
+ # # ENV PATH=$CONDA_DIR/bin:$PATH
12
 
13
+ # # Set CUDA architecture flags
14
+ # ENV TORCH_CUDA_ARCH_LIST="7.0;7.5;8.0;8.6"
15
 
16
+ # WORKDIR /app
17
 
18
+ # # Clone the InstantSplat repository and download the pre-trained model
19
+ # RUN git clone --recursive https://github.com/NVlabs/InstantSplat.git . && \
20
+ # git submodule update --init --recursive && \
21
+ # cd submodules/dust3r/ && \
22
+ # mkdir -p checkpoints/ && \
23
+ # wget https://download.europe.naverlabs.com/ComputerVision/DUSt3R/DUSt3R_ViTLarge_BaseDecoder_512_dpt.pth -P checkpoints/
24
 
25
+ # RUN pip install submodules/simple-knn && \
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  # sed -i '154s/p_view.z <= 0.2f/p_view.z <= 0.001f/' submodules/diff-gaussian-rasterization/cuda_rasterizer/auxiliary.h && \
27
+ # pip install submodules/diff-gaussian-rasterization && \
28
+ # cd submodules/dust3r/croco/models/curope/ && \
29
+ # python setup.py build_ext --inplace
30
 
31
+ # # Create the conda environment and install dependencies
32
+ # # RUN conda update -n base -c defaults conda
33
 
34
+ # # RUN conda create -n instantsplat python=3.11 cmake=3.14.0 -y && \
35
+ # # echo "source activate instantsplat" > ~/.bashrc && \
36
+ # # /bin/bash -c "source activate instantsplat" && \
37
+ # # conda install pytorch torchvision pytorch-cuda=11.8 -c pytorch -c nvidia -y && \
38
+ # # cd InstantSplat && \
39
+ # # pip install -r requirements.txt && \
40
+ # # pip install submodules/simple-knn && \
41
+ # # sed -i '154s/p_view.z <= 0.2f/p_view.z <= 0.001f/' submodules/diff-gaussian-rasterization/cuda_rasterizer/auxiliary.h && \
42
+ # # pip install submodules/diff-gaussian-rasterization
43
+
44
+ # RUN pip install -r requirements.txt
45
+ # RUN pip install imageio[ffmpeg]
46
+
47
+ # # Set the working directory
48
+ # RUN useradd -m -u 1000 user
49
+ # RUN chown -R user:user /app
50
+ # USER user
51
+
52
+ # COPY --chown=user . /app
53
+ # # COPY --chown=user ./requirements.txt requirements.txt
54
+ # # COPY ./requirements.txt requirements.txt
55
 
56
+ # ENV PATH="/home/user/.local/bin:$PATH"
 
 
57
 
58
+ # # COPY --chown=user ./run_train_infer.sh run_train_infer.sh
59
+ # # COPY ./run_train_infer.sh run_train_infer.sh
60
+ # RUN chmod +x run_train_infer.sh
61
+
62
+
63
+ # # Default command to run when the container starts
64
+ # # CMD ["/bin/bash", "run_train_infer.sh"]
65
+
66
+ # # Copy the current directory contents into the container at $HOME/app setting the owner to the user
67
+
68
+ # CMD ["python", "app.py"]
69
+
70
+
71
+ FROM pytorch/pytorch:2.1.2-cuda11.8-cudnn8-devel
72
 
73
+ ARG DEBIAN_FRONTEND=noninteractive
 
 
74
 
75
+ ARG FORCE_CUDA=1
76
+ ENV FORCE_CUDA=${FORCE_CUDA}
77
+
78
+ ENV NVIDIA_VISIBLE_DEVICES \
79
+ ${NVIDIA_VISIBLE_DEVICES:-all}
80
+ ENV NVIDIA_DRIVER_CAPABILITIES \
81
+ ${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics
82
+
83
+ RUN apt-get update -y && apt-get install -y git wget
84
+
85
+ WORKDIR /
86
+ RUN git clone --recursive https://github.com/NVlabs/InstantSplat.git &&\
87
+ cd InstantSplat &&\
88
+ git submodule update --init --recursive &&\
89
+ cd submodules/dust3r/ &&\
90
+ mkdir -p checkpoints/ &&\
91
+ wget https://download.europe.naverlabs.com/ComputerVision/DUSt3R/DUSt3R_ViTLarge_BaseDecoder_512_dpt.pth -P checkpoints/
92
+
93
+ WORKDIR /InstantSplat
94
+
95
+ RUN pip3 install -r requirements.txt
96
+
97
+ ARG TORCH_CUDA_ARCH_LIST="3.5;5.0;6.0;6.1;7.0;7.5;8.0;8.6+PTX"
98
+
99
+ RUN pip3 install submodules/simple-knn
100
+ RUN sed -i 's/p_view.z <= 0.2f/p_view.z <= 0.001f/g' /InstantSplat/submodules/diff-gaussian-rasterization/cuda_rasterizer/auxiliary.h
101
+ RUN pip3 install submodules/diff-gaussian-rasterization
102
+
103
+ RUN cd submodules/dust3r/croco/models/curope/ &&\
104
+ python3 setup.py build_ext --inplace
105
+
106
+ RUN pip3 install plyfile
107
+ RUN apt-get install -y libgl1-mesa-dev libglib2.0-0
108
+
109
+ ENV CUDA_VISIBLE_DEVICES=0
110
+
111
+ RUN useradd -m -u 1000 user
112
+ RUN chown -R user:user /InstantSplat
113
+ USER user
114
 
115
+ COPY --chown=user . /InstantSplat
 
116
 
 
117
 
118
  CMD ["python", "app.py"]