File size: 1,087 Bytes
31e32d0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04

ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /opt/app

# System deps
RUN apt-get update && apt-get install -y \
    git \
    python3 \
    python3-pip \
    python3-dev \
    build-essential \
    && rm -rf /var/lib/apt/lists/*

RUN ln -s /usr/bin/python3 /usr/bin/python

# Upgrade pip
RUN pip install --upgrade pip setuptools wheel

# ---- Torch FIRST (critical) ----
RUN pip install torch torchvision torchaudio \
    --index-url https://download.pytorch.org/whl/cu121

# ---- Clone pinned Hunyuan3D ----
ARG HY3D_COMMIT=e2df0625bda7efd5f1daba8f3f2a4cb3d9ac85f8
RUN git clone https://github.com/tencent/Hunyuan3D-2.git && \
    cd Hunyuan3D-2 && git checkout ${HY3D_COMMIT}

WORKDIR /opt/app/Hunyuan3D-2

# ---- Install root package ----
RUN pip install -e .

# ---- Build CUDA extensions ----
RUN pip install ./hy3dgen/texgen/custom_rasterizer/ops
RUN pip install ./hy3dgen/texgen/differentiable_renderer/ops

# ---- Copy HF handler last (better caching) ----
WORKDIR /opt/app
COPY handler.py .

ENV PYTHONPATH=/opt/app/Hunyuan3D-2