-
Notifications
You must be signed in to change notification settings - Fork 841
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
Support CUDA 11 and CUDA 10 with some Clean Up #687
Open
KleinYuan
wants to merge
4
commits into
JDAI-CV:master
Choose a base branch
from
KleinYuan:kaiwen/fix-docker-build
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+53
−19
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
datasets/* | ||
logs/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
|
||
datasets/* | ||
logs | ||
|
||
# compilation and distribution | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# FROM nvidia/cuda:10.1-cudnn7-devel | ||
FROM nvidia/cuda:11.1.1-cudnn8-devel-ubuntu18.04 | ||
|
||
# https://github.com/NVIDIA/nvidia-docker/issues/1632 | ||
#RUN rm /etc/apt/sources.list.d/cuda.list | ||
#RUN rm /etc/apt/sources.list.d/nvidia-ml.list | ||
ENV DEBIAN_FRONTEND noninteractive | ||
RUN apt-get update && apt-get install -y \ | ||
python3-opencv ca-certificates python3-dev git wget sudo ninja-build | ||
RUN ln -sv /usr/bin/python3 /usr/bin/python | ||
|
||
# create a non-root user | ||
COPY . /home/appuser | ||
WORKDIR /home/appuser | ||
|
||
# https://github.com/facebookresearch/detectron2/issues/3933 | ||
ENV PATH="/home/appuser/.local/bin:${PATH}" | ||
RUN wget https://bootstrap.pypa.io/pip/3.6/get-pip.py && \ | ||
python3 get-pip.py && \ | ||
rm get-pip.py | ||
|
||
# install dependencies | ||
# See https://pytorch.org/ for other options if you use a different version of CUDA | ||
RUN pip install tensorboard cmake # cmake from apt-get is too old | ||
RUN pip install torch==1.10 torchvision==0.11.1 -f https://download.pytorch.org/whl/cu111/torch_stable.html | ||
# RUN pip install torch==1.6.0+cu101 torchvision==0.7.0+cu101 -f https://download.pytorch.org/whl/cu101/torch_stable.html | ||
# RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorboard opencv-python cython yacs termcolor scikit-learn tabulate gdown gpustat faiss-gpu ipdb h5py | ||
RUN pip install tensorboard opencv-python cython yacs termcolor scikit-learn tabulate gdown gpustat faiss-gpu ipdb h5py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,29 @@ | ||
# Use the container | ||
|
||
### Build Container | ||
|
||
```shell script | ||
cd docker/ | ||
# Build: | ||
docker build -t=fastreid:v0 . | ||
# Launch (requires GPUs) | ||
nvidia-docker run -v server_path:docker_path --name=fastreid --net=host --ipc=host -it fastreid:v0 /bin/sh | ||
# Build with the corresponding CUDA version | ||
|
||
# CUDA 10 | ||
docker build -t=fastreid:v0 -f Dockerfile_CUDA10 . | ||
# CUDA 11 | ||
docker build -t=fastreid:v0 -f Dockerfile_CUDA11 . | ||
``` | ||
|
||
## Install new dependencies | ||
### Run Container | ||
|
||
Add the following to `Dockerfile` to make persist changes. | ||
```shell script | ||
RUN sudo apt-get update && sudo apt-get install -y vim | ||
``` | ||
# Launch (requires GPUs) | ||
nvidia-docker run -v ${PWD}:/home/appuser --name=fastreid --net=host --ipc=host -it fastreid:v0 | ||
``` | ||
|
||
### Run Training | ||
|
||
Next, follow the [Get Started Doc](https://github.com/JDAI-CV/fast-reid/blob/master/GETTING_STARTED.md#compile-with-cython-to-accelerate-evalution). | ||
|
||
Or run them in the container to make temporary changes. | ||
|
||
## A more complete docker container | ||
|
||
If you want to use a complete docker container which contains many useful tools, you can check my development environment [Dockerfile](https://github.com/L1aoXingyu/fastreid_docker) | ||
If you want to use a complete docker container which contains many useful tools, you can check my development environment [Dockerfile](https://github.com/L1aoXingyu/fastreid_docker) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed
https://pypi.tuna.tsinghua.edu.cn/simple
, due to constant timeout. Do we need this ? @L1aoXingyu