diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..90cbf89 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +# syntax=docker/dockerfile:1-labs +# docker buildx create --name gpubuilder --driver-opt "image=moby/buildkit:buildx-stable-1-gpu" --bootstrap +# docker buildx --builder gpubuilder build --allow device -t trellis --load . +FROM nvidia/cuda:12.9.1-cudnn-devel-ubuntu22.04 +ARG DEBIAN_FRONTEND=noninteractive +RUN apt update && apt install -y g++ git cmake ninja-build \ + python3 python-is-python3 python3-pip python3-venv sudo +RUN git clone -b main https://github.com/microsoft/TRELLIS.2.git --recursive +# create venv instead of conde (see --new-env in setup.sh) +RUN python3 -m venv /opt/venv +ENV PATH="/opt/venv/bin:$PATH" +RUN pip install -U wheel setuptools pip +RUN pip install torch==2.6.0 torchvision==0.21.0 --index-url https://download.pytorch.org/whl/cu124 +WORKDIR /TRELLIS.2 +ARG TORCH_CUDA_ARCH_LIST="8.0" +RUN --device=nvidia.com/gpu bash -c ". ./setup.sh --basic --flash-attn --nvdiffrast --nvdiffrec --cumesh --o-voxel --flexgemm" +EXPOSE 7860 +ENV GRADIO_SERVER_NAME="0.0.0.0" +CMD ["python", "app.py"] \ No newline at end of file diff --git a/setup.sh b/setup.sh index e09e2b1..8cf9cc0 100644 --- a/setup.sh +++ b/setup.sh @@ -77,16 +77,16 @@ if [ "$NEW_ENV" = true ] ; then fi if [ "$BASIC" = true ] ; then - pip install imageio imageio-ffmpeg tqdm easydict opencv-python-headless ninja trimesh transformers gradio==6.0.1 tensorboard pandas lpips zstandard + pip install imageio imageio-ffmpeg tqdm easydict opencv-python-headless ninja trimesh transformers gradio==6.0.1 tensorboard pandas lpips zstandard plyfile psutil pip install git+https://github.com/EasternJournalist/utils3d.git@9a4eb15e4021b67b12c460c7057d642626897ec8 - sudo apt install -y libjpeg-dev + sudo apt install -y libjpeg-dev libwebp-dev pip install pillow-simd pip install kornia timm fi if [ "$FLASHATTN" = true ] ; then if [ "$PLATFORM" = "cuda" ] ; then - pip install flash-attn==2.7.3 + pip install flash-attn==2.7.3 --no-build-isolation elif [ "$PLATFORM" = "hip" ] ; then echo "[FLASHATTN] Prebuilt binaries not found. Building from source..." mkdir -p /tmp/extensions