Skip to content

Instantly share code, notes, and snippets.

@davidliyutong
Last active March 10, 2026 11:40
Show Gist options
  • Select an option

  • Save davidliyutong/7eb36a6a99b8c37414e93c861c8fa33a to your computer and use it in GitHub Desktop.

Select an option

Save davidliyutong/7eb36a6a99b8c37414e93c861c8fa33a to your computer and use it in GitHub Desktop.
TRELLIS Dockerfile for CUDA 12.8
FROM pytorch/pytorch:2.7.1-cuda12.8-cudnn9-devel
RUN apt-get update && apt-get install -y ffmpeg vim build-essential git rdfind
RUN conda init && \
conda config --set always_yes true && \
conda config --add channels defaults
# essentiall source ~/.bashrc
SHELL ["/bin/bash", "-c"]
RUN git clone --recurse-submodules https://github.com/microsoft/TRELLIS.git
RUN pip install pillow imageio imageio-ffmpeg tqdm easydict opencv-python-headless ninja rembg onnxruntime trimesh xatlas pyvista pymeshfix igraph "transformers>=4.40.0" "gradio==4.44.1" "gradio_litmodel3d==0.0.1" "huggingface_hub==0.24.0" "diffusers>=0.27.0" && \
pip install git+https://github.com/EasternJournalist/utils3d.git@9a4eb15e4021b67b12c460c7057d642626897ec8
RUN pip install --no-deps "xformers==0.0.31" --index-url https://download.pytorch.org/whl/cu128
RUN MAX_JOBS=64 pip install flash-attn
RUN pip install opencv-python-headless
RUN git clone --recursive https://github.com/NVIDIAGameWorks/kaolin && \
cd kaolin && \
export IGNORE_TORCH_VER=1 && \
pip install "Cython >= 0.29.37" && \
pip install .
RUN git clone https://github.com/NVlabs/nvdiffrast.git /tmp/extensions/nvdiffrast && \
TORCH_CUDA_ARCH_LIST="12.0" pip install /tmp/extensions/nvdiffrast --no-build-isolation
# when building, this has no GPU, so we skip this and run this on the fly
RUN git clone --recurse-submodules https://github.com/JeffreyXiang/diffoctreerast.git /tmp/extensions/diffoctreerast && \
TORCH_CUDA_ARCH_LIST="12.0" pip install /tmp/extensions/diffoctreerast
# this too
RUN git clone https://github.com/autonomousvision/mip-splatting.git /tmp/extensions/mip-splatting && \
TORCH_CUDA_ARCH_LIST="12.0" pip install /tmp/extensions/mip-splatting/submodules/diff-gaussian-rasterization/
RUN pip install spconv-cu120
RUN pip install open3d
# force re-install torchvision
RUN pip install torchvision --index-url https://download.pytorch.org/whl/cu128
# RUN pip uninstall -y torchvision && pip install torchvision --no-deps
@davidliyutong
Copy link
Author

davidliyutong commented Mar 10, 2026

Special notes to the usage of gradio.py app

  1. modify the app.py:
demo.launch(server_name="0.0.0.0", share=True)

Currently working to get it work, looks like there is a incompatibility between gradio core and plugins

@davidliyutong
Copy link
Author

davidliyutong commented Mar 10, 2026

Usage of example

docker build -t trellis .
docker run --rm -it --name trellis-ng --gpus '"device=1"' -p 7860:7860  -v $(pwd)/data:/root trellis # to preserve cache
cd TRELLIS
python example.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment