diff --git a/C/CUDA/CUDNN/build_tarballs.jl b/C/CUDA/CUDNN/build_tarballs.jl deleted file mode 100644 index 6b74dd41998..00000000000 --- a/C/CUDA/CUDNN/build_tarballs.jl +++ /dev/null @@ -1,97 +0,0 @@ -using BinaryBuilder, Pkg -using Base.BinaryPlatforms: arch, os - -include("../common.jl") - -const YGGDRASIL_DIR = "../../.." -include(joinpath(YGGDRASIL_DIR, "fancy_toys.jl")) -include(joinpath(YGGDRASIL_DIR, "platforms", "cuda.jl")) - -name = "CUDNN" -version = v"8.9.4" -full_version = "8.9.4.25" - -# XXX: the server's redistrib json does not list both CUDA variants, so provide our own. -json = read("redistrib.json", String) - -script = raw""" -mkdir -p ${libdir} ${prefix}/include - -cd ${WORKSPACE}/srcdir -if [[ ${target} == *-linux-gnu ]]; then - cd cudnn* - find . - - install_license LICENSE - - mv lib/libcudnn*.so* ${libdir} - mv include/* ${prefix}/include -elif [[ ${target} == x86_64-w64-mingw32 ]]; then - cd cudnn* - find . - - install_license LICENSE - - mv bin/cudnn*64_*.dll ${libdir} - mv include/* ${prefix}/include - - mv ../dll_x64/zlibwapi.dll ${libdir} - - # fixup - chmod +x ${libdir}/*.dll -fi -""" - -augment_platform_block = CUDA.augment - -products = [ - LibraryProduct(["libcudnn_ops_infer", "cudnn_ops_infer64_$(version.major)"], :libcudnn_ops_infer64), - LibraryProduct(["libcudnn_ops_train", "cudnn_ops_train64_$(version.major)"], :libcudnn_ops_train64), - LibraryProduct(["libcudnn_cnn_infer", "cudnn_cnn_infer64_$(version.major)"], :libcudnn_cnn_infer64), - LibraryProduct(["libcudnn_cnn_train", "cudnn_cnn_train64_$(version.major)"], :libcudnn_cnn_train64), - LibraryProduct(["libcudnn_adv_infer", "cudnn_adv_infer64_$(version.major)"], :libcudnn_adv_infer64), - LibraryProduct(["libcudnn_adv_train", "cudnn_adv_train64_$(version.major)"], :libcudnn_adv_train64), - - # shim layer - LibraryProduct(["libcudnn", "cudnn64_$(version.major)"], :libcudnn), -] - -dependencies = [RuntimeDependency(PackageSpec(name="CUDA_Runtime_jll"))] - -platforms = [Platform("x86_64", "linux"), - Platform("powerpc64le", "linux"), - Platform("aarch64", "linux"), - Platform("x86_64", "windows")] - -builds = [] -for cuda_version in [v"11", v"12"], platform in platforms - augmented_platform = deepcopy(platform) - augmented_platform["cuda"] = CUDA.platform(cuda_version) - should_build_platform(triplet(augmented_platform)) || continue - - sources = parse_sources(json, "cudnn", ["cudnn"]; version=full_version, platform, - variant="cuda$(cuda_version.major)") - - if platform == Platform("x86_64", "windows") - push!(sources, - ArchiveSource("http://www.winimage.com/zLibDll/zlib123dllx64.zip", - "fd324c6923aa4f45a60413665e0b68bb34a7779d0861849e02d2711ff8efb9a4")) - end - - push!(builds, (; platforms=[augmented_platform], sources)) -end - -# don't allow `build_tarballs` to override platform selection based on ARGS. -# we handle that ourselves by calling `should_build_platform` -non_platform_ARGS = filter(arg -> startswith(arg, "--"), ARGS) - -# `--register` should only be passed to the latest `build_tarballs` invocation -non_reg_ARGS = filter(arg -> arg != "--register", non_platform_ARGS) - -for (i,build) in enumerate(builds) - build_tarballs(i == lastindex(builds) ? non_platform_ARGS : non_reg_ARGS, - name, version, build.sources, script, - build.platforms, products, dependencies; - julia_compat="1.6", augment_platform_block, dont_dlopen=true) -end - diff --git a/C/CUDA/CUDNN/redistrib.json b/C/CUDA/CUDNN/redistrib.json deleted file mode 100644 index e4dcb427717..00000000000 --- a/C/CUDA/CUDNN/redistrib.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "release_date": "2023-08-09", - "release_label": "8.9.4.25", - "release_product": "cudnn", - "cudnn": { - "name": "NVIDIA CUDA Deep Neural Network library", - "license": "cudnn", - "license_path": "cudnn/LICENSE.txt", - "version": "8.9.4.25", - "cuda_variant": [ - "11", - "12" - ], - "linux-x86_64": { - "cuda11": { - "relative_path": "cudnn/linux-x86_64/cudnn-linux-x86_64-8.9.4.25_cuda11-archive.tar.xz", - "sha256": "e8b41f85e930dc7a51d22aae6ebe493f3b6bc7979465c3ea0996bae2f1240554" - }, - "cuda12": { - "relative_path": "cudnn/linux-x86_64/cudnn-linux-x86_64-8.9.4.25_cuda12-archive.tar.xz", - "sha256": "82d04906c0d6828561bbddc68f8b18cf0a334ef1162f6eff7bc88dc3313e15d1" - } - }, - "linux-ppc64le": { - "cuda11": { - "relative_path": "cudnn/linux-ppc64le/cudnn-linux-ppc64le-8.9.4.25_cuda11-archive.tar.xz", - "sha256": "88309918adeef54c01261423242d5748f89320e1d61832e429fa4b7126c8c2ec" - }, - "cuda12": { - "relative_path": "cudnn/linux-ppc64le/cudnn-linux-ppc64le-8.9.4.25_cuda12-archive.tar.xz", - "sha256": "d5bf263f38e89fae62c4eb579bbc953d97b5bf300f91a3e6d6404df43b2641b6" - } - }, - "linux-sbsa": { - "cuda11": { - "relative_path": "cudnn/linux-sbsa/cudnn-linux-sbsa-8.9.4.25_cuda11-archive.tar.xz", - "sha256": "6aa88fe0e09eec35d8010507716bee1152c2efe55ffb062a82aa320616549fc2" - }, - "cuda12": { - "relative_path": "cudnn/linux-sbsa/cudnn-linux-sbsa-8.9.4.25_cuda12-archive.tar.xz", - "sha256": "cad77909d936789efe44c8d348e3dcab9c8fcc95ac622658f9a903794e292375" - } - }, - "windows-x86_64": { - "cuda11": { - "relative_path": "cudnn/windows-x86_64/cudnn-windows-x86_64-8.9.4.25_cuda11-archive.zip", - "sha256": "97dfcff6ddb55a903b0a609634ac2c508da50e0bb6fabc818df8026361d28672" - }, - "cuda12": { - "relative_path": "cudnn/windows-x86_64/cudnn-windows-x86_64-8.9.4.25_cuda12-archive.zip", - "sha256": "c41650cc73de19b1974b58a1de7750182a2a157d9f1f825481fd7a51522ca36c" - } - } - } -} diff --git a/C/CUDNN/build_10.2.jl b/C/CUDNN/build_10.2.jl new file mode 100644 index 00000000000..1bb1a7df7c5 --- /dev/null +++ b/C/CUDNN/build_10.2.jl @@ -0,0 +1,12 @@ +platforms_and_sources = Dict( + Platform("x86_64", "linux") => [ + ArchiveSource("https://developer.nvidia.com/compute/machine-learning/cudnn/secure/8.2.1.32/10.2_06072021/cudnn-10.2-linux-x64-v8.2.1.32.tgz", + "fd6321ff3bce4ce0cb3342e5bd38c96dcf3b073d44d0808962711c518b6d61e2")], + Platform("x86_64", "windows") => [ + ArchiveSource("https://developer.nvidia.com/compute/machine-learning/cudnn/secure/8.2.1.32/10.2_06072021/cudnn-10.2-windows10-x64-v8.2.1.32.zip", + "3e70876bdcf44f856d9c9dbdbde07ceec43005e97d5ffe83338b255c8466151f")], + Platform("aarch64", "linux") => [ + FileSource("https://repo.download.nvidia.com/jetson/common/pool/main/c/cudnn/libcudnn8_8.2.1.32-1+cuda10.2_arm64.deb", "4c1619640e5411fb53e87828c62ff429daa608c8f02efb96460b43f743d64bb8"), + FileSource("https://repo.download.nvidia.com/jetson/common/pool/main/c/cudnn/libcudnn8-dev_8.2.1.32-1+cuda10.2_arm64.deb", "adf7873edbde7fe293f672ebc65fcec299642950797d18b1c3a89855bb23904e") + ] +) diff --git a/C/CUDNN/build_11.jl b/C/CUDNN/build_11.jl new file mode 100644 index 00000000000..86177458503 --- /dev/null +++ b/C/CUDNN/build_11.jl @@ -0,0 +1,14 @@ +platforms_and_sources = Dict( + Platform("x86_64", "linux") => [ + ArchiveSource("https://developer.nvidia.com/compute/machine-learning/cudnn/secure/8.2.1.32/11.3_06072021/cudnn-11.3-linux-x64-v8.2.1.32.tgz", + "39412acd9ef5dd27954b6b9f5df75bd381c5d7ceb7979af6c743a7f4521f9c77")], + Platform("powerpc64le", "linux") => [ + ArchiveSource("https://developer.nvidia.com/compute/machine-learning/cudnn/secure/8.2.1.32/11.3_06072021/cudnn-11.3-linux-ppc64le-v8.2.1.32.tgz", + "4ee4f2afeaae34fdb06da8d4942a6802aae94ecc51f307292c45966eecbe5fb9")], + Platform("aarch64", "linux") => [ + ArchiveSource("https://developer.nvidia.com/compute/machine-learning/cudnn/secure/8.2.1.32/11.3_06072021/cudnn-11.3-linux-aarch64sbsa-v8.2.1.32.tgz", + "e3a0e570cb8ba01d5d45e6eb1ebe29ff22fd5fb8ad45bfe7a448f4f95065ec1e")], + Platform("x86_64", "windows") => [ + ArchiveSource("https://developer.nvidia.com/compute/machine-learning/cudnn/secure/8.2.1.32/11.3_06072021/cudnn-11.3-windows-x64-v8.2.1.32.zip", + "5b9bf2dc4670fb1519ef55e13da5123f0b6b39fac5e6138e31388b269808d5f2")], +) diff --git a/C/CUDNN/build_tarballs.jl b/C/CUDNN/build_tarballs.jl new file mode 100644 index 00000000000..5a2d457dd17 --- /dev/null +++ b/C/CUDNN/build_tarballs.jl @@ -0,0 +1,89 @@ +using BinaryBuilder, Pkg +using Base.BinaryPlatforms: arch, os + +const YGGDRASIL_DIR = "../.." +include(joinpath(YGGDRASIL_DIR, "fancy_toys.jl")) +include(joinpath(YGGDRASIL_DIR, "platforms", "cuda.jl")) + +name = "CUDNN" +version = v"8.2.1" + +script = raw""" +mkdir -p ${libdir} ${prefix}/include + +cd ${WORKSPACE}/srcdir +if [[ ${target} == powerpc64le-linux-gnu ]]; then + cd cuda/targets/ppc64le-linux + find . + + install_license NVIDIA_SLA_cuDNN_Support.txt + + mv lib/libcudnn*.so* ${libdir} + mv include/* ${prefix}/include +elif [[ ${target} == aarch64-linux-gnu && ${bb_full_target} == aarch64-linux-gnu-*-cuda+10.2 ]]; then + apk add dpkg + dpkg-deb -x libcudnn8_*.deb . + dpkg-deb -x libcudnn8-dev_*.deb . + mv -nv ./usr/include/aarch64-linux-gnu/* ${includedir} + mv -nv ./usr/lib/aarch64-linux-gnu/libcudnn*.so* ${libdir} + install_license ./usr/share/doc/libcudnn8/copyright +elif [[ ${target} == *-linux-gnu ]]; then + cd cuda + find . + + install_license NVIDIA_SLA_cuDNN_Support.txt + + mv lib64/libcudnn*.so* ${libdir} + mv include/* ${prefix}/include +elif [[ ${target} == x86_64-w64-mingw32 ]]; then + cd cuda + find . + + install_license NVIDIA_SLA_cuDNN_Support.txt + + mv bin/cudnn*64_*.dll ${libdir} + mv include/* ${prefix}/include + + mv ../dll_x64/zlibwapi.dll ${libdir} + + # fixup + chmod +x ${libdir}/*.dll +fi +""" + +augment_platform_block = CUDA.augment + +products = [ + LibraryProduct(["libcudnn_ops_infer", "cudnn_ops_infer64_$(version.major)"], :libcudnn_ops_infer64), + LibraryProduct(["libcudnn_ops_train", "cudnn_ops_train64_$(version.major)"], :libcudnn_ops_train64), + LibraryProduct(["libcudnn_cnn_infer", "cudnn_cnn_infer64_$(version.major)"], :libcudnn_cnn_infer64), + LibraryProduct(["libcudnn_cnn_train", "cudnn_cnn_train64_$(version.major)"], :libcudnn_cnn_train64), + LibraryProduct(["libcudnn_adv_infer", "cudnn_adv_infer64_$(version.major)"], :libcudnn_adv_infer64), + LibraryProduct(["libcudnn_adv_train", "cudnn_adv_train64_$(version.major)"], :libcudnn_adv_train64), + + # shim layer + LibraryProduct(["libcudnn", "cudnn64_$(version.major)"], :libcudnn), +] + +dependencies = [RuntimeDependency(PackageSpec(name="CUDA_Runtime_jll"))] + +builds = ["10.2", "11"] +for build in builds + include("build_$(build).jl") + cuda_version = VersionNumber(build) + + for (platform, sources) in platforms_and_sources + augmented_platform = Platform(arch(platform), os(platform); + cuda=CUDA.platform(cuda_version)) + should_build_platform(triplet(augmented_platform)) || continue + if platform == Platform("x86_64", "windows") + push!(sources, + ArchiveSource("http://www.winimage.com/zLibDll/zlib123dllx64.zip", + "fd324c6923aa4f45a60413665e0b68bb34a7779d0861849e02d2711ff8efb9a4")) + end + build_tarballs(ARGS, name, version, sources, script, [augmented_platform], + products, dependencies; lazy_artifacts=true, + julia_compat="1.6", augment_platform_block, + dont_dlopen=true) + end +end