[Build] Upgrade CUDA Dockerfiles from GCC 10 to GCC 12 for C++20 compatibility#44923
Conversation
|
Documentation preview: https://vllm--44923.org.readthedocs.build/en/44923/ |
bc402bf to
654e1e8
Compare
|
@Harry-Chen - drawing your attention to another PyTorch compatibility fix (follow-up to #40380) |
| # 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 >= 12 is now required because PyTorch's C++20 headers | ||
| # (pytorch/pytorch#167929) are not compatible with GCC < 12. |
There was a problem hiding this comment.
I think pytorch is requiring >11.3, not strictly >= 12?
There was a problem hiding this comment.
PyTorch is requiring 11.3. I chose 12 because vLLM's CPU extension builds already require and use GCC 12 and it seems inconsistent to me to require two different versions of a compiler for the same project. But I'm happy to switch this to 11.3 if that's better for you.
There was a problem hiding this comment.
Ubuntu 22.04 already has gcc 11 as the default compiler. I tend to use whatever the default from the build image unless it does not work (e.g., previously the gcc-9 case), to keep the dockerfile simple. And I also like to hear your opinion on this.
| set(CMAKE_HIP_STANDARD_REQUIRED ON) | ||
|
|
||
| # PyTorch headers require C++20; GCC < 12 has incomplete C++20 support. | ||
| if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12) |
There was a problem hiding this comment.
Same as above, we should be as permissive as possible in this check
|
And I think the manylinux builder (which we are using in the release pipeline) has already aligned with pytorch's compiler versions, is that right? |
…mpatibility GCC 10 was pinned in the CUDA and nightly_torch Dockerfiles 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. Also adds a CMake FATAL_ERROR gate (mirroring cmake/cpu_extension.cmake) and a prerequisite note to the CUDA build documentation. Signed-off-by: Richard Barnes <rbarnes@meta.com>
654e1e8 to
ccfe274
Compare
|
@Harry-Chen : I'm not sure about the manylinux builder. I'm trying to track down this thread: pytorch/pytorch#176662 (comment) but the user was non-specific about the problems they actually encountered. Bumping your minimum compiler to the PyTorch minimum seems like a reasonable step to take. GCC 10 was released in 2020 and GCC 11 in 2022. PyTorch moved onto C++20 after support for Ubuntu 20.04 ended and, along with it, support for GCC 10. |
I see. The manylinux builder we are using is from pytorch: https://hub.docker.com/r/pytorch/manylinux-builder. So I believe it is a safe default to use. |
…atibility (vllm-project#44923) Signed-off-by: Richard Barnes <rbarnes@meta.com> Co-authored-by: Shengqi Chen <harry-chen@outlook.com>
Picks up vllm-project/vllm#44923, which upgrades vllm's CUDA Dockerfiles from GCC 10 to GCC 12 to match PyTorch's C++20 requirement. Pinning to the merge commit on vllm main (05d98482). Test Plan: vllm CI passed on this commit prior to and at merge into vllm main.
…atibility (vllm-project#44923) Signed-off-by: Richard Barnes <rbarnes@meta.com> Co-authored-by: Shengqi Chen <harry-chen@outlook.com>
…atibility (vllm-project#44923) Signed-off-by: Richard Barnes <rbarnes@meta.com> Co-authored-by: Shengqi Chen <harry-chen@outlook.com> Signed-off-by: divineearthly <divineearthly@gmail.com>
…atibility (vllm-project#44923) Signed-off-by: Richard Barnes <rbarnes@meta.com> Co-authored-by: Shengqi Chen <harry-chen@outlook.com>
…atibility (vllm-project#44923) Signed-off-by: Richard Barnes <rbarnes@meta.com> Co-authored-by: Shengqi Chen <harry-chen@outlook.com>
Why this is not a duplicate
Checked open PRs on 2026-06-08 with
gh pr list --search "gcc-10 gcc-12"and--search "c++20 compiler"— no existing PR addresses this.Summary
PyTorch PR #167929 raised the minimum C++ standard to C++20 and the minimum GCC version to 11.3. vLLM's main CUDA Dockerfile and nightly-torch Dockerfile both pin GCC to version 10 to suppress spurious
-Wredundant-movewarning spam from CUTLASS (GCC bug #92519). GCC bug #92519 was fixed in GCC 11, so the pin is no longer necessary. GCC 12 is chosen because:gcc-12on Ubuntu 22.04 without a PPAChanges
docker/Dockerfile: gcc-10 → gcc-12, updated commentdocker/Dockerfile.nightly_torch: gcc-10 → gcc-12, updated commentCMakeLists.txt: addFATAL_ERRORif GCC < 12 (mirrors existing gate incmake/cpu_extension.cmake)docs/getting_started/installation/gpu.cuda.inc.md: add GCC ≥ 12 prerequisite note in the Full Build sectionTest commands run and results
git diffreviewed for all four files — changes are minimal and correctpre-commit run --files <changed files>— run before submissionAI assistance disclosure
This PR was developed with AI assistance (Claude Code), but I have reviewed all the changes myself and approve of them.