Skip to content

Added docker support (dockerfile) #98

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04

# Metadata
LABEL maintainer="[email protected]" \
project-name="Droid-SLAM" \
com.droid-slam.version="0.0.1-alpha" \
com.droid-slam.realease-data="2023.01.20"

# Set arguments and env variables
ARG DEBIAN_FRONTEND=noninteractive

ENV NVIDIA_VISIBLE_DIVICES all
ENV NVIDIA_DRIVER_CAPABILITIES graphics,utility,compute


# Fetch nvidia signing keys
RUN apt-key del 7fa2af80
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub

# Install ubuntu base packages
RUN apt-get update && apt install -y --no-install-recommends \
software-properties-common \
apt-utils \
dbus-x11 \
libglvnd0 \
libgl1 \
libglx0 \
libegl1 \
libxext6 \
libx11-6 \
libgl1-mesa-dev \
libglew-dev


RUN apt-get update && apt install -y --no-install-recommends \
build-essential \
libboost-all-dev \
libsm6 \
libxext6 \
libxrender-dev \
ninja-build

# Installing required utilities
RUN apt-get update && apt-get install -y \
curl \
git \
ssh \
unzip \
vim \
wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Set working directory
RUN mkdir -p /root/
WORKDIR /root/

# Set user to root to avoid permission issues
USER root

# Install miniconda
RUN wget \
https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
bash Miniconda3-latest-Linux-x86_64.sh -b && \
rm -f Miniconda3-latest-Linux-x86_64.sh

ENV PATH="/root/miniconda3/bin:${PATH}"

# Install Droid SLAM dependencies
RUN conda install python=3.9

RUN conda install pytorch==1.10.1 torchvision==0.11.2 torchaudio==0.10.1 cudatoolkit=11.3 -c pytorch -c conda-forge

RUN pip install gdown matplotlib open3d opencv-python torch-scatter tensorboard scipy tqdm pyyaml

RUN conda install -c conda-forge suitesparse

# Clone repository
WORKDIR /root
RUN git clone --recursive https://github.com/pytholic/DROID-SLAM.git

# Install extensions
RUN cd DROID-SLAM && \
python setup.py install

# Cleanup
RUN rm -rf DROID_SLAM

# Set entry commands
ENTRYPOINT ["/bin/bash"]