From 24d59d8d748b20c1bc0fe678c652f999d0d80623 Mon Sep 17 00:00:00 2001 From: Mohammad Miadh Angkad <176301910+mmangkad@users.noreply.github.com> Date: Mon, 13 Jul 2026 04:50:41 +0800 Subject: [PATCH] Fix CUDA 12 Docker dependency resolution (#30858) --- docker/Dockerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index 74319e82b..628196c54 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -239,6 +239,11 @@ RUN --mount=type=cache,target=/root/.cache/pip \ && echo '__version__ = "0.0.0"' > sglang/version.py \ && touch README.md \ && touch LICENSE \ + && if [ "${CUDA_VERSION%%.*}" = "12" ]; then \ + sed -i 's/cuda-python>=13\.0/cuda-python>=12,<13/' pyproject.toml && \ + sed -i 's/flashinfer_python\[cu13\]/flashinfer_python[cu12]/' pyproject.toml && \ + sed -i 's/nvidia-cutlass-dsl\[cu13\]/nvidia-cutlass-dsl/' pyproject.toml; \ + fi \ && python3 -m pip install --extra-index-url https://download.pytorch.org/whl/cu${CUINDEX} ".[${BUILD_TYPE}]" \ && if [ "${CUDA_VERSION%%.*}" = "12" ]; then \ pip list --format=freeze | awk -F'==' '/-cu13(==|$)/ {print $1}' \ @@ -669,6 +674,11 @@ RUN if [ "$BRANCH_TYPE" = "local" ]; then \ # Clean up __pycache__/tests/pyc in same RUN to avoid writing ~28k files to layer RUN --mount=type=cache,target=/root/.cache/pip \ cd /sgl-workspace/sglang \ + && if [ "${CUDA_VERSION%%.*}" = "12" ]; then \ + sed -i 's/cuda-python>=13\.0/cuda-python>=12,<13/' python/pyproject.toml && \ + sed -i 's/flashinfer_python\[cu13\]/flashinfer_python[cu12]/' python/pyproject.toml && \ + sed -i 's/nvidia-cutlass-dsl\[cu13\]/nvidia-cutlass-dsl/' python/pyproject.toml; \ + fi \ && python3 -m pip install --no-deps -e "python[${BUILD_TYPE}]" \ && kernels lock python \ && ( success=0; \