Failed to run AmgX example

I download file “2014.01.13_amgx_redhat-6.2_cuda-5.5.tar” and extract it.
Then I put the path to libnvamgsh.so in /etc/ld.so.conf.d directory and edit the cuda path in Make file
to the correct path.
However when I type “make all”, I get stuck.The error says when g++ try to link it seems that it can’t find the library.

gcc -O2 -std=c99 amgx_capi.c -c -I/public/opt/cuda-5.5/include
g++ -O2 amgx_capi.o -o amgx_capi -L/public/opt/cuda-5.5/lib64 -lcudart -ldl -Wl,-rpath=…/lib
amgx_capi.o: In function main': amgx_capi.c:(.text.startup+0x8e): undefined reference to AMGX_initialize’
amgx_capi.c:(.text.startup+0xa0): undefined reference to AMGX_initialize_plugins' amgx_capi.c:(.text.startup+0xb5): undefined reference to AMGX_register_print_callback’
amgx_capi.c:(.text.startup+0xc7): undefined reference to AMGX_install_signal_handler' amgx_capi.c:(.text.startup+0x1f6): undefined reference to AMGX_config_create’

ps
[root@node1 examples]# ldconfig -p|grep nvamg
libnvamgsh.so (libc6,x86-64) => /public/opt/amgx/lib/libnvamgsh.so
[root@node1 examples]# ldd …/lib/libnvamgsh.so
linux-vdso.so.1 => (0x00007fff770db000)
libcudart.so.5.5 => /public/opt/cuda-5.5/lib64/libcudart.so.5.5 (0x00002b247b6f7000)
libcuda.so.1 => /usr/lib64/libcuda.so.1 (0x00002b247b944000)
libdl.so.2 => /lib64/libdl.so.2 (0x00002b247c5a8000)
libcublas.so.5.5 => /public/opt/cuda-5.5/lib64/libcublas.so.5.5 (0x00002b247c7ad000)
libcusparse.so.5.5 => /public/opt/cuda-5.5/lib64/libcusparse.so.5.5 (0x00002b247fc64000)
libstdc++.so.6 => /public/opt/gcc-4.8.2/lib64/libstdc++.so.6 (0x00002b2488657000)
libm.so.6 => /lib64/libm.so.6 (0x00002b2488961000)
libgcc_s.so.1 => /public/opt/gcc-4.8.2/lib64/libgcc_s.so.1 (0x00002b2488be5000)
libc.so.6 => /lib64/libc.so.6 (0x00002b2488dfb000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b2489190000)
librt.so.1 => /lib64/librt.so.1 (0x00002b24893ad000)
libz.so.1 => /lib64/libz.so.1 (0x00002b24895b5000)
/lib64/ld-linux-x86-64.so.2 (0x0000003c18000000)

I really don’t where to go…

I found I can compile amgx_capi_dynamic and nvamg_capi_dynamic.
but still error without define DYNAMIC_LOADING

I would try just the simplest link first, move the nvamgsh.so file to the local directory, see if you can link to it with -Lnvamgsh. Then add the location to the LD_LIBRARY_PATH environment variable and see if that works. This approach of using ls.conf.so.d is not standard, and requires some super-user priviledges for correct use I think. If the library is located in a directory listed in the LD_LIBRARY_PATH variable, it should work. This works for me anyway :)

yeah, that remind me.
I pass -L/path/to/libnvamgsh.so and -lnvamgshto g++ and now it works!
thx!

Downloaded latest AMGX without MPI. It is for CUDA 5.5. But I have CUDA 6.0 installed.
I didn’t find CUDA 5.5 download on NVidia site.
I tried to make AMGX work with 6.0 just renaming dlls (e.g. cudart64_60.dll to cudart64_55.dll). I was able to build and run amgx_capi.exe.

I used matrix file AMGX matrix.mtx from here https://developer.nvidia.com/rdp/assets/amgx-matrixmtx and config file PBICGSTAB from \configs dir. I tried it with such string
amgx_capi.exe -m matrix.mtx -c PBICGSTAB

and got

C:\MyProjects\amgx_test\examples\x64\Release>amgx_capi.exe -m matrix.mtx -c PBICGSTAB
License acquired, proceeding
AMGX version 93-beta
Built on Jan 10 2014, 00:04:47
Compiled with CUDA Runtime 6.0, using CUDA driver 0.0
Converting config string to current config version
Parsing configuration string: exception_handling=1 ;
AMGX ERROR: file C:/work/perforce/nvamg_main/EmergingApplications/Investigations/amg/amg/base/src/amgx_c.cu line 670
AMGX ERROR: Unknown error.

I tried with several config files and with my own MTX matrices with the same error.
Is it CUDA 6.0 problem and I shouls use CUDA 5.5? And where can I get it?

I tried on my Acer V3-571G notebook with NVIDIA GeForce GT 730M, Windows 8.1 64 bit, nvidia driver 335.23

I already run many other CUDA programs with success before …

Thanks in advance.

I found Cuda 5.5 on NVidia archive and gave it a try.
But with the same problem.

C:\MyProjects\amgx_test\examples\x64\Release>1.exe -m matrix.mtx -c PBICGSTAB
License acquired, proceeding
AMGX version 93-beta
Built on Jan 10 2014, 00:04:47
Compiled with CUDA Runtime 5.5, using CUDA driver 0.0
Converting config string to current config version
Parsing configuration string: exception_handling=1 ;
AMGX ERROR: file C:/work/perforce/nvamg_main/EmergingApplications/Investigations/amg/amg/base/src/amgx_c.cu line 670
AMGX ERROR: Unknown error.

The key reason of failure I think is “using CUDA driver 0.0”. AMGX cannot find gpu device.
What can be a reason? Not supported GT730M? Or problem with NVidia Optimus on my notebook?
Is there a tool or option to choose GPU on startup?

Hi rednoW, looks like the “–mode” is a required argument for current version.

I could reproduce this error when running AmgX examples - “amgx_capi.exe” with arguments “-m matrix.mtx -c PBICGSTAB”. However, it works after added “-mode dDDI” or “-mode dDFI” arguments.

Attaching my results for your reference, could you please verify it again with added “-mode” argument?


D:\amgx\2014.01.09_amgx_win64_cuda-5.5\examples\x64\Release>amgx_capi.exe -m matrix.mtx -c PBICGSTAB
License acquired, proceeding
AMGX version 93-beta
Built on Jan 10 2014, 00:04:47
Compiled with CUDA Runtime 5.5, using CUDA driver 5.5
Converting config string to current config version
Parsing configuration string: exception_handling=1 ;
AMGX ERROR: file C:/work/perforce/nvamg_main/EmergingApplications/Investigations/amg/amg/base/src/amgx_c.cu line 670
AMGX ERROR: Unknown error.


D:\amgx\2014.01.09_amgx_win64_cuda-5.5\examples\x64\Release>amgx_capi.exe -mode dDDI -m matrix.mtx -c PBICGSTAB
License acquired, proceeding
AMGX version 93-beta
Built on Jan 10 2014, 00:04:47
Compiled with CUDA Runtime 5.5, using CUDA driver 5.5
Converting config string to current config version
Parsing configuration string: exception_handling=1 ;
Reading data…
RHS vector was not found. Using RHS b=[1,G仟,1]^T
Solution vector was not found. Setting initial solution to x=[0,G仟,0]^T
Finished reading
iter Mem Usage (GB) residual rate
--------------------------------------------------------------
Ini 0.394283 3.464102e+000
Relative residual has reached machine precision
0 0.394283 2.042810e-014 0.0000
--------------------------------------------------------------
Total Iterations: 1
Avg Convergence Rate: 0.0000
Final Residual: 2.042810e-014
Total Reduction in Residual: 5.897086e-015
Maximum Memory Usage: 0.394 GB
--------------------------------------------------------------
Total Time: 0.0133002
setup: 0.00090288 s
solve: 0.0123973 s
solve(per iteration): 0.0123973 s