Problem when building MAGMA with ./tools/codegen.py

31 views
Skip to first unread message

黄一旻

unread,
Oct 13, 2024, 3:08:18 PM10/13/24
to MAGMA User
Hi all, 

I attempt to build the magma in an conda environment. Everything is fine when i start make command. However, at the end of make , it return this error: 

/data/home/yimin2/conda_magma/bin/x86_64-conda-linux-gnu-c++ -fPIC                       -fopenmp -Wl,-rpath,/data/home/yimin2/conda_magma/magma/lib \
-o testing/testing_zaxpy testing/testing_zaxpy.o \
-L./testing -ltest \
-L./lib -lmagma \
-L./testing/lin -llapacktest \
-L/data/home/yimin2/conda_magma/lib -L/usr/local/cuda/lib64 -lopenblas -lcublas -lcusparse -lcudart -lcudadevrt -lcublas -lcudart
/data/home/yimin2/conda_magma/bin/../lib/gcc/x86_64-conda-linux-gnu/14.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: ./lib/libmagma.so: undefined reference to `cudaGetDeviceProperties_v2'
collect2: error: ld returned 1 exit status
make: *** [Makefile:954: testing/testing_zaxpy] Error 1


 I can't confirm what caused this error, Chat-gpt told me maybe it's because version of  cuda. My cuda version 12.4, does magma can't match this version? If it can, how can i fix my error?

Mark Gates

unread,
Oct 13, 2024, 3:49:57 PM10/13/24
to 黄一旻, MAGMA User
It's hard to know without seeing more of your compilation and your make.inc file. The error suggests that the CUDA version for the headers was >= 12.0, when cudaGetDeviceProperties_v2 was defined, but the CUDA library being linked is < 12.0. You can check what symbols are provided by the CUDA library and what symbol is expected by the MAGMA library, e.g.:

methane> module swap cuda cuda/12.0.0
methane> cd $CUDADIR/lib64
methane> pwd
/.../cuda-12.0.0-.../lib64
methane> nm -gD libcudart.so  | grep cudaGetDeviceProp
000000000006f2d0 T cudaGetDeviceProperties@@libcudart.so.12
0000000000049970 T cudaGetDeviceProperties_v2@@libcudart.so.12

methane> module swap cuda cuda/11.8.0
methane> cd $CUDADIR/lib64
methane> pwd
/.../cuda-11.8.0-.../lib64
methane> nm -gD libcudart.so  | grep cudaGetDeviceProp
0000000000049390 T cudaGetDeviceProperties@@libcudart.so.11.0

methane> cd ~/magma/lib/
methane> nm -gD libmagma.so  | grep cudaGetDeviceProp
                 U cudaGetDeviceProperties@libcudart.so.11.0

Obviously in this case, MAGMA was compiled with CUDA 11 instead of CUDA 12.

Mark

Reply all
Reply to author
Forward
0 new messages