diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d4ab74b9bd..0a48ddca68a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,14 @@ set(CMAKE_CUDA_STANDARD_REQUIRED ON) set(CMAKE_HIP_STANDARD 20) set(CMAKE_HIP_STANDARD_REQUIRED ON) +# PyTorch headers require C++20; GCC < 11.3 has incomplete C++20 support. +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "11.3") + message(FATAL_ERROR + "GCC >= 11.3 is required to build vLLM (found ${CMAKE_CXX_COMPILER_VERSION}). " + "PyTorch's C++20 headers require a compiler with full C++20 support. " + "See: https://github.com/pytorch/pytorch/pull/167929") +endif() + # CUDA by default, can be overridden by using -DVLLM_TARGET_DEVICE=... (used by setup.py) set(VLLM_TARGET_DEVICE "cuda" CACHE STRING "Target device backend for vLLM") diff --git a/docker/Dockerfile b/docker/Dockerfile index aa4ef3c3093..d03da7bcc37 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -148,11 +148,13 @@ RUN if [ "${BUILD_OS}" = "manylinux" ]; then \ sudo \ python3-pip \ libibverbs-dev \ - # Upgrade to GCC 10 to avoid https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92519 - # as it was causing spam when compiling the CUTLASS kernels - gcc-10 \ - g++-10 \ - && update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 110 --slave /usr/bin/g++ g++ /usr/bin/g++-10 \ + # GCC 10 was previously pinned to suppress spurious -Wredundant-move warnings + # from CUTLASS (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92519). That bug + # was fixed in GCC 11. GCC >= 11.3 is now required because PyTorch's C++20 headers + # (pytorch/pytorch#167929) are not compatible with GCC < 11.3. + gcc-11 \ + g++-11 \ + && update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 110 --slave /usr/bin/g++ g++ /usr/bin/g++-11 \ # Install python dev headers if available (needed for cmake FindPython on Ubuntu 24.04 # which ships cmake 3.28 and requires Development.SABIModule; silently skipped on # Ubuntu 20.04/22.04 where python3.x-dev is not available without a PPA) diff --git a/docker/Dockerfile.nightly_torch b/docker/Dockerfile.nightly_torch index e1cd08bd663..149c265d7e2 100644 --- a/docker/Dockerfile.nightly_torch +++ b/docker/Dockerfile.nightly_torch @@ -42,10 +42,9 @@ RUN --mount=type=cache,target=/root/.cache/uv \ # Reference: https://github.com/astral-sh/uv/pull/1694 ENV UV_HTTP_TIMEOUT=500 -# Upgrade to GCC 10 to avoid https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92519 -# as it was causing spam when compiling the CUTLASS kernels -RUN apt-get install -y gcc-10 g++-10 -RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 110 --slave /usr/bin/g++ g++ /usr/bin/g++-10 +# GCC >= 11.3 required for PyTorch C++20 headers (pytorch/pytorch#167929). +RUN apt-get install -y gcc-11 g++-11 +RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 110 --slave /usr/bin/g++ g++ /usr/bin/g++-11 RUN <