Skip to content

Commit ff9c766

Browse files
authored
Default Docker images to GCC 13 and remove GCC 14 (#7918)
## Summary - Default x86_64 Docker image to gcc-toolset-13, matching the aarch64 image and legacy manylinux builders. GCC 14 caused issues with CUDA 12.6 nvcc (only supports up to GCC 13) and ld.gold incompatibilities with CMake 4.3's --dependency-file flag. - Add `patch_libstdc.sh` to x86_64 Dockerfile to weaken `recursive_directory_iterator` symbols in GCC 13's `libstdc++_nonshared.a`, preventing them from appearing as strong (T) symbols in `libtorch_cpu.so` (pytorch/pytorch#133437). - Remove gcc-toolset-14 installation from both x86_64 and aarch64 images since it is no longer needed. - Also includes CUDA 12.6 addition to the Docker image. ## Test plan - [ ] Build CPU and CUDA x86_64 images and verify `gcc --version` reports GCC 13 - [ ] Build aarch64 images and verify `gcc --version` reports GCC 13 - [ ] Verify `nm -g $(gcc -print-file-name=libstdc++_nonshared.a) | grep " T .*recursive_directory_iterator"` returns empty (symbols weakened) - [ ] Build a PyTorch wheel in the new image and verify `check_binary_symbols.py` passes (no strong `recursive_directory_iterator` symbols in `libtorch_cpu.so`) - [ ] Verify CUDA 12.6 nvcc compiles successfully with GCC 13
1 parent 132c856 commit ff9c766

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

docker/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,13 @@ RUN dnf install -y \
5555
gcc-toolset-13-gcc \
5656
gcc-toolset-13-gcc-c++ \
5757
gcc-toolset-13-gcc-gfortran \
58-
gcc-toolset-14-gcc \
59-
gcc-toolset-14-gcc-c++ \
60-
gcc-toolset-14-gcc-gfortran \
6158
&& dnf clean all \
6259
&& rm -rf /var/cache/dnf
6360

61+
# Default to gcc-toolset-13 (matching aarch64 and legacy manylinux builders).
62+
ENV PATH=/opt/rh/gcc-toolset-13/root/usr/bin:$PATH
63+
ENV LD_LIBRARY_PATH=/opt/rh/gcc-toolset-13/root/usr/lib64:/opt/rh/gcc-toolset-13/root/usr/lib:$LD_LIBRARY_PATH
64+
6465
# Install pre-built clang 15 and 18 (clang 20 is already the system default)
6566
RUN ARCH=$(uname -m) && PLATFORM="linux-${ARCH}" && \
6667
for CLANG_VERSION in 15 18; do \

docker/Dockerfile.aarch64

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ RUN dnf install -y \
5252
gcc-toolset-13-gcc-c++ \
5353
gcc-toolset-13-gcc-gfortran \
5454
gcc-toolset-13-gdb \
55-
gcc-toolset-14-gcc \
56-
gcc-toolset-14-gcc-c++ \
57-
gcc-toolset-14-gcc-gfortran \
5855
&& dnf clean all \
5956
&& rm -rf /var/cache/dnf
6057

docker/install_cuda.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
)
3333

3434
# CUDA arches to skip (PyTorch supports them but we don't build Docker images for them)
35-
SKIP_CUDA_ARCHES = {"12.6"}
35+
SKIP_CUDA_ARCHES = {"12.9"}
3636

3737
# ---------------------------------------------------------------------------
3838
# Fetching & parsing PyTorch version info

0 commit comments

Comments
 (0)