From fb82e672a91241c617a6294a4223a542de5c463c Mon Sep 17 00:00:00 2001 From: Jesper Stemann Andersen Date: Mon, 31 Jan 2022 22:24:15 +0100 Subject: [PATCH 1/3] Added TensorRT v8.0.1 --- T/TensorRT/build_10.2.jl | 8 ++++++ T/TensorRT/build_11.0.jl | 1 + T/TensorRT/build_11.1.jl | 1 + T/TensorRT/build_11.2.jl | 1 + T/TensorRT/build_11.3.jl | 1 + T/TensorRT/build_11.jl | 14 +++++++++ T/TensorRT/build_tarballs.jl | 55 ++++++++++++++++++++++++++++++++++++ 7 files changed, 81 insertions(+) create mode 100644 T/TensorRT/build_10.2.jl create mode 120000 T/TensorRT/build_11.0.jl create mode 120000 T/TensorRT/build_11.1.jl create mode 120000 T/TensorRT/build_11.2.jl create mode 120000 T/TensorRT/build_11.3.jl create mode 100644 T/TensorRT/build_11.jl create mode 100644 T/TensorRT/build_tarballs.jl diff --git a/T/TensorRT/build_10.2.jl b/T/TensorRT/build_10.2.jl new file mode 100644 index 00000000000..542f8998f4a --- /dev/null +++ b/T/TensorRT/build_10.2.jl @@ -0,0 +1,8 @@ +platforms_and_sources = Dict( + Platform("x86_64", "linux") => [ + ArchiveSource("https://developer.nvidia.com/compute/machine-learning/tensorrt/secure/8.0.1/tars/TensorRT-8.0.1.6.Linux.x86_64-gnu.cuda-10.2.cudnn8.2.tar.gz", + "110bbfd69fe27e298e1ad1bc35300569069ffeb8b691f48bcaf34703e1bafb96")], + Platform("x86_64", "windows") => [ + ArchiveSource("https://developer.nvidia.com/compute/machine-learning/tensorrt/secure/8.0.1/zip/TensorRT-8.0.1.6.Windows10.x86_64.cuda-10.2.cudnn8.2.zip", + "003cd632d978205de8b3140da743a9d39647ccb9959a1c219d34201d75a0a49e")], +) diff --git a/T/TensorRT/build_11.0.jl b/T/TensorRT/build_11.0.jl new file mode 120000 index 00000000000..98bc2197004 --- /dev/null +++ b/T/TensorRT/build_11.0.jl @@ -0,0 +1 @@ +build_11.jl \ No newline at end of file diff --git a/T/TensorRT/build_11.1.jl b/T/TensorRT/build_11.1.jl new file mode 120000 index 00000000000..98bc2197004 --- /dev/null +++ b/T/TensorRT/build_11.1.jl @@ -0,0 +1 @@ +build_11.jl \ No newline at end of file diff --git a/T/TensorRT/build_11.2.jl b/T/TensorRT/build_11.2.jl new file mode 120000 index 00000000000..98bc2197004 --- /dev/null +++ b/T/TensorRT/build_11.2.jl @@ -0,0 +1 @@ +build_11.jl \ No newline at end of file diff --git a/T/TensorRT/build_11.3.jl b/T/TensorRT/build_11.3.jl new file mode 120000 index 00000000000..98bc2197004 --- /dev/null +++ b/T/TensorRT/build_11.3.jl @@ -0,0 +1 @@ +build_11.jl \ No newline at end of file diff --git a/T/TensorRT/build_11.jl b/T/TensorRT/build_11.jl new file mode 100644 index 00000000000..3e7ae397456 --- /dev/null +++ b/T/TensorRT/build_11.jl @@ -0,0 +1,14 @@ +platforms_and_sources = Dict( + Platform("x86_64", "linux") => [ + ArchiveSource("https://developer.nvidia.com/compute/machine-learning/tensorrt/secure/8.0.1/tars/TensorRT-8.0.1.6.Linux.x86_64-gnu.cuda-11.3.cudnn8.2.tar.gz", + "def6a5ee50bed25a68a9c9e22ec671a8f29ee5414bde47c5767bd279e5596f88")], + Platform("ppc64le", "linux") => [ + ArchiveSource("https://developer.nvidia.com/compute/machine-learning/tensorrt/secure/8.0.1/tars/TensorRT-8.0.1.6.CentOS-8.3.ppc64le-gnu.cuda-11.3.cudnn8.2.tar.gz", + "fd33a32085c468f638505e2603936fa4e3f2a3fa46989570fa0b9e31a9e6914a")], + Platform("aarch64", "linux") => [ + ArchiveSource("https://developer.nvidia.com/compute/machine-learning/tensorrt/secure/8.0.1/tars/TensorRT-8.0.1.6.Ubuntu-20.04.aarch64-gnu.cuda-11.3.cudnn8.2.tar.gz", + "ea322da72b1b1ca6b8d0715ab14668c54f7d00ad22695d41a85a7055df9f63e1")], + Platform("x86_64", "windows") => [ + ArchiveSource("https://developer.nvidia.com/compute/machine-learning/tensorrt/secure/8.0.1/zip/TensorRT-8.0.1.6.Windows10.x86_64.cuda-11.3.cudnn8.2.zip", + "e51b382e931ae9032e431fff218cd2cf2d2b7a7c66c7a6bdf453557612466ae1")], +) diff --git a/T/TensorRT/build_tarballs.jl b/T/TensorRT/build_tarballs.jl new file mode 100644 index 00000000000..9f6faaa21ae --- /dev/null +++ b/T/TensorRT/build_tarballs.jl @@ -0,0 +1,55 @@ +using BinaryBuilder, Pkg +using Base.BinaryPlatforms: arch, os + +include("../../fancy_toys.jl") + +name = "TensorRT" +version = v"8.0.1" + +script = raw""" +mkdir -p ${bindir} ${libdir} ${includedir} + +cd ${WORKSPACE}/srcdir + +cd TensorRT* + +mv bin/* ${bindir} +mv include/* ${includedir} +mv lib/*.${dlext}* ${libdir} + +if [[ ${target} == x86_64-w64-mingw32 ]]; then + chmod +x ${bindir}/*.{dll,exe} + install_license doc/TensorRT-SLA.pdf +else + install_license doc/pdf/TensorRT-SLA.pdf +fi +""" + +lib_names = [ + "nvinfer", + "nvinfer_builder_resource", + "nvinfer_plugin", + "nvonnxparser", + "nvparsers" +] + +products = vcat( + [LibraryProduct(["lib" * lib_name, lib_name], Symbol("lib" * lib_name)) for lib_name in lib_names], + [ExecutableProduct("trtexec", :trtexec)] +) + +dependencies = [Dependency("CUDNN_jll")] + +cuda_versions = [v"10.2", v"11.0", v"11.1", v"11.2", v"11.3"] +for cuda_version in cuda_versions + cuda_tag = "$(cuda_version.major).$(cuda_version.minor)" + include("build_$(cuda_tag).jl") + + for (platform, sources) in platforms_and_sources + augmented_platform = Platform(arch(platform), os(platform); cuda=cuda_tag) + should_build_platform(triplet(augmented_platform)) || continue + arch(platform) == "x86_64" || cuda_version == v"11.3" || continue # Non-x86_64 archs ARM and Power only support CUDA 11.3 + build_tarballs(ARGS, name, version, sources, script, [augmented_platform], + products, dependencies; lazy_artifacts=true) + end +end From 6471ff4d704782771a8a1e2500fa7a84eb767fa6 Mon Sep 17 00:00:00 2001 From: Jesper Stemann Andersen Date: Fri, 11 Mar 2022 18:06:31 +0100 Subject: [PATCH 2/3] Added support for TensorRT on CUDA 10.2 on aarch64-linux-gnu From the NVIDIA Jetson APT repo. --- T/TensorRT/build_10.2.jl | 11 +++++++++++ T/TensorRT/build_tarballs.jl | 36 ++++++++++++++++++++++-------------- 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/T/TensorRT/build_10.2.jl b/T/TensorRT/build_10.2.jl index 542f8998f4a..fe18cd91c56 100644 --- a/T/TensorRT/build_10.2.jl +++ b/T/TensorRT/build_10.2.jl @@ -2,6 +2,17 @@ platforms_and_sources = Dict( Platform("x86_64", "linux") => [ ArchiveSource("https://developer.nvidia.com/compute/machine-learning/tensorrt/secure/8.0.1/tars/TensorRT-8.0.1.6.Linux.x86_64-gnu.cuda-10.2.cudnn8.2.tar.gz", "110bbfd69fe27e298e1ad1bc35300569069ffeb8b691f48bcaf34703e1bafb96")], + Platform("aarch64", "linux") => [ + FileSource("https://repo.download.nvidia.com/jetson/common/pool/main/t/tensorrt/libnvinfer-bin_8.0.1-1+cuda10.2_arm64.deb", "f4a98ac9086b4a195bcab26aca176a9db6b5a196ff42d3dfdb28a16d30e8a312"), + FileSource("https://repo.download.nvidia.com/jetson/common/pool/main/t/tensorrt/libnvinfer-dev_8.0.1-1+cuda10.2_arm64.deb", "f750c910a23107715dc2510d360725e46e9072079caacf3cec4255dd38bee849"), + FileSource("https://repo.download.nvidia.com/jetson/common/pool/main/t/tensorrt/libnvinfer-plugin-dev_8.0.1-1+cuda10.2_arm64.deb", "4dabae4f5ea8f3eb54dbd36cf3dde3d038fae2a857529b869844b05cec77092a"), + FileSource("https://repo.download.nvidia.com/jetson/common/pool/main/t/tensorrt/libnvinfer-plugin8_8.0.1-1+cuda10.2_arm64.deb", "71435b08b97346e2b0f568332c3440b8f6c00b5198f83ab5935f161aae39f8d8"), + FileSource("https://repo.download.nvidia.com/jetson/common/pool/main/t/tensorrt/libnvinfer8_8.0.1-1+cuda10.2_arm64.deb", "305c4482a315ceb59e514823b359fdeebfbdd5fa2124e277dd176589e2f49aea"), + FileSource("https://repo.download.nvidia.com/jetson/common/pool/main/t/tensorrt/libnvonnxparsers-dev_8.0.1-1+cuda10.2_arm64.deb", "6f477ab54c4fd646ab9f65baed0157dca7ca29de6bc7f992f5285d8baa30b5eb"), + FileSource("https://repo.download.nvidia.com/jetson/common/pool/main/t/tensorrt/libnvonnxparsers8_8.0.1-1+cuda10.2_arm64.deb", "8d4b0722515d91592e73dca2c43b798430bef4633b34d912324b53b63acf41ae"), + FileSource("https://repo.download.nvidia.com/jetson/common/pool/main/t/tensorrt/libnvparsers-dev_8.0.1-1+cuda10.2_arm64.deb", "b09864c351aebf2200fb98f48dc68b4a75260bbcd01423bbf1633acdc115b9be"), + FileSource("https://repo.download.nvidia.com/jetson/common/pool/main/t/tensorrt/libnvparsers8_8.0.1-1+cuda10.2_arm64.deb", "34040352c9f44611928a7d6aa6a7f885b6506a7b3310a8b9fc0782a9ba42037a"), + ], Platform("x86_64", "windows") => [ ArchiveSource("https://developer.nvidia.com/compute/machine-learning/tensorrt/secure/8.0.1/zip/TensorRT-8.0.1.6.Windows10.x86_64.cuda-10.2.cudnn8.2.zip", "003cd632d978205de8b3140da743a9d39647ccb9959a1c219d34201d75a0a49e")], diff --git a/T/TensorRT/build_tarballs.jl b/T/TensorRT/build_tarballs.jl index 9f6faaa21ae..846f8fa00b9 100644 --- a/T/TensorRT/build_tarballs.jl +++ b/T/TensorRT/build_tarballs.jl @@ -7,27 +7,34 @@ name = "TensorRT" version = v"8.0.1" script = raw""" -mkdir -p ${bindir} ${libdir} ${includedir} - cd ${WORKSPACE}/srcdir -cd TensorRT* - -mv bin/* ${bindir} -mv include/* ${includedir} -mv lib/*.${dlext}* ${libdir} - -if [[ ${target} == x86_64-w64-mingw32 ]]; then - chmod +x ${bindir}/*.{dll,exe} - install_license doc/TensorRT-SLA.pdf +if [[ ${bb_full_target} == aarch64-linux-gnu*cuda+10.2 ]]; then + apk add dpkg + ls *.deb | xargs -Ideb_file dpkg-deb -x deb_file tmp + mkdir -p $bindir $includedir $libdir + install -Dv --mode=755 tmp/usr/src/tensorrt/bin/* $bindir + install -Dv --mode=644 tmp/usr/include/$target/* $includedir + install -Dv --mode=755 tmp/usr/lib/$target/*.so* $libdir + install_license tmp/usr/share/doc/libnvinfer8/copyright else - install_license doc/pdf/TensorRT-SLA.pdf + mkdir -p ${bindir} ${libdir} ${includedir} + cd TensorRT* + mv bin/* ${bindir} + mv include/* ${includedir} + mv lib/*.${dlext}* ${libdir} + + if [[ ${target} == x86_64-w64-mingw32 ]]; then + chmod +x ${bindir}/*.{dll,exe} + install_license doc/TensorRT-SLA.pdf + else + install_license doc/pdf/TensorRT-SLA.pdf + fi fi """ lib_names = [ "nvinfer", - "nvinfer_builder_resource", "nvinfer_plugin", "nvonnxparser", "nvparsers" @@ -48,7 +55,8 @@ for cuda_version in cuda_versions for (platform, sources) in platforms_and_sources augmented_platform = Platform(arch(platform), os(platform); cuda=cuda_tag) should_build_platform(triplet(augmented_platform)) || continue - arch(platform) == "x86_64" || cuda_version == v"11.3" || continue # Non-x86_64 archs ARM and Power only support CUDA 11.3 + arch(platform) != "aarch64" || cuda_version == v"10.2" || cuda_version == v"11.3" || continue # AArch64 only support CUDA v10.2 and v11.3 + arch(platform) != "powerpc64le" || cuda_version == v"11.3" || continue # PowerPC64LE only support CUDA 11.3 build_tarballs(ARGS, name, version, sources, script, [augmented_platform], products, dependencies; lazy_artifacts=true) end From 90ee1c8254166ad34d871090464fbc65ba2a9cfa Mon Sep 17 00:00:00 2001 From: Jesper Stemann Andersen Date: Sat, 12 Mar 2022 11:46:08 +0100 Subject: [PATCH 3/3] Using CUDNN v8.2.1 for build, and specified compat="8.2" --- T/TensorRT/build_tarballs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/T/TensorRT/build_tarballs.jl b/T/TensorRT/build_tarballs.jl index 846f8fa00b9..02726bf607e 100644 --- a/T/TensorRT/build_tarballs.jl +++ b/T/TensorRT/build_tarballs.jl @@ -45,7 +45,7 @@ products = vcat( [ExecutableProduct("trtexec", :trtexec)] ) -dependencies = [Dependency("CUDNN_jll")] +dependencies = [Dependency("CUDNN_jll", v"8.2.1"; compat="8.2")] cuda_versions = [v"10.2", v"11.0", v"11.1", v"11.2", v"11.3"] for cuda_version in cuda_versions