Spaces:
Runtime error
Runtime error
| FROM nvidia/cuda:12.2.0-cudnn8-devel-ubuntu22.04 | |
| # Set a working directory | |
| WORKDIR /app | |
| # Install system dependencies, including libicu-dev AND a specific older version | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| python3 \ | |
| python3-pip \ | |
| libgl1-mesa-glx \ | |
| libglib2.0-0 \ | |
| libsm6 \ | |
| libxext6 \ | |
| libxrender1 \ | |
| ffmpeg \ | |
| git \ | |
| wget \ | |
| libicu-dev \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install a compatible libicu version. We'll try libicu66 first, as suggested. | |
| # If that doesn't work, we might need libicu70, libicu71, or others. | |
| # This is the CRITICAL FIX based on the Aspose forum post. | |
| RUN wget http://archive.ubuntu.com/ubuntu/pool/main/i/icu/libicu66_66.1-2ubuntu2_amd64.deb && \ | |
| dpkg -i libicu66_66.1-2ubuntu2_amd64.deb && \ | |
| rm libicu66_66.1-2ubuntu2_amd64.deb | |
| # Clone the repository with submodules | |
| RUN git clone --recurse-submodules https://github.com/microsoft/TRELLIS.git . | |
| # Install Python dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Install aspose.threed | |
| RUN pip install aspose-threed | |
| # --- .NET and Library Path Configuration --- | |
| # 1. Find the .NET root directory (dynamically) | |
| RUN DOTNET_ROOT=$(find / -name "libhostfxr.so" 2>/dev/null | head -n 1 | xargs dirname | xargs dirname) && \ | |
| echo "DOTNET_ROOT=$DOTNET_ROOT" >> /etc/environment | |
| # 2. Find the libicu.so file (dynamically, could be libicu66!) and add to LD_LIBRARY_PATH | |
| RUN LIBICU_PATH=$(find / -name "libicu*.so*" 2>/dev/null | head -n 1 | xargs dirname) && \ | |
| echo "LD_LIBRARY_PATH=$LIBICU_PATH:$LD_LIBRARY_PATH" >> /etc/environment | |
| # Set environment variable for spconv | |
| ENV SPCONV_ALGO=native | |
| # Create assets directories | |
| RUN mkdir -p assets/example_image assets/example_multi_image | |
| # Download example images | |
| RUN wget -P assets/example_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_image/apple_3.png \ | |
| && wget -P assets/example_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_image/avocado_2.png \ | |
| && wget -P assets/example_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_image/banana_4.png \ | |
| && wget -P assets/example_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_image/buddha_3.png \ | |
| && wget -P assets/example_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_image/cat_1.png \ | |
| && wget -P assets/example_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_image/cat_2.png \ | |
| && wget -P assets/example_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_image/chair_2.png \ | |
| && wget -P assets/example_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_image/cherries_1.png \ | |
| && wget -P assets/example_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_image/dog_1.png \ | |
| && wget -P assets/example_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_image/hotdog_1.png \ | |
| && wget -P assets/example_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_image/mushroom_1.png \ | |
| && wget -P assets/example_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_image/soccer_1.png | |
| RUN wget -P assets/example_multi_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_multi_image/chair_1.png \ | |
| && wget -P assets/example_multi_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_multi_image/chair_2.png \ | |
| && wget -P assets/example_multi_image https://raw.githubusercontent.com/trellis3d/trellis/main/assets/example_multi_image/chair_3.png | |
| # Expose the Gradio port | |
| EXPOSE 7860 | |
| # Command to run the application | |
| CMD ["python", "app.py"] |