amgX

Hello!

I have been trying out the amgX library. However, if I stick to the examples from the manual, I cannot compile my test program. Your example shows to include the ‘amgx_c.h’ header file, which is not included in the tar ball.

When compiling your examples with the supplied Makefile, compilation works fine, however, if I want to execute the example, it will print an error that the library file is not found, no matter if I put the library argument or not.

Any suggestions?
Thanks!
Nico

Sounds like you have an earlier version of the download, you are right the amgx_c.h header was missing. We have added this in the update, you can grab the latest from http://developer.nvidia.com/amgx

If you are using Linux, you should add the path to libnvamgsh.so to your LD_LIBRARY_PATH environment variable, this will tell the system were to find it at runtime. If you plan on using AmgX repeatedly, I recommend you add a line like
“export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:path_to_amgx_lib” to your .profile so it will be automatically set up for you when you login.

Please use header file ‘amgx_capi.h’ instead of ‘amgx_c.h’. You can take advantage of the provided examples to see how to use it in more detail.

Also, please setup the environment variable LM_LICENSE_FILE to point to the license file amgx_trial.lic you should have downloaded together with the build package. This is required for the library to work.

The amgx_c.h is still not in the package.

I did that. However, no matter what I do, I get the error message ‘Cannot load nvamg library’ (path to the library is 100% correct).

To go further, can you give us some idea of your environment and Cuda version? What OS are you using, and which example are you working with to get started? If you paste the example code and your environment variables we can help get them right. We have tested this extensively and we don’t think there is a problem with the library itself, but you may have found something we don’t know about yet. :)

I am using Scientific Linux 6.3 with CUDA 5.0 and K20 attached to the system. I simply try to run the provided example file. Environment variables are set.
declare -x LM_LICENSE_FILE="/home/nico/work/amgx/amgx_trial.lic"
declare -x LD_LIBRARY_PATH="/home/nico/work/amgx/lib:/usr/local/cuda/lib64:/usr/lib64/openmpi/lib"

I can compile it using the Makefile, however, when I execute it by
“~/work/amgx/examples$ ./amgx_capi_dynamic -l …/lib/ -help”
it prints me the message “Cannot load nvamg library”.

To be more precise:


nico:~/work/amgx$ ll
total 24
drwxr-xr-x 5 nico nico 4096 Dez 9 10:18 ./
drwxr-xr-x 34 nico nico 4096 Dez 9 09:20 …/
-rw-r–r-- 1 nico nico 225 Dez 9 09:20 amgx_trial.lic
drwxr-xr-x 2 nico nico 4096 Nov 26 00:35 configs/
drwxr-xr-x 2 nico nico 4096 Nov 26 19:10 examples/
drwxr-xr-x 2 nico nico 4096 Nov 26 00:30 lib/
nico:~/work/amgx$ export LM_LICENSE_FILE=/home/nico/work/amgx/amgx_trial.lic
nico:~/work/amgx$ export LD_LIBRARY_PATH=/home/nico/work/amgx/lib:LD_LIBRARY_PATH nico:~/work/amgx cd examples/
nico:~/work/amgx/examples$ make
gcc -O2 -std=c99 amgx_capi_dynamic.c -c -I/usr/local/cuda/include
g++ -O2 amgx_capi_dynamic.o -o amgx_capi_dynamic -L/usr/local/cuda/lib64 -lcudart -ldl -Wl,-rpath=…/lib
nico:~/work/amgx/examples$ ./amgx_capi_dynamic
Usage: ./nvamg_capi [-help] [-mode [hDDI | hDFI | hFFI | dDDI | dDFI | dFFI] [-l lib_path] [-m mformat mfile] [-amg “variable1=value1 variable2=value2 … variable3=value3”] [-c config_file]
-help display the command options
-m mfile: reads matrix stored in file mfile
-mode : which of the solver modes to use
-l specify nvamg library path
-c set the amg solver options from the configuration file
-amg set the amg solver options. Options include the following:
nico:~/work/amgx/examples$ ./amgx_capi_dynamic -help
Cannot load nvamg library
nico:~/work/amgx/examples$ ./amgx_capi_dynamic -help -l …/lib/
Cannot load nvamg library
nico:~/work/amgx/examples$ ./amgx_capi_dynamic -help -l …/lib/libnvamgsh.so
Cannot load nvamg library
nico:~/work/amgx/examples$ ./amgx_capi_dynamic -help -l /home/nico/work/amgx/lib/
Cannot load nvamg library
nico:~/work/amgx/examples$ ./amgx_capi_dynamic -help -l /home/nico/work/amgx/lib/libnvamgsh.so
Cannot load nvamg library

Can you post the output of commands “ldd libnvamgsh.so” and “ldd amgx_capi_dynamic”?

nico:~/work/amgx/lib$ ldd libnvamgsh.so
ldd: warning: you do not have execution permission for ./libnvamgsh.so' ./libnvamgsh.so: /usr/lib64/libstdc++.so.6: version GLIBCXX_3.4.14’ not found (required by ./libnvamgsh.so)
linux-vdso.so.1 => (0x00007fff28784000)
libcudart.so.5.0 => /usr/local/cuda/lib64/libcudart.so.5.0 (0x00007fbfd6888000)
libcuda.so.1 => /usr/lib64/libcuda.so.1 (0x00007fbfd58fb000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fbfd56f7000)
libcublas.so.5.0 => /usr/local/cuda/lib64/libcublas.so.5.0 (0x00007fbfd1d00000)
libcusparse.so.5.0 => /usr/local/cuda/lib64/libcusparse.so.5.0 (0x00007fbfc9d26000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fbfc9a20000)
libm.so.6 => /lib64/libm.so.6 (0x00007fbfc979c000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fbfc9585000)
libc.so.6 => /lib64/libc.so.6 (0x00007fbfc91f1000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fbfc8fd4000)
librt.so.1 => /lib64/librt.so.1 (0x00007fbfc8dcb000)
libz.so.1 => /lib64/libz.so.1 (0x00007fbfc8bb5000)
/lib64/ld-linux-x86-64.so.2 (0x0000003b67000000)


nico:~/work/amgx/examples$ ldd amgx_capi_dynamic
linux-vdso.so.1 => (0x00007fff82f40000)
libcudart.so.5.0 => /usr/local/cuda/lib64/libcudart.so.5.0 (0x00007f3e57380000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003b67c00000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003b6e400000)
libm.so.6 => /lib64/libm.so.6 (0x0000003b67800000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003b6d000000)
libc.so.6 => /lib64/libc.so.6 (0x0000003b67400000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003b68000000)
librt.so.1 => /lib64/librt.so.1 (0x0000003b68800000)
/lib64/ld-linux-x86-64.so.2 (0x0000003b67000000)

We are using an older version of glib, do you think this is causing the issue?

Yes, I think that’s the reason why the library can not be loaded.

We currently only support RHEL 6.2 and Ubuntu 12.04 Linux. I would suggest for you to find out whether Scientific Linux 6.3 you are using is compatible (or has compilers/libraries compatible) with the defaults on these two distributions.

Alright, I will try to setup glib on SL or test it with RHEL on a different machine.
Thanks for you help!