Mightypeacock commited on
Commit
8a107a6
·
verified ·
1 Parent(s): 33831bb

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +95 -0
Dockerfile ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ FROM nvidia/cuda:11.8.0-devel-ubuntu22.04
4
+
5
+ # Use NVIDIA CUDA 11.8 base image
6
+ # FROM nvidia/cuda:11.8.0-devel-ubuntu22.04
7
+
8
+ # # Set environment variables
9
+ # ENV DEBIAN_FRONTEND=noninteractive
10
+ # ENV PYTHONUNBUFFERED=1
11
+ # ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
12
+
13
+ # # Install system dependencies
14
+ RUN apt-get update && apt-get install -y \
15
+ wget \
16
+ git \
17
+ python3.10 \
18
+ python3-pip \
19
+ python3.10-venv \
20
+ libgl1 \
21
+ libglib2.0-0 \
22
+ && rm -rf /var/lib/apt/lists/*
23
+
24
+ # Clone the WildGS-SLAM repository with submodules
25
+ RUN git clone --recursive https://github.com/GradientSpaces/WildGS-SLAM.git /app
26
+
27
+
28
+ RUN python3 --version
29
+ # Create and activate Python 3.10 virtual environment
30
+ RUN python3.10 -m venv /venv
31
+ ENV PATH="/venv/bin:$PATH"
32
+
33
+ WORKDIR /app
34
+
35
+ # Install Python dependencies
36
+ # COPY requirements.txt /tmp/requirements.txt
37
+ RUN pip install --upgrade pip && \
38
+ pip install numpy==1.26.3 && \
39
+ pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu118 && \
40
+ pip install torch-scatter -f https://data.pyg.org/whl/torch-2.1.0+cu118.html && \
41
+ pip install xformers==0.0.22.post7 --index-url https://download.pytorch.org/whl/cu118 && \
42
+ pip install -r requirements.txt && \
43
+ pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.1.0/index.html && \
44
+ pip install gdown
45
+
46
+
47
+ #check pytorch install ?
48
+
49
+ # 4. Verify PyTorch installation before proceeding
50
+ # 4. Verify PyTorch installation
51
+ RUN python -c "import torch; print(f'PyTorch {torch.__version__}, CUDA {torch.version.cuda}')" && \
52
+ python -m pip list | grep torch
53
+
54
+ # 4. Install build dependencies
55
+ RUN apt-get update && apt-get install -y \
56
+ build-essential \
57
+ ninja-build
58
+
59
+ RUN pip install --upgrade pip wheel setuptools
60
+
61
+ #nvcc ? need devel base image
62
+ RUN ls -la /usr/local/cuda/bin/nvcc
63
+
64
+ # 5. Install with explicit CUDA flags
65
+ RUN cd thirdparty/lietorch && \
66
+ export TORCH_CUDA_ARCH_LIST="8.6" && \
67
+ export FORCE_CUDA=1 && \
68
+ pip install --no-build-isolation -v -e . && \
69
+ grep "Successfully installed" install.log && \
70
+ cd /app
71
+
72
+
73
+ RUN pip install -v --no-cache-dir --no-build-isolation -e thirdparty/lietorch/
74
+
75
+ # Install custom packages from the cloned repository
76
+ RUN python -m pip install -e thirdparty/lietorch/ && \
77
+ python -m pip install -e thirdparty/diff-gaussian-rasterization-w-pose/ && \
78
+ python -m pip install -e thirdparty/simple-knn/
79
+
80
+ # Install the main package
81
+ RUN python -m pip install -e .
82
+
83
+ # Create pretrained directory and download model
84
+ RUN mkdir -p /app/pretrained && \
85
+ gdown https://drive.google.com/uc?id=1PpqVt1H4maBa_GbPJp4NwxRsd9jk-elh -O /app/pretrained/droid.pth
86
+
87
+ # Verify installation
88
+ RUN python -c "import torch; import lietorch; import simple_knn; import diff_gaussian_rasterization; print(torch.cuda.is_available())"
89
+
90
+ # Set default command
91
+ CMD ["bash"]
92
+
93
+
94
+ #build lighter runtime image ?
95
+ #FROM nvidia/cuda:11.8.0-base-ubuntu22.04