diff --git a/magma-2.7.1-cuda13-clockrate.patch b/magma-2.7.1-cuda13-clockrate.patch new file mode 100644 index 0000000000000000000000000000000000000000..798d6dc56b8545a020eacd661a7bfcc4a012a50b --- /dev/null +++ b/magma-2.7.1-cuda13-clockrate.patch @@ -0,0 +1,33 @@ +From 235aefb7b064954fce09d035c69907ba8a87cbcd Mon Sep 17 00:00:00 2001 +From: Ahmad Abdelfattah +Date: Fri, 22 Aug 2025 11:56:30 -0400 +Subject: [PATCH] fix compilation issue with cuda 13 + +--- + interface_cuda/interface.cpp | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/interface_cuda/interface.cpp b/interface_cuda/interface.cpp +index c3ae4e0eb..9c8e6c67f 100644 +--- a/interface_cuda/interface.cpp ++++ b/interface_cuda/interface.cpp +@@ -391,10 +391,18 @@ magma_print_environment() + check_error( err ); + + #ifdef MAGMA_HAVE_CUDA ++ ++ int clock_khz; ++ #if CUDA_VERSION >= 13000 ++ cudaDeviceGetAttribute (&clock_khz, cudaDevAttrClockRate, dev); ++ #else ++ clock_khz = prop.clockRate; ++ #endif ++ + printf( "%% device %d: %s, %.1f MHz clock, %.1f MiB memory, capability %d.%d\n", + dev, + prop.name, +- prop.clockRate / 1000., ++ clock_khz / 1000., + prop.totalGlobalMem / (1024.*1024.), + prop.major, + prop.minor ); diff --git a/magma27.spec b/magma27.spec index 2035aac3547c9b65d6a795439c9f5f6932f35349..db38be93a40eb89042e501497599af13e052eab7 100644 --- a/magma27.spec +++ b/magma27.spec @@ -1,6 +1,6 @@ Name: magma27 Version: 2.7.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Matrix Algebra on GPU and Multicore Architectures (make.inc build) ExcludeArch: loongarch64 aarch64 @@ -16,11 +16,16 @@ URL: https://github.com/icl-utk-edu/magma Source0: https://github.com/icl-utk-edu/magma/archive/refs/tags/v%{version}.tar.gz Source1: make.inc.openblas +# Upstream fix for CUDA 13 compatibility: +# cudaDeviceProp::clockRate was removed in CUDA 13; use cudaDeviceGetAttribute(cudaDevAttrClockRate) instead. +# https://github.com/icl-utk-edu/magma/commit/235aefb7b064954fce09d035c69907ba8a87cbcd +Patch0: magma-2.7.1-cuda13-clockrate.patch + BuildRequires: gcc-c++ BuildRequires: gcc-gfortran BuildRequires: make BuildRequires: openblas-devel -BuildRequires: cuda-devel-12-0 +BuildRequires: cuda-devel-13-0 BuildRequires: python3-devel python-unversioned-command %description @@ -54,6 +59,7 @@ including header files, examples, and configuration files. %prep %setup -q -n magma-%{version} +%patch -P 0 -p1 %build cp %{SOURCE1} make.inc @@ -98,5 +104,9 @@ cp README ReleaseNotes COPYRIGHT %{buildroot}%{_docdir}/magma/ %{_docdir}/magma %changelog +* Thu May 14 2026 Xinlong Chen - 2.7.1-2 +- [Type] other +- [DESC] rebuild with cuda-13.0 and add Hopper/Ada support + * Thu Nov 13 2025 Doris Chao - 2.7.1-1 - Init diff --git a/make.inc.openblas b/make.inc.openblas index 41deb4c5ce8881ec1f796716739186f1fdb1805b..ed154a22ce8cc401c4510f132e8e36128dfe6e81 100644 --- a/make.inc.openblas +++ b/make.inc.openblas @@ -13,12 +13,14 @@ ARCH = ar ARCHFLAGS = cr RANLIB = ranlib -GPU_TARGET = Volta Turing Ampere +# CUDA 13 dropped support for Maxwell/Pascal/Volta. Minimum supported arch is Turing (sm_75). +# magma 2.7.1 Makefile does not recognize the "Ada" keyword, so use sm_89 directly for RTX 4090. +GPU_TARGET = Turing Ampere Hopper sm_89 FPIC = -fPIC CFLAGS = -O3 $(FPIC) -DNDEBUG -DADD_ -Wall -fopenmp -std=c99 -CXXFLAGS = -O3 $(FPIC) -DNDEBUG -DADD_ -Wall -fopenmp -std=c++14 +CXXFLAGS = -O3 $(FPIC) -DNDEBUG -DADD_ -Wall -fopenmp -std=c++17 FFLAGS = -O3 $(FPIC) -DNDEBUG -DADD_ -Wall -Wno-unused-dummy-argument F90FLAGS = -O3 $(FPIC) -DNDEBUG -DADD_ -Wall -Wno-unused-dummy-argument -x f95-cpp-input LDFLAGS = $(FPIC) -fopenmp @@ -31,4 +33,4 @@ INC = -I$(CUDADIR)/include LIBDIR += -L$(CUDADIR)/lib64 LIB += -lcublas -lcusparse -lcudart -lcudadevrt -DEVCCFLAGS += -Xcompiler "$(FPIC)" -std=c++11 \ No newline at end of file +DEVCCFLAGS += -Xcompiler "$(FPIC)" -std=c++17 \ No newline at end of file