| |
| FROM nvidia/cuda:12.5.1-devel-ubuntu22.04 |
|
|
| |
| ENV DEBIAN_FRONTEND=noninteractive |
|
|
| |
| RUN apt-get update && apt-get install -y software-properties-common && \ |
| add-apt-repository ppa:ubuntu-toolchain-r/test -y && \ |
| apt-get update && apt-get install -y \ |
| python3 \ |
| python3-venv \ |
| python3-dev \ |
| python3-pip \ |
| git \ |
| wget \ |
| ninja-build \ |
| libgl1 \ |
| libglib2.0-0 \ |
| libstdc++6 \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN useradd -m -u 1000 user |
| USER user |
|
|
| |
| |
| ENV HOME=/home/user \ |
| PATH=/home/user/venv/bin:/usr/local/cuda/bin:$PATH \ |
| LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH \ |
| PYTHONWARNINGS="ignore::SyntaxWarning" \ |
| TORCH_CUDA_ARCH_LIST="8.9" \ |
| CUDA_HOME=/usr/local/cuda \ |
| MAX_JOBS=2 |
|
|
| WORKDIR $HOME/app |
|
|
| |
| RUN python3 -m venv $HOME/venv |
|
|
| |
| RUN pip install --no-cache-dir --upgrade pip wheel setuptools ninja packaging && \ |
| pip install --no-cache-dir torch==2.6.0 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124 && \ |
| pip install --no-cache-dir spaces && \ |
| pip install --no-cache-dir https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.4.post1/flash_attn-2.7.4.post1+cu12torch2.6cxx11abiFALSE-cp310-cp310-linux_x86_64.whl |
|
|
| |
| |
| COPY --chown=user requirements_th26_cu124.txt ./requirements.txt |
| RUN sed -i '/cumesh/d' requirements.txt && \ |
| sed -i '/o-voxel/d' requirements.txt && \ |
| sed -i '/flex-gemm/d' requirements.txt && \ |
| sed -i '/nvdiffrast/d' requirements.txt && \ |
| sed -i '/nvdiffrec-render/d' requirements.txt && \ |
| sed -i '/flash_attn_3/d' requirements.txt && \ |
| pip install --no-cache-dir -r requirements.txt |
|
|
| |
| |
|
|
| |
| RUN git clone https://github.com/JeffreyXiang/CuMesh.git && \ |
| cd CuMesh && \ |
| pip install --no-cache-dir . --no-build-isolation && \ |
| cd .. && rm -rf CuMesh |
|
|
| |
| RUN git clone https://github.com/JeffreyXiang/FlexGEMM.git && \ |
| cd FlexGEMM && \ |
| pip install --no-cache-dir . --no-build-isolation && \ |
| cd .. && rm -rf FlexGEMM |
|
|
| |
| RUN git clone https://github.com/microsoft/TRELLIS.2.git && \ |
| cd TRELLIS.2/o-voxel && \ |
| mkdir -p third_party && \ |
| git clone https://github.com/PX4/eigen.git third_party/eigen && \ |
| pip install --no-cache-dir . --no-build-isolation && \ |
| cd ../.. && rm -rf TRELLIS.2 |
|
|
| |
| RUN git clone https://github.com/NVlabs/nvdiffrast.git && \ |
| cd nvdiffrast && \ |
| pip install --no-cache-dir . --no-build-isolation && \ |
| cd .. && rm -rf nvdiffrast |
|
|
| |
| RUN git clone https://github.com/JeffreyXiang/nvdiffrec.git && \ |
| cd nvdiffrec && \ |
| git checkout renderutils && \ |
| pip install --no-cache-dir . --no-build-isolation && \ |
| cd .. && rm -rf nvdiffrec |
|
|
| |
| COPY --chown=user . . |
|
|
| |
| EXPOSE 7860 |
| ENV GRADIO_SERVER_NAME="0.0.0.0" |
| ENV GRADIO_SERVER_PORT="7860" |
| ENV PYTORCH_CUDA_ALLOC_CONF="expandable_segments:True" |
|
|
| |
| CMD ["python", "app.py"] |