Browse Source

Merge pull request #30 from Lektro9/feature/docker

add dockerfile and short readme
main
Jiale Xu 6 months ago
committed by GitHub
parent
commit
4668cf1355
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 55
      docker/Dockerfile
  2. 13
      docker/README.md

55
docker/Dockerfile

@ -0,0 +1,55 @@
# get the development image from nvidia cuda 12.1
FROM nvidia/cuda:12.1.0-cudnn8-devel-ubuntu20.04
LABEL name="instantmesh" \
maintainer="instantmesh"
# create workspace folder and set it as working directory
RUN mkdir -p /workspace/instantmesh
WORKDIR /workspace
# Set the timezone
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y tzdata && \
ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
dpkg-reconfigure --frontend noninteractive tzdata
# update package lists and install git, wget, vim, libegl1-mesa-dev, and libglib2.0-0
RUN apt-get update && \
apt-get install -y git wget vim libegl1-mesa-dev libglib2.0-0 unzip
# install conda
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
chmod +x Miniconda3-latest-Linux-x86_64.sh && \
./Miniconda3-latest-Linux-x86_64.sh -b -p /workspace/miniconda3 && \
rm Miniconda3-latest-Linux-x86_64.sh
# update PATH environment variable
ENV PATH="/workspace/miniconda3/bin:${PATH}"
# initialize conda
RUN conda init bash
# create and activate conda environment
RUN conda create -n instantmesh python=3.10 && echo "source activate instantmesh" > ~/.bashrc
ENV PATH /workspace/miniconda3/envs/instantmesh/bin:$PATH
RUN conda install Ninja
RUN conda install cuda -c nvidia/label/cuda-12.1.0 -y
RUN pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu121
RUN pip install xformers==0.0.22.post7
RUN pip install triton
# change the working directory to the repository
WORKDIR /workspace/instantmesh
# other dependencies
ADD ./requirements.txt /workspace/instantmesh/requirements.txt
RUN pip install -r requirements.txt
COPY . /workspace/instantmesh
# Run the command when the container starts
CMD ["python", "app.py"]

13
docker/README.md

@ -0,0 +1,13 @@
# Docker setup
This docker setup is tested on WSL(Ubuntu).
make sure you are under directory yourworkspace/instantmesh/
run
`docker build -t instantmesh/deploy:cuda12.1 -f docker/Dockerfile .`
then run
`docker run --gpus all -it instantmesh/deploy:cuda12.1`
Loading…
Cancel
Save