Date: Thursday, October 1, 2020 @ 21:54:02 Author: kgizdov Revision: 714404
upgpkg: magma 2.5.3-4: cuda 11.1 rebuild Added: magma/trunk/cuda11.1.patch Modified: magma/trunk/PKGBUILD Deleted: magma/trunk/cuda11.patch ----------------+ PKGBUILD | 22 +++++++------- cuda11.1.patch | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ cuda11.patch | 57 ------------------------------------- 3 files changed, 95 insertions(+), 68 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2020-10-01 21:53:53 UTC (rev 714403) +++ PKGBUILD 2020-10-01 21:54:02 UTC (rev 714404) @@ -5,25 +5,25 @@ pkgname=magma pkgver=2.5.3 -pkgrel=3 +pkgrel=4 pkgdesc="Matrix Algebra on GPU and Multicore Architectures" arch=('x86_64') url="https://icl.cs.utk.edu/magma/" license=('custom') -depends=('blas' 'gcc9' 'lapack' 'cuda') -makedepends=('gcc9-fortran' 'cmake' 'ninja') +depends=('blas' 'lapack' 'cuda') +makedepends=('gcc-fortran' 'cmake' 'ninja') optdepends=('python: for examples and tests' - 'gcc9-fortran: Fortran interface') + 'gcc-fortran: Fortran interface') source=("${pkgname}-${pkgver}.tar.gz::http://icl.cs.utk.edu/projectsfiles/${pkgname}/downloads/${pkgname}-${pkgver}.tar.gz" - 'cuda11.patch' + 'cuda11.1.patch' 'disable_magma_sparse.patch') sha256sums=('c602d269a9f9a3df28f6a4f593be819abb12ed3fa413bba1ff8183de721c5ef6' - '7a32d8de6fa845131eed3f7345baeb1531ef1d3cfa7e565b258e4cfbbaa66a5c' + '4d6e7e844a5aa5a771480a1fa61daaf85981f52d852ee444d7ffda63ac9a2db2' '259c38004b26395278cdaf431591974e0589dedc0f8bfc14413f854c2a10424f') prepare() { cd ${pkgname}-${pkgver} - patch -Np1 -i "${srcdir}/cuda11.patch" + patch -Np1 -i "${srcdir}/cuda11.1.patch" # Temporarily disable magma-sparse until it's fixed by magma upstream: # https://bugs.archlinux.org/task/67094 @@ -33,9 +33,9 @@ build() { cd ${pkgname}-${pkgver} - CC=gcc-9 \ - CXX=g++-9 \ - FC=gfortran-9 \ + CC=/usr/bin/gcc \ + CXX=/usr/bin/g++ \ + FC=/usr/bin/gfortran \ cmake \ -Bbuild \ -GNinja \ @@ -42,7 +42,7 @@ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr \ -DBUILD_SHARED_LIBS=ON \ - -DGPU_TARGET="sm_53 sm_60 sm_61 sm_62 sm_70 sm_72 sm_75 sm_80" + -DGPU_TARGET="sm_52 sm_53 sm_60 sm_61 sm_62 sm_70 sm_72 sm_75 sm_80 sm_86" ninja -C build } Added: cuda11.1.patch =================================================================== --- cuda11.1.patch (rev 0) +++ cuda11.1.patch 2020-10-01 21:54:02 UTC (rev 714404) @@ -0,0 +1,84 @@ +diff -aur --color magma-2.5.3-old/CMakeLists.txt magma-2.5.3-new/CMakeLists.txt +--- magma-2.5.3-old/CMakeLists.txt 2020-10-01 23:41:29.087168262 +0300 ++++ magma-2.5.3-new/CMakeLists.txt 2020-10-01 23:46:00.735320487 +0300 +@@ -101,7 +101,7 @@ + + # ---------------------------------------- + # locate CUDA libraries +-set( GPU_TARGET "Kepler Maxwell Pascal" CACHE STRING "CUDA architectures to compile for; one or more of Fermi, Kepler, Maxwell, Pascal, Volta, or valid sm_[0-9][0-9]" ) ++set( GPU_TARGET "Kepler Maxwell Pascal" CACHE STRING "CUDA architectures to compile for; one or more of Fermi, Kepler, Maxwell, Pascal, Volta, Turing, Ampere or valid sm_[0-9][0-9]" ) + find_package( CUDA ) + if (CUDA_FOUND) + message( STATUS "Found CUDA ${CUDA_VERSION}" ) +@@ -136,21 +136,25 @@ + endif() + + if (${GPU_TARGET} MATCHES Maxwell) +- set( GPU_TARGET "${GPU_TARGET} sm_50" ) ++ set( GPU_TARGET "${GPU_TARGET} sm_50 sm_52 sm_53" ) + endif() + + if (${GPU_TARGET} MATCHES Pascal) +- set( GPU_TARGET "${GPU_TARGET} sm_60" ) ++ set( GPU_TARGET "${GPU_TARGET} sm_60 sm_61 sm_62" ) + endif() + + if (${GPU_TARGET} MATCHES Volta) +- set( GPU_TARGET "${GPU_TARGET} sm_70" ) ++ set( GPU_TARGET "${GPU_TARGET} sm_70 sm_72" ) + endif() + + if (${GPU_TARGET} MATCHES Turing) + set( GPU_TARGET "${GPU_TARGET} sm_75" ) + endif() + ++ if (${GPU_TARGET} MATCHES Ampere) ++ set( GPU_TARGET "${GPU_TARGET} sm_80 sm_86" ) ++ endif() ++ + if (${GPU_TARGET} MATCHES sm_20) + if (NOT MIN_ARCH) + set( MIN_ARCH 200 ) +@@ -259,8 +263,26 @@ + message( STATUS " compile for CUDA arch 7.5 (Turing)" ) + endif() + ++ if (${GPU_TARGET} MATCHES sm_80) ++ if (NOT MIN_ARCH) ++ set( MIN_ARCH 800 ) ++ endif() ++ set( NV_SM ${NV_SM} -gencode arch=compute_80,code=sm_80 ) ++ set( NV_COMP -gencode arch=compute_80,code=compute_80 ) ++ message( STATUS " compile for CUDA arch 8.0 (Ampere)" ) ++ endif() ++ ++ if (${GPU_TARGET} MATCHES sm_86) ++ if (NOT MIN_ARCH) ++ set( MIN_ARCH 860 ) ++ endif() ++ set( NV_SM ${NV_SM} -gencode arch=compute_86,code=sm_86 ) ++ set( NV_COMP -gencode arch=compute_86,code=compute_86 ) ++ message( STATUS " compile for CUDA arch 8.6 (Ampere)" ) ++ endif() ++ + if (NOT MIN_ARCH) +- message( FATAL_ERROR "GPU_TARGET must contain one or more of Fermi, Kepler, Maxwell, Pascal, Volta, Turing, or valid sm_[0-9][0-9]" ) ++ message( FATAL_ERROR "GPU_TARGET must contain one or more of Fermi, Kepler, Maxwell, Pascal, Volta, Turing, Ampere or valid sm_[0-9][0-9]" ) + endif() + + set( CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -Xcompiler -fPIC -DHAVE_CUBLAS ${NV_SM} ${NV_COMP} ${FORTRAN_CONVENTION} ) +diff -aur --color magma-2.5.3-old/interface_cuda/interface.cpp magma-2.5.3-new/interface_cuda/interface.cpp +--- magma-2.5.3-old/interface_cuda/interface.cpp 2020-03-30 03:48:24.000000000 +0300 ++++ magma-2.5.3-new/interface_cuda/interface.cpp 2020-06-22 15:48:15.192500739 +0300 +@@ -458,7 +458,11 @@ + err = cudaPointerGetAttributes( &attr, const_cast<void*>( A )); + if ( ! err ) { + // definitely know type ++#if (CUDA_VERSION >= 10000) ++ return (attr.type == cudaMemoryTypeDevice); ++#else + return (attr.memoryType == cudaMemoryTypeDevice); ++#endif + } + else if ( err == cudaErrorInvalidValue ) { + // clear error; see http://icl.cs.utk.edu/magma/forum/viewtopic.php?f=2&t=529 Deleted: cuda11.patch =================================================================== --- cuda11.patch 2020-10-01 21:53:53 UTC (rev 714403) +++ cuda11.patch 2020-10-01 21:54:02 UTC (rev 714404) @@ -1,57 +0,0 @@ -diff -aur --color magma-2.5.3-old/CMakeLists.txt magma-2.5.3-new/CMakeLists.txt ---- magma-2.5.3-old/CMakeLists.txt 2020-06-22 16:18:13.789152294 +0300 -+++ magma-2.5.3-new/CMakeLists.txt 2020-06-22 17:00:01.365798021 +0300 -@@ -101,7 +101,7 @@ - - # ---------------------------------------- - # locate CUDA libraries --set( GPU_TARGET "Kepler Maxwell Pascal" CACHE STRING "CUDA architectures to compile for; one or more of Fermi, Kepler, Maxwell, Pascal, Volta, or valid sm_[0-9][0-9]" ) -+set( GPU_TARGET "Kepler Maxwell Pascal" CACHE STRING "CUDA architectures to compile for; one or more of Fermi, Kepler, Maxwell, Pascal, Volta, Turing, Ampere or valid sm_[0-9][0-9]" ) - find_package( CUDA ) - if (CUDA_FOUND) - message( STATUS "Found CUDA ${CUDA_VERSION}" ) -@@ -151,6 +151,10 @@ - set( GPU_TARGET "${GPU_TARGET} sm_75" ) - endif() - -+ if (${GPU_TARGET} MATCHES Ampere) -+ set( GPU_TARGET "${GPU_TARGET} sm_80" ) -+ endif() -+ - if (${GPU_TARGET} MATCHES sm_20) - if (NOT MIN_ARCH) - set( MIN_ARCH 200 ) -@@ -259,8 +263,17 @@ - message( STATUS " compile for CUDA arch 7.5 (Turing)" ) - endif() - -+ if (${GPU_TARGET} MATCHES sm_80) -+ if (NOT MIN_ARCH) -+ set( MIN_ARCH 800 ) -+ endif() -+ set( NV_SM ${NV_SM} -gencode arch=compute_80,code=sm_80 ) -+ set( NV_COMP -gencode arch=compute_80,code=compute_80 ) -+ message( STATUS " compile for CUDA arch 8.0 (Ampere)" ) -+ endif() -+ - if (NOT MIN_ARCH) -- message( FATAL_ERROR "GPU_TARGET must contain one or more of Fermi, Kepler, Maxwell, Pascal, Volta, Turing, or valid sm_[0-9][0-9]" ) -+ message( FATAL_ERROR "GPU_TARGET must contain one or more of Fermi, Kepler, Maxwell, Pascal, Volta, Turing, Ampere or valid sm_[0-9][0-9]" ) - endif() - - set( CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -Xcompiler -fPIC -DHAVE_CUBLAS ${NV_SM} ${NV_COMP} ${FORTRAN_CONVENTION} ) -diff -aur --color magma-2.5.3-old/interface_cuda/interface.cpp magma-2.5.3-new/interface_cuda/interface.cpp ---- magma-2.5.3-old/interface_cuda/interface.cpp 2020-03-30 03:48:24.000000000 +0300 -+++ magma-2.5.3-new/interface_cuda/interface.cpp 2020-06-22 15:48:15.192500739 +0300 -@@ -458,7 +458,11 @@ - err = cudaPointerGetAttributes( &attr, const_cast<void*>( A )); - if ( ! err ) { - // definitely know type -+#if (CUDA_VERSION >= 10000) -+ return (attr.type == cudaMemoryTypeDevice); -+#else - return (attr.memoryType == cudaMemoryTypeDevice); -+#endif - } - else if ( err == cudaErrorInvalidValue ) { - // clear error; see http://icl.cs.utk.edu/magma/forum/viewtopic.php?f=2&t=529