forked from microsoft/onnxruntime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade GCC and remove the dependency on GCC8's experimental std::fil…
…esystem implementation (microsoft#20893) ### Description This PR upgrades CUDA 11 build pipelines' GCC version from 8 to 11. ### Motivation and Context GCC8 has an experimental std::filesystem implementation which is not ABI compatible with the formal one in later GCC releases. It didn't cause trouble for us, however, ONNX community has encountered this issue much. For example, onnx/onnx#6047 . So this PR increases the minimum supported GCC version from 8 to 9, and removes the references to GCC's "stdc++fs" library. Please note we compile our code on RHEL8 and RHEL8's libstdc++ doesn't have the fs library, which means the binaries in ONNX Runtime's official packages always static link to the fs library. It is just a matter of which version of the library, an experimental one or a more mature one. And it is an implementation detail that is not visible from outside. Anyway, a newer GCC is better. It will give us the chance to use many C++20 features. #### Why we were using GCC 8? It is because all our Linux packages were built on RHEL8 or its equivalents. The default GCC version in RHEL8 is 8. RHEL also provides additional GCC versions from RH devtoolset. UBI8 is the abbreviation of Red Hat Universal Base Image 8, which is the containerized RHEL8. UBI8 is free, which means it doesn't require a subscription(while RHEL does). The only devtoolset that UBI8 provides is GCC 12, which is too new for being used with CUDA 11.8. And our CUDA 11.8's build env is a docker image from Nvidia that is based on UBI8. #### How the problem is solved Almalinux is an alternative to RHEL. Almalinux 8 provides GCC 11. And the CUDA 11.8 docker image from Nvidia is open source, which means we can rebuild the image based on Almalinux 8 to get GCC 11. I've done this, but I cannot republish the new image due to various complicated license restrictions. Therefore I put them at an internal location in onnxruntimebuildcache.azurecr.io.
- Loading branch information
Showing
23 changed files
with
152 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tools/ci_build/github/linux/docker/Dockerfile.manylinux2_28_cpu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tools/ci_build/github/linux/docker/Dockerfile.manylinux2_28_training_cuda11_8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tools/ci_build/github/linux/docker/Dockerfile.manylinux2_28_training_cuda12_2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tools/ci_build/github/linux/docker/inference/aarch64/python/cpu/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
tools/ci_build/github/linux/docker/inference/x86_64/default/cuda12/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
# This file is used by Zip-Nuget Packaging NoContribOps Pipeline,Zip-Nuget-Java Packaging Pipeline | ||
FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_2_x64_ubi8_gcc12_dotnet:20240531.1 | ||
ARG TRT_VERSION | ||
|
||
#Install TensorRT only if TRT_VERSION is not empty | ||
RUN if [ -n "$TRT_VERSION" ]; then \ | ||
echo "TRT_VERSION is $TRT_VERSION" && \ | ||
dnf -y install \ | ||
libnvinfer10-${TRT_VERSION} \ | ||
libnvinfer-headers-devel-${TRT_VERSION} \ | ||
libnvinfer-devel-${TRT_VERSION} \ | ||
libnvinfer-lean10-${TRT_VERSION} \ | ||
libnvonnxparsers10-${TRT_VERSION} \ | ||
libnvonnxparsers-devel-${TRT_VERSION} \ | ||
libnvinfer-dispatch10-${TRT_VERSION} \ | ||
libnvinfer-plugin10-${TRT_VERSION} \ | ||
libnvinfer-vc-plugin10-${TRT_VERSION} \ | ||
libnvinfer-bin-${TRT_VERSION} \ | ||
libnvinfer-plugin10-${TRT_VERSION} \ | ||
libnvinfer-plugin-devel-${TRT_VERSION} \ | ||
libnvinfer-vc-plugin-devel-${TRT_VERSION} \ | ||
libnvinfer-lean-devel-${TRT_VERSION} \ | ||
libnvinfer-dispatch-devel-${TRT_VERSION} \ | ||
libnvinfer-headers-plugin-devel-${TRT_VERSION} && \ | ||
dnf clean dbcache ; \ | ||
else \ | ||
echo "TRT_VERSION is none skipping Tensor RT Installation" ; \ | ||
fi | ||
|
||
|
||
|
||
ENV LANG=en_US.UTF-8 | ||
ENV LC_ALL=en_US.UTF-8 | ||
|
||
ENV CUDAHOSTCXX /opt/rh/gcc-toolset-12/root/usr/bin/g++ | ||
ADD scripts /tmp/scripts | ||
RUN sed -i 's/enabled\s*=\s*1/enabled = 1\nexclude=dotnet* aspnet* netstandard*/g' /etc/yum.repos.d/ubi.repo && \ | ||
rpm -Uvh https://packages.microsoft.com/config/centos/8/packages-microsoft-prod.rpm && dnf install -y msopenjdk-11 && cd /tmp/scripts && /tmp/scripts/install_deps.sh && rm -rf /tmp/scripts | ||
ENV PATH /usr/lib/jvm/msopenjdk-11/bin:$PATH | ||
ENV JAVA_HOME=/usr/lib/jvm/msopenjdk-11 | ||
ARG BUILD_UID=1001 | ||
ARG BUILD_USER=onnxruntimedev | ||
RUN adduser --uid $BUILD_UID $BUILD_USER | ||
WORKDIR /home/$BUILD_USER | ||
USER $BUILD_USER |
Oops, something went wrong.