From a05c58b6bb5da958a9af26d1d11bf92ecd242e6d Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Sun, 26 Jul 2026 15:48:02 +0000 Subject: [PATCH] docker: derive build.sh's arch-list banner from the Dockerfile The banner printed before the build hardcoded a second copy of the CUDA arch list, and it had already drifted: it showed 8.0;8.6;8.9;9.0;10.0;12.0+PTX while the Dockerfile builds with 7.5;8.0;8.6;8.9;9.0;10.0;12.0+PTX so anyone reading build.sh's output was told Turing is not covered when in fact it is. The echo does not feed the build, so no image was ever wrong; only the report was. Read the value back out of the Dockerfile instead of repeating it. The sed anchors on an optional-leading-whitespace assignment, so the Dockerfile's explanatory comment mentioning the same variable is not matched, and head -n1 takes the builder-stage ENV. Verified to yield 7.5;8.0;8.6;8.9;9.0;10.0;12.0+PTX against the current Dockerfile. --- docker/build.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docker/build.sh b/docker/build.sh index f5d369e84b..296953fb62 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -41,7 +41,12 @@ echo " CUDA ${CUDA_VERSION} Ubuntu ${UBUNTU_VERSION} Python ${PYTHO echo " unsloth @${UNSLOTH_REF}" echo " unsloth-zoo @${UNSLOTH_ZOO_REF}" echo " llama.cpp ${LLAMA_PREBUILT_TAG}" -echo " arch list 8.0;8.6;8.9;9.0;10.0;12.0+PTX" +# Read the arch list back out of the Dockerfile rather than repeating it: the +# hand-copied banner had already drifted, dropping 7.5 and so under-reporting +# Turing support to anyone reading this output. +ARCH_LIST="$(sed -n 's/^[[:space:]]*TORCH_CUDA_ARCH_LIST="\([^"]*\)".*/\1/p' \ + "$(dirname "$0")/Dockerfile" | head -n1)" +echo " arch list ${ARCH_LIST:-unknown}" echo DOCKER_BUILDKIT=1 docker build \