Skip to content

Add conda-free Docker setup for the Gradio demo (CUDA 12.1)#358

Open
kunci115 wants to merge 11 commits into
microsoft:mainfrom
kunci115:main
Open

Add conda-free Docker setup for the Gradio demo (CUDA 12.1)#358
kunci115 wants to merge 11 commits into
microsoft:mainfrom
kunci115:main

Conversation

@kunci115

Copy link
Copy Markdown

What

Adds a reproducible, conda-free way to run the image-to-3D Gradio demo (app.py) on a Linux server with an NVIDIA GPU, plus a plain venv script for non-Docker users. Aimed at people who hit friction setting the project up today on modern dependency versions.

Added

  • Dockerfile — CUDA 12.1 + PyTorch 2.4.0 (cu121), GPU arch pinned to 8.9 (Ada / RTX 40-series, configurable via TORCH_CUDA_ARCH_LIST). Builds all required CUDA extensions (nvdiffrast, diffoctreerast, diff-gaussian-rasterization, kaolin, spconv, xformers) and uses the xformers attention backend (no flash-attn build needed).
  • docker-compose.yml — GPU passthrough, port 7860, persistent HF model cache volume, GPU selection.
  • .dockerignore
  • setup_venv.sh — conda-free venv install mirroring the Docker dependency set.
  • README — new "Installation without Conda (WSL2)", "Installation with Docker", and "Choosing a model for limited VRAM" sections.

Fixes folded in (needed to run on current dep versions)

  • Install CUDA extensions with --no-build-isolation so they compile against the installed PyTorch.
  • Pin transformers / huggingface_hub to versions compatible with gradio 4.44.1 (HfFolder import).
  • Pin the gradio web stack (fastapi, starlette, pydantic) to gradio-4.44-era versions and patch gradio_client for tolerant JSON-schema parsing (fixes the APIInfoParseError / unhashable type: 'dict' startup crashes).
  • Bind Gradio to 0.0.0.0:7860 so it is reachable from outside the container.

Verification

Built and verified serving on 2× RTX 4090 (CUDA 13.x driver):

docker compose up --build
# -> Running on local URL: http://0.0.0.0:7860
curl -s -o /dev/null -w "%{http_code}\n" http://localhost:7860   # 200

The existing conda setup.sh is left untouched; this is purely additive.

@kunci115

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant