Spaces:
Paused
Paused
Georg commited on
Commit ·
9f36f2f
1
Parent(s): e317b3c
Optimized Docker build to fix OOM errors
Browse filesFiles changed (2)
- Dockerfile+4-6
- Dockerfile.base+2-2
123453 unmodified lines9101112131415161718192021221 unmodified line2425262728293031# Final stage Dockerfile - optimized for HuggingFace# Uses runtime base image (not devel) with minimal dependenciesFROM gpue/foundationpose-base:latest# FoundationPose configuration3 unmodified lines# Downgrade NumPy to 1.x for CUDA extension compatibilityRUN pip install --no-cache-dir "numpy<2"# Install CUDA compiler and build tools temporarilyRUN apt-get update && apt-get install -y --no-install-recommends \cmake \build-essential \ninja-build \libeigen3-dev \cuda-compiler-11-8 \cuda-nvcc-11-8 \&& rm -rf /var/lib/apt/lists/*# Build FoundationPose C++ extensions (requires GPU)1 unmodified lineRUN cd bundlesdf/mycuda && pip install . --no-build-isolationRUN cd mycpp && python setup.py build_ext --inplace# Remove build tools to save spaceRUN apt-get purge -y cmake build-essential ninja-build libeigen3-dev cuda-compiler-11-8 cuda-nvcc-11-8 && \apt-get autoremove -y && \apt-get clean && \rm -rf /var/lib/apt/lists/*123453 unmodified lines910111213141516171819201 unmodified line2223242526272829# Final stage Dockerfile - optimized for HuggingFace# Uses devel base image (includes CUDA compiler tools)FROM gpue/foundationpose-base:latest# FoundationPose configuration3 unmodified lines# Downgrade NumPy to 1.x for CUDA extension compatibilityRUN pip install --no-cache-dir "numpy<2"# Install build tools temporarily (CUDA compiler already in devel base)RUN apt-get update && apt-get install -y --no-install-recommends \cmake \build-essential \ninja-build \libeigen3-dev \&& rm -rf /var/lib/apt/lists/*# Build FoundationPose C++ extensions (requires GPU)1 unmodified lineRUN cd bundlesdf/mycuda && pip install . --no-build-isolationRUN cd mycpp && python setup.py build_ext --inplace# Remove build tools to save space (keep CUDA compiler)RUN apt-get purge -y cmake ninja-build libeigen3-dev && \apt-get autoremove -y && \apt-get clean && \rm -rf /var/lib/apt/lists/*
12345# Minimal base image - optimized for size and build speedFROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04ENV DEBIAN_FRONTEND=noninteractiveENV CUDA_HOME=/usr/local/cuda12345# Base image with CUDA compiler tools (needed for C++ extensions)FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04ENV DEBIAN_FRONTEND=noninteractiveENV CUDA_HOME=/usr/local/cuda
Dockerfile+4-6
Dockerfile.base+2-2