@@ -20,8 +20,8 @@ ARG PYTHON_VERSION=3.12
2020# glibc version is baked into the distro, and binaries built with one glibc
2121# version are not backwards compatible with OSes that use an earlier version.
2222ARG BUILD_BASE_IMAGE=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu20.04
23- # TODO: Restore to base image after FlashInfer AOT wheel fixed
24- ARG FINAL_BASE_IMAGE=nvidia/cuda:${CUDA_VERSION}-devel -ubuntu22.04
23+ # Using runtime image with minimal build tools for JIT compilation ( FlashInfer, DeepGEMM, EP kernels)
24+ ARG FINAL_BASE_IMAGE=nvidia/cuda:${CUDA_VERSION}-runtime -ubuntu22.04
2525
2626# By parameterizing the Deadsnakes repository URL, we allow third-party to use
2727# their own mirror. When doing so, we don't benefit from the transparent
@@ -314,6 +314,25 @@ RUN echo 'tzdata tzdata/Areas select America' | debconf-set-selections \
314314 && curl -sS ${GET_PIP_URL} | python${PYTHON_VERSION} \
315315 && python3 --version && python3 -m pip --version
316316
317+ # Install CUDA development tools and build essentials for runtime JIT compilation
318+ # (FlashInfer, DeepGEMM, EP kernels all require compilation at runtime)
319+ RUN CUDA_VERSION_DASH=$(echo $CUDA_VERSION | cut -d. -f1,2 | tr '.' '-' ) && \
320+ apt-get update -y && \
321+ apt-get install -y --no-install-recommends \
322+ build-essential \
323+ gcc-10 \
324+ g++-10 \
325+ cuda-nvcc-${CUDA_VERSION_DASH} \
326+ cuda-cudart-dev-${CUDA_VERSION_DASH} \
327+ cuda-nvrtc-dev-${CUDA_VERSION_DASH} \
328+ cuda-nvml-dev-${CUDA_VERSION_DASH} \
329+ libcublas-dev-${CUDA_VERSION_DASH} \
330+ libcusparse-dev-${CUDA_VERSION_DASH} \
331+ libcusolver-dev-${CUDA_VERSION_DASH} && \
332+ update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 110 --slave /usr/bin/g++ g++ /usr/bin/g++-10 && \
333+ rm -rf /var/lib/apt/lists/* && \
334+ gcc --version
335+
317336ARG PIP_INDEX_URL UV_INDEX_URL
318337ARG PIP_EXTRA_INDEX_URL UV_EXTRA_INDEX_URL
319338ARG PYTORCH_CUDA_INDEX_BASE_URL
0 commit comments