MAGMA build fails using CUDA toolkit 12.6 Update 2

124 views
Skip to first unread message

Danesh Daroui

unread,
Oct 7, 2024, 2:27:51 PM10/7/24
to MAGMA User
Hi all,

I have recently tried to build MAGMA on a Fedora 39 machine equipped with Nvidia Ada GPU. I have updated make.in to use Intel compiler and added code to the make scripts to build the libraries for Ada. The build used to be done successfully before, but the problem happened when I updated CUDA toolkit to the latest version. The error I get when I build MAGMA is:

nvcc -O3                  -DNDEBUG -DADD_ -Xcompiler "-fPIC -Wall -Wno-unused-function -fopenmp" -std=c++11 -DMKL_ILP64 -gencode arch=compute_89,code=sm_89 -gencode arch=compute_89,code=compute_89 -I/usr/local/cuda/include -I/opt/intel/oneapi/mkl/2024.2/include -I./include -I./testing -I./control  -c -o magmablas/zgbtf2_kernels.o magmablas/zgbtf2_kernels.cu
In file included from /usr/include/c++/13/string:51,
                 from /usr/include/c++/13/bits/locale_classes.h:40,
                 from /usr/include/c++/13/bits/ios_base.h:41,
                 from /usr/include/c++/13/streambuf:43,
                 from /usr/include/c++/13/bits/streambuf_iterator.h:35,
                 from /usr/include/c++/13/iterator:66,
                 from /usr/local/cuda/include/cuda/std/__iterator/iterator_traits.h:46,
                 from /usr/local/cuda/include/cuda/std/__iterator/iter_move.h:25,
                 from /usr/local/cuda/include/cuda/std/__iterator/concepts.h:41,
                 from /usr/local/cuda/include/cuda/std/__fwd/subrange.h:23,
                 from /usr/local/cuda/include/cuda/std/__fwd/get.h:26,
                 from /usr/local/cuda/include/cuda/std/__utility/pair.h:29,
                 from /usr/local/cuda/include/cuda/std/__functional/hash.h:35,
                 from /usr/local/cuda/include/cuda/std/detail/libcxx/include/__threading_support:23,
                 from /usr/local/cuda/include/cuda/std/__atomic/wait/polling.h:27,
                 from /usr/local/cuda/include/cuda/std/atomic:41,
                 from /usr/local/cuda/include/cuda/std/__cuda/atomic.h:24,
                 from /usr/local/cuda/include/cuda/atomic:14,
                 from /usr/local/cuda/include/cooperative_groups.h:61,
                 from magmablas/zgbtf2_kernels.cu:15:
/usr/include/c++/13/bits/stl_algobase.h:281:56: error: macro "min" passed 3 arguments, but takes just 2
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |                                                        ^
In file included from magmablas/zgbtf2_kernels.cu:13:
./control/magma_internal.h:247: note: macro "min" defined here
  247 | #define min(a, b) ((a) < (b) ? (a) : (b))
      |
/usr/include/c++/13/bits/stl_algobase.h:303:56: error: macro "max" passed 3 arguments, but takes just 2
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |                                                        ^
./control/magma_internal.h:243: note: macro "max" defined here
  243 | #define max(a, b) ((a) > (b) ? (a) : (b))
      |
In file included from /usr/include/c++/13/bits/chrono.h:39,
                 from /usr/include/c++/13/chrono:41,
                 from /usr/local/cuda/include/cuda/std/detail/libcxx/include/chrono:838,
                 from /usr/local/cuda/include/cuda/std/chrono:26,
                 from /usr/local/cuda/include/cuda/std/detail/libcxx/include/__threading_support:24:
/usr/include/c++/13/limits:317:11: error: macro "min" requires 2 arguments, but only 1 given
  317 |       min() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
      |           ^
./control/magma_internal.h:247: note: macro "min" defined here
  247 | #define min(a, b) ((a) < (b) ? (a) : (b))
      |
/usr/include/c++/13/limits:321:11: error: macro "max" requires 2 arguments, but only 1 given
  321 |       max() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
      |           ^
./control/magma_internal.h:243: note: macro "max" defined here
  243 | #define max(a, b) ((a) > (b) ? (a) : (b))


The error is repeated many times and apparently when "min" and "max" macros are called. I tried to rename the macros in MAGMA internal to "_min" and "_max" to fix the conflict and it seemed to work, but there are many places in the code and I will face problems when I update MAGMA in the future. Is there any fix for it or am I doing something wrong?

Regards,

Danesh


Ahmad Abdelfattah

unread,
Oct 7, 2024, 2:37:49 PM10/7/24
to Danesh Daroui, MAGMA User
Hi Danesh, 

Did you clone a fresh copy from GitHub? This should have been addressed already, but it is not part of an official release yet. 

Ahmad


--
You received this message because you are subscribed to the Google Groups "MAGMA User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to magma-user+...@icl.utk.edu.
To view this discussion on the web visit https://groups.google.com/a/icl.utk.edu/d/msgid/magma-user/352bf717-99d4-4fcf-b711-829ef41c000dn%40icl.utk.edu.

Danesh Daroui

unread,
Oct 7, 2024, 5:01:52 PM10/7/24
to Ahmad Abdelfattah, MAGMA User
Hi Ahmed,
Thanks for your help. I cloned MAGMA from github and the problem is gone.
Regards,
Danesh

Reply all
Reply to author
Forward
0 new messages