Spaces:
Running
on
Zero
Running
on
Zero
File size: 3,865 Bytes
6c5e048 dad04ff 6c5e048 dad04ff 6c5e048 dad04ff 6c5e048 dad04ff 6c5e048 dad04ff 6c5e048 |
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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
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"] |