wild3dgs-slam / Dockerfile
Mightypeacock's picture
Update Dockerfile
5a76e6b verified
FROM nvidia/cuda:11.8.0-devel-ubuntu22.04
# Use NVIDIA CUDA 11.8 base image
# FROM nvidia/cuda:11.8.0-devel-ubuntu22.04
# # Set environment variables
# ENV DEBIAN_FRONTEND=noninteractive
# ENV PYTHONUNBUFFERED=1
# ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
# # Install system dependencies
RUN apt-get update && apt-get install -y \
wget \
git \
python3.10 \
python3-pip \
python3.10-venv \
libgl1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
# Clone the WildGS-SLAM repository with submodules
RUN git clone --recursive https://github.com/GradientSpaces/WildGS-SLAM.git /app
RUN python3 --version
# Create and activate Python 3.10 virtual environment
RUN python3.10 -m venv /venv
ENV PATH="/venv/bin:$PATH"
WORKDIR /app
# Install Python dependencies
# COPY requirements.txt /tmp/requirements.txt
RUN pip install --upgrade pip && \
pip install numpy==1.26.3 && \
pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu118 && \
pip install torch-scatter -f https://data.pyg.org/whl/torch-2.1.0+cu118.html && \
pip install xformers==0.0.22.post7 --index-url https://download.pytorch.org/whl/cu118 && \
pip install -r requirements.txt && \
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.1.0/index.html && \
pip install gdown
#check pytorch install ?
# 4. Verify PyTorch installation before proceeding
# 4. Verify PyTorch installation
RUN python -c "import torch; print(f'PyTorch {torch.__version__}, CUDA {torch.version.cuda}')" && \
python -m pip list | grep torch
# 4. Install build dependencies
RUN apt-get update && apt-get install -y \
build-essential \
ninja-build
RUN pip install --upgrade pip wheel setuptools
#nvcc ? need devel base image
RUN ls -la /usr/local/cuda/bin/nvcc
# 5. Install with explicit CUDA flags
RUN cd thirdparty/lietorch && \
export TORCH_CUDA_ARCH_LIST="8.6" && \
export FORCE_CUDA=1 && \
export CUDA_HOME=/usr/local/cuda && \
export PATH="${CUDA_HOME}/bin:${PATH}" && \
pip install --no-build-isolation --config-settings editable_mode=compat -v -e . && \
cd /app
#RUN pip install -v --no-cache-dir --no-build-isolation -e thirdparty/lietorch/
# Install custom packages from the cloned repository
RUN python -m pip install -e thirdparty/diff-gaussian-rasterization-w-pose/ && \
python -m pip install -e thirdparty/simple-knn/
# Install the main package
RUN python -m pip install -e .
# Create pretrained directory and download model
RUN mkdir -p /app/pretrained && \
gdown https://drive.google.com/uc?id=1PpqVt1H4maBa_GbPJp4NwxRsd9jk-elh -O /app/pretrained/droid.pth
# Verify installation
RUN python -c "import torch; import lietorch; import simple_knn; import diff_gaussian_rasterization; print(torch.cuda.is_available())"
# Set default command
CMD ["bash"]
#build lighter runtime image ?
#FROM nvidia/cuda:11.8.0-base-ubuntu22.04