Skip to content
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

Add a Dockerfile including DCNv2 GPU compilation #176

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: "2.3"
services:
dev:
image: centertrack_dev
build:
context: .
dockerfile: ./docker/Dockerfile
tty: true
working_dir: /work
ipc: host
runtime: nvidia
environment:
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=all
98 changes: 98 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu16.04

RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata
# Add sudo
RUN apt-get -y install sudo
RUN apt-get install -y --no-install-recommends software-properties-common
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt update
RUN apt install -y --no-install-recommends python3.6
Copy link

@elkoz elkoz Aug 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RUN apt update
RUN apt install -y --no-install-recommends python3.6

doesn't seem to work anymore
RUN apt-get install -y python3.6 + using nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04 as base image fixed that for me


# Default to python3
RUN cd /usr/bin && ln -s python3.6 python
RUN apt-get install -y --no-install-recommends \
bash \
unzip \
vim \
build-essential \
make \
cmake \
wget \
curl \
lv \
less \
git \
imagemagick \
ffmpeg \
libfreetype6-dev \
libpng-dev \
libsm6 \
libxext6 \
libx11-xcb-dev \
libglu1-mesa-dev \
libxrender-dev \
libzmq3-dev \
python3.6-dev \
python3-pip \
python3.6-tk \
pkg-config \
libssl-dev \
zlib1g-dev \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
llvm \
libncurses5-dev \
libncursesw5-dev \
xz-utils \
tk-dev \
libffi-dev \
liblzma-dev \
protobuf-compiler

# pip3
RUN python3.6 -m pip install --upgrade \
pip \
setuptools

# python lib
RUN python3.6 -m pip install --use-feature=2020-resolver \
opencv-python \
matplotlib \
scipy \
numba \
imgaug \
numpy \
torch==1.4.0 \
torchvision==0.5.0 \
Pillow==6.2.1 \
tqdm \
motmetrics==1.1.3 \
Cython \
progress \
easydict \
pyquaternion \
nuscenes-devkit \
pyyaml \
# for motmetrics
pandas==0.25.3 \
scikit-learn==0.22.2

RUN python3.6 -m pip install --use-feature=2020-resolver -U 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'

COPY . /CenterTrack

# check cuda
RUN python -c 'import torch; assert torch.cuda.is_available(), "Cuda is not available."'
WORKDIR /CenterTrack/src/lib/model/networks
RUN git clone --recursive https://github.com/CharlesShang/DCNv2
RUN cd DCNv2 && bash ./make.sh

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a symlink otherwise the make.sh will fail. Also use WORKDIR to change directory not cd

RUN ln -s /usr/bin/python3.6 /usr/bin/python
COPY . /centertrack

WORKDIR /centertrack/src/lib/model/networks/
RUN git clone --recursive https://github.com/CharlesShang/DCNv2
WORKDIR DCNv2
RUN /bin/bash make.sh


WORKDIR /CenterTrack

# clean up
RUN sudo apt-get clean and; \
sudo rm -rf /var/lib/apt/lists/*

ENTRYPOINT [ "bash" ]