[Build] Upgrade CUDA Dockerfiles from GCC 10 to GCC 12 for C++20 compatibility (#44923)

Signed-off-by: Richard Barnes <rbarnes@meta.com>
Co-authored-by: Shengqi Chen <harry-chen@outlook.com>
This commit is contained in:
Richard Barnes
2026-06-11 12:26:52 +00:00
committed by GitHub
co-authored by Shengqi Chen
parent ef67071b21
commit 05d9848267
4 changed files with 27 additions and 9 deletions
+7 -5
View File
@@ -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)