Building MAGMA with Intel oneAPI

88 views
Skip to first unread message

Zgjim Rrustemi

unread,
Sep 2, 2024, 10:19:03 AM9/2/24
to MAGMA User

Hello everyone,

I hope you're all doing well. I'm reaching out because I've encountered some difficulties while trying to build MAGMA with Intel oneAPI 2024.2.1.

As some of you might know, the older (classic) Intel compilers, namely, icc, icpc, and ifort have been deprecated in this release, and are now replaced by the newer compilers: icx, icpx, and ifx. While I understand the benefits of transitioning to these new compilers, I’m encountering issues getting MAGMA to compile correctly with them.

Additionally, I need GPU support for my setup, which includes two Pascal NVIDIA GPUs. This adds another layer of complexity, and I'm wondering if anyone has had success building MAGMA with GPU support using these new Intel compilers. If so, I'd greatly appreciate any advice or solutions you could share.

Alternatively, do you think it might be better to revert to an older version of Intel oneAPI where the classic compilers are still available?

Thanks in advance for your help!

Ahmad Abdelfattah

unread,
Sep 2, 2024, 10:23:28 AM9/2/24
to Zgjim Rrustemi, MAGMA User
Could you please provide more details about the issues/errors you’ve encountered? We have built MAGMA successfully  before using the new intel compilers. 

There should be no added complexity for the Pascal GPUs either. As long as nvcc supports the architecture, magma should build fine. The number of GPUs does not matter during the build process. 

Thanks,
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/42b2604a-4e4f-427a-af4e-bcd63c9e3559n%40icl.utk.edu.

Ahmad Abdelfattah

unread,
Sep 2, 2024, 1:48:41 PM9/2/24
to Zgjim Rrustemi, MAGMA User
Hello Zgjim, 

We have recently moved to GitHub (https://github.com/icl-utk-edu/magma), and the bitbucket repo will soon be deleted. Sorry about the confusion. 

I have not tried cmake with the new Intel compilers, so I can check that. Meanwhile, you can also do the following from the magma home directory:
  • cp make.inc-examples/make.inc.mkl-icc make.inc
  • Edit the make.inc file to set CC  = icx, CXX  = icpx, and FORT  = ifx
  • Also set GPU_TARGET=Pascal
  • make -j <N> 

As long as you have the environment variable MKLROOT defined properly, the above steps should work fine. 

Hope this helps,
Ahmad


On Sep 2, 2024, at 1:37 PM, Zgjim Rrustemi <zgj...@gmail.com> wrote:

Hello Ahmad,

I cloned magma from bitbucket with git, I'm using CUDA 12.6 with Intel oneAPI 2024.2.1 with the newest NVIDIA drivers (560) on Ubuntu 22.04.4 LTS. NVCC is also built with CUDA 12.6.

As per the instructions on the README file I have firstly created a minimal make.inc configuration with `echo -e 'BACKEND = cuda\nFORT = true\nGPU_TARGET = Pascal' > make.inc`.
After some small changes to the codegen.py (making it use a compatible Python 2 version), I have created CMake.src.cuda without any errors or warnings. I then created the build directory,
I initialized Intel oneAPI environment and passed the following variables to the terminal:

export CXX=icpx
export CC=icx
export FC=ifx
export CUDAHOSTCXX=icpx

where I used cmake with the following options: `cmake -DCMAKE_CUDA_COMPILER:PATH=/usr/local/cuda-12.6/bin/nvcc -DCMAKE_CUDA_FLAGS="-std=c++17 -allow-unsupported-compiler" -DMAGMA_ENABLE_CUDA=ON -DCMAKE_INSTALL_PREFIX=/home/srv/magma_intel -DGPU_TARGET='sm_61' -DBLA_VENDOR=Intel10_64ilp -DBUILD_SHARED_LIBS=ON -DUSE_FORTRAN=ON -DFORTRAN_CONVENTION=-DADD_ ..`

CMake only warned me that the manually specified variables (CMAKE_CUDA_COMPILER and CMAKE_CUDA_FLAGS) were not used.
When I tried to use make with `make -j64`, I started getting a lot of errors such as: `unsupported Intel ICX compiler! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.`.
Other errors were very similar, as it only complained about ICX and clang.

I would be glad if you could guide me and point any errors made by my side.

All the best,
Zgjim

Zgjim Rrustemi

unread,
Sep 3, 2024, 9:12:42 AM9/3/24
to MAGMA User, ah...@icl.utk.edu, MAGMA User, Zgjim Rrustemi
Hi Ahmad,

I tried to clone MAGMA from github this time, and I followed your instructions, MAGMA builds correctly and I can even install it with make install.
However when running cmake without exporting the variables to the terminal ( export CXX=icpx, export CC=icx, export FC=ifx) the build defaults to the GNU compilers, even if they're stated as Intel compilers on the make.inc file.

(The MKLROOT and CUDADIR are set correctly as far as I can tell.)

So I made two builds, one with GNU and one with Intel, unfortunately when I try to run the tests with ./run_tests.py --lu --precision s --small > lu.txt, everything fails, exit with signal 11. In both cases I'm still having issues.

Previously I have managed to build MAGMA and most tests worked, I tried to change the CUDA host to icpx and after some trial and error I followed some instructions from here, and I was able to successfully build MAGMA.
The author found a nvcc bug, that could be alleviated by adding 
-std=c++17 and -allow-unsupported-compiler to the CUDA (NVCC) flags, however I was having trouble on generating a FORTRAN wrapper with fortran_wrappers.pl from the tools directory with that build.
And as a result I could not implement the library within my FORTRAN code.

Hopefully you can give me some insight on how to proceed, thank you for your time!

All the best,
Zgjim

Zgjim Rrustemi

unread,
Sep 3, 2024, 9:12:47 AM9/3/24
to MAGMA User, ah...@icl.utk.edu, MAGMA User, Zgjim Rrustemi
Hello Ahmad,

I cloned magma from bitbucket with git, I'm using CUDA 12.6 with Intel oneAPI 2024.2.1 with the newest NVIDIA drivers (560) on Ubuntu 22.04.4 LTS. NVCC is also built with CUDA 12.6.

As per the instructions on the README file I have firstly created a minimal make.inc configuration with `echo -e 'BACKEND = cuda\nFORT = true\nGPU_TARGET = Pascal' > make.inc`.
After some small changes to the codegen.py (making it use a compatible Python 2 version), I have created CMake.src.cuda without any errors or warnings. I then created the build directory,
I initialized Intel oneAPI environment and passed the following variables to the terminal:

export CXX=icpx
export CC=icx
export FC=ifx
export CUDAHOSTCXX=icpx

where I used cmake with the following options: `cmake -DCMAKE_CUDA_COMPILER:PATH=/usr/local/cuda-12.6/bin/nvcc -DCMAKE_CUDA_FLAGS="-std=c++17 -allow-unsupported-compiler" -DMAGMA_ENABLE_CUDA=ON -DCMAKE_INSTALL_PREFIX=/home/srv/magma_intel -DGPU_TARGET='sm_61' -DBLA_VENDOR=Intel10_64ilp -DBUILD_SHARED_LIBS=ON -DUSE_FORTRAN=ON -DFORTRAN_CONVENTION=-DADD_ ..`

CMake only warned me that the manually specified variables (CMAKE_CUDA_COMPILER and CMAKE_CUDA_FLAGS) were not used.
When I tried to use make with `make -j64`, I started getting a lot of errors such as: `unsupported Intel ICX compiler! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.`.
Other errors were very similar, as it only complained about ICX and clang.

I would be glad if you could guide me and point any errors made by my side.

All the best,
Zgjim
On Monday, September 2, 2024 at 4:23:28 PM UTC+2 ah...@icl.utk.edu wrote:
Reply all
Reply to author
Forward
0 new messages