From c8f1778107ea1ddbdf0906f0f9233d51db5ce25d Mon Sep 17 00:00:00 2001 From: Ludvig af Klinteberg Date: Fri, 17 Oct 2025 09:25:37 +0200 Subject: [PATCH 1/7] Attempt building for CUDA 13 using new master of FINUFFT --- C/cufinufft/build_tarballs.jl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/C/cufinufft/build_tarballs.jl b/C/cufinufft/build_tarballs.jl index 1cf87ba3b28..2dc0b7328b3 100644 --- a/C/cufinufft/build_tarballs.jl +++ b/C/cufinufft/build_tarballs.jl @@ -11,7 +11,7 @@ include(joinpath(@__DIR__, "..", "..", "platforms", "cuda.jl")) # needed for CUDA cuda, and would produce a giant amount of artifacts) name = "cufinufft" version = v"2.4.1" -commit_hash = "e7144a5c08cbaf3e3b344a4fdd92bc3c7e468ff2" # v2.4.1 +commit_hash = "7919db50853f9933004d7c61e54b5782f7d8b00e" # current master preferred_gcc_version=v"11" # Collection of sources required to complete build @@ -22,8 +22,10 @@ sources = [ # Build script: cufinufft, all possible archs available for each CUDA version # - CMake toolchain looks for compiler in CUDA_PATH/bin/nvcc # and libs in CUDA_PATH/lib64, so create link. +# - Need higher version of CMake, so remove existing script = raw""" cd $WORKSPACE/srcdir/finufft*/ +apk del cmake export CUDA_PATH="$prefix/cuda" ln -s $prefix/cuda/lib $prefix/cuda/lib64 @@ -47,15 +49,13 @@ unlink $prefix/cuda/lib64 # Build for all supported CUDA > v11 platforms = expand_cxxstring_abis(CUDA.supported_platforms(min_version=v"11.0")) + # Cmake toolchain breaks on aarch64, so only x86_64 for now filter!(p -> arch(p)=="x86_64", platforms) # cuFINUFFT does not compile with CUDA 12.5, so exclude filter!(p -> VersionNumber(p["cuda"]) != v"12.5", platforms) -# CUDA 13 doesn't seem to build (yet) -filter!(p -> VersionNumber(p["cuda"]) < v"13", platforms) - # The products that we will ensure are always built products = [ LibraryProduct("libcufinufft", :libcufinufft) @@ -63,7 +63,9 @@ products = [ # Dependencies that must be installed before this package can be built # NVTX_jll is needed for nvToolsExt. (tested with v3.1.0+2) -dependencies = [Dependency("NVTX_jll")] +# CMake needs higher version than what is bundled +dependencies = [Dependency("NVTX_jll"), + HostBuildDependency(PackageSpec(; name="CMake_jll", version = v"3.24.3"))] for platform in platforms should_build_platform(triplet(platform)) || continue From eadd7c775ac2cd3102b54df2ccd5b157ae1524c8 Mon Sep 17 00:00:00 2001 From: Ludvig af Klinteberg Date: Wed, 22 Oct 2025 21:27:01 +0200 Subject: [PATCH 2/7] cufinufft now builds for CUDA 13 on FINUFFT master --- C/cufinufft/build_tarballs.jl | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/C/cufinufft/build_tarballs.jl b/C/cufinufft/build_tarballs.jl index 2dc0b7328b3..d20879af650 100644 --- a/C/cufinufft/build_tarballs.jl +++ b/C/cufinufft/build_tarballs.jl @@ -47,8 +47,8 @@ cmake --install . unlink $prefix/cuda/lib64 """ -# Build for all supported CUDA > v11 -platforms = expand_cxxstring_abis(CUDA.supported_platforms(min_version=v"11.0")) +# Build for all supported CUDA >= v11.6 (highest that builds) +platforms = expand_cxxstring_abis(CUDA.supported_platforms(min_version=v"11.6")) # Cmake toolchain breaks on aarch64, so only x86_64 for now filter!(p -> arch(p)=="x86_64", platforms) @@ -56,6 +56,15 @@ filter!(p -> arch(p)=="x86_64", platforms) # cuFINUFFT does not compile with CUDA 12.5, so exclude filter!(p -> VersionNumber(p["cuda"]) != v"12.5", platforms) +# Build process fails (why??) when specifying minor versions of CUDA 13, so don't +for platform in platforms + cuda_version = VersionNumber(platform["cuda"]) + if cuda_version.major==13 + platform["cuda"] = "13" + end +end +unique!(platforms) # Remove duplicates if there were multiple 13.x + # The products that we will ensure are always built products = [ LibraryProduct("libcufinufft", :libcufinufft) @@ -75,14 +84,18 @@ for platform in platforms # Build for all major archs supported by SDK # See https://en.wikipedia.org/wiki/CUDA - # sm_90 works for CUDA v12.1 and up, due to use of atomic operaitons - # sm_52 required for alloca from CUDA v12.0 and up - if VersionNumber(platform["cuda"]) < v"12.0" - cuda_archs = "50;60;70;80" - elseif VersionNumber(platform["cuda"]) < v"12.1" - cuda_archs = "60;70;80" - else + cuda_ver = VersionNumber(platform["cuda"]) + if cuda_ver >= v"13" # 13.0+ + # Skip 110,121 to not run out of space + cuda_archs = "75;80;90;100;120" + elseif cuda_ver >= v"12.1" # 12.1-12.9 + # sm_90 works for CUDA v12.1 and up, due to use of atomic operations cuda_archs = "60;70;80;90" + elseif cuda_ver >= v"12.0" # 12.0 + # sm_52 required for alloca from CUDA v12.0 and up + cuda_archs = "60;70;80" + else # < 12.0 + cuda_archs = "50;60;70;80" end arch_line = "export CUDA_ARCHS=\"$cuda_archs\"\n" platform_script = arch_line * script From 33499da5b2051eb417082b9e1fb58b77504ba85d Mon Sep 17 00:00:00 2001 From: Ludvig af Klinteberg Date: Wed, 25 Feb 2026 16:28:50 +0100 Subject: [PATCH 3/7] Update source version --- C/cufinufft/build_tarballs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C/cufinufft/build_tarballs.jl b/C/cufinufft/build_tarballs.jl index d20879af650..411c4d1e925 100644 --- a/C/cufinufft/build_tarballs.jl +++ b/C/cufinufft/build_tarballs.jl @@ -11,7 +11,7 @@ include(joinpath(@__DIR__, "..", "..", "platforms", "cuda.jl")) # needed for CUDA cuda, and would produce a giant amount of artifacts) name = "cufinufft" version = v"2.4.1" -commit_hash = "7919db50853f9933004d7c61e54b5782f7d8b00e" # current master +commit_hash = "629c76f9ad971302f05317b324fbd8584deca9d1" # master 2025-10-26 preferred_gcc_version=v"11" # Collection of sources required to complete build From ba3da2b69c75a3fdcae9740c045f709de57dfc9b Mon Sep 17 00:00:00 2001 From: Ludvig af Klinteberg Date: Thu, 26 Feb 2026 09:23:17 +0100 Subject: [PATCH 4/7] Building cufinufft v2.5.0-rc1 --- C/cufinufft/build_tarballs.jl | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/C/cufinufft/build_tarballs.jl b/C/cufinufft/build_tarballs.jl index 6b2a9512a11..8dd702a5baf 100644 --- a/C/cufinufft/build_tarballs.jl +++ b/C/cufinufft/build_tarballs.jl @@ -12,8 +12,8 @@ include(joinpath(YGGDRASIL_DIR, "platforms", "cuda.jl")) # Builds for all compatible CUDA platforms, but without microarchitecture expansion (not # needed for CUDA cuda, and would produce a giant amount of artifacts) name = "cufinufft" -version = v"2.4.1" -commit_hash = "629c76f9ad971302f05317b324fbd8584deca9d1" # master 2025-10-26 +version = v"2.5.0" +commit_hash = "15fd54c762c17689da9eb50069f43e367a27c99f" # 2.5.0-rc1 preferred_gcc_version=v"11" # Collection of sources required to complete build @@ -55,18 +55,6 @@ platforms = expand_cxxstring_abis(CUDA.supported_platforms(min_version=v"11.6")) # Cmake toolchain breaks on aarch64, so only x86_64 for now filter!(p -> arch(p)=="x86_64", platforms) -# cuFINUFFT does not compile with CUDA 12.5, so exclude -filter!(p -> VersionNumber(p["cuda"]) != v"12.5", platforms) - -# Build process fails (why??) when specifying minor versions of CUDA 13, so don't -for platform in platforms - cuda_version = VersionNumber(platform["cuda"]) - if cuda_version.major==13 - platform["cuda"] = "13" - end -end -unique!(platforms) # Remove duplicates if there were multiple 13.x - # The products that we will ensure are always built products = [ LibraryProduct("libcufinufft", :libcufinufft) From f6e518de7af04917e699096c410acf8a9d6c52b3 Mon Sep 17 00:00:00 2001 From: Ludvig af Klinteberg Date: Thu, 26 Feb 2026 15:01:08 +0100 Subject: [PATCH 5/7] Update CMake version line --- C/cufinufft/build_tarballs.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C/cufinufft/build_tarballs.jl b/C/cufinufft/build_tarballs.jl index 8dd702a5baf..4a2812ae20b 100644 --- a/C/cufinufft/build_tarballs.jl +++ b/C/cufinufft/build_tarballs.jl @@ -8,9 +8,9 @@ include(joinpath(YGGDRASIL_DIR, "fancy_toys.jl")) include(joinpath(YGGDRASIL_DIR, "platforms", "cuda.jl")) # Build script for the CUDA part of FINUFFT - # Builds for all compatible CUDA platforms, but without microarchitecture expansion (not # needed for CUDA cuda, and would produce a giant amount of artifacts) + name = "cufinufft" version = v"2.5.0" commit_hash = "15fd54c762c17689da9eb50069f43e367a27c99f" # 2.5.0-rc1 @@ -64,7 +64,7 @@ products = [ # NVTX_jll is needed for nvToolsExt. (tested with v3.1.0+2) # CMake needs higher version than what is bundled dependencies = [Dependency("NVTX_jll"), - HostBuildDependency(PackageSpec(; name="CMake_jll", version = v"3.24.3"))] + HostBuildDependency(PackageSpec(; name="CMake_jll", version = v"3.24.3+0"))] for platform in platforms should_build_platform(triplet(platform)) || continue From f442ba7848079d4442383a9563f558c571931d7e Mon Sep 17 00:00:00 2001 From: Ludvig af Klinteberg Date: Thu, 26 Feb 2026 15:29:01 +0100 Subject: [PATCH 6/7] Reduce CUDA 11 builds --- C/cufinufft/build_tarballs.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C/cufinufft/build_tarballs.jl b/C/cufinufft/build_tarballs.jl index 4a2812ae20b..c6c646c2fbc 100644 --- a/C/cufinufft/build_tarballs.jl +++ b/C/cufinufft/build_tarballs.jl @@ -49,8 +49,8 @@ cmake --install . unlink $prefix/cuda/lib64 """ -# Build for all supported CUDA >= v11.6 (highest that builds) -platforms = expand_cxxstring_abis(CUDA.supported_platforms(min_version=v"11.6")) +# Build for all supported CUDA >= v11.8. Only one v11.x shuold be sufficient. +platforms = expand_cxxstring_abis(CUDA.supported_platforms(min_version=v"11.8")) # Cmake toolchain breaks on aarch64, so only x86_64 for now filter!(p -> arch(p)=="x86_64", platforms) From f988e2e30201eefb94b09bf05f2c1e4f12d1b8d3 Mon Sep 17 00:00:00 2001 From: Ludvig af Klinteberg Date: Wed, 4 Mar 2026 08:46:17 +0100 Subject: [PATCH 7/7] release v2.5.0 --- C/cufinufft/build_tarballs.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C/cufinufft/build_tarballs.jl b/C/cufinufft/build_tarballs.jl index c6c646c2fbc..c7438b60a61 100644 --- a/C/cufinufft/build_tarballs.jl +++ b/C/cufinufft/build_tarballs.jl @@ -13,7 +13,7 @@ include(joinpath(YGGDRASIL_DIR, "platforms", "cuda.jl")) name = "cufinufft" version = v"2.5.0" -commit_hash = "15fd54c762c17689da9eb50069f43e367a27c99f" # 2.5.0-rc1 +commit_hash = "8b7ac66e617ea317cd42366ac27c536793131696" preferred_gcc_version=v"11" # Collection of sources required to complete build @@ -49,7 +49,7 @@ cmake --install . unlink $prefix/cuda/lib64 """ -# Build for all supported CUDA >= v11.8. Only one v11.x shuold be sufficient. +# Build for all supported CUDA >= v11.8. Only one v11.x should be sufficient. platforms = expand_cxxstring_abis(CUDA.supported_platforms(min_version=v"11.8")) # Cmake toolchain breaks on aarch64, so only x86_64 for now