- Register as CUDA registered developer.
- Read the NVIDIA Software License Agreement (AmgX Pre-Release Software).
- Download NVIDIA AmgX for the target platform.
- Download NVIDIA AmgX trial license key.
After cloning this repository, before compiling the Matlab interface, it is required to overlay NVIDIA AmgX. From the extracted download:
- Copy the
\configsdirectory to the repository directory\. - Copy the NVIDIA AmgX dynamic-link library (Windows:
amgxsh.dll) to the repository directory\. - Copy
amgx_capi.handamgx_config.hto the repository source-directory\src.
When NVIDIA AmgX has dependency on lower CUDA version then the installed CUDA Toolkit it is possible to copy and rename required dependencies (make symbolic links on Linux):
- Copy
cublas64_??.dllandcusparse64_??.dllinProgram Files\NVIDIA GPU Computing Toolkit\CUDA\v?.?\binto the repository directory\. - Rename the version number in
_??.dllto the version NVIDIA AmgX depends on; assuming hardly any change in the ABI (application binary interface) of CuBLAS and CuSPARSE.
In \src\amgx_capi.h overwrite AMGX_SAFE_CALL, giving proper NVIDIA AmgX error
messages in Matlab without seg-faults:
#define AMGX_SAFE_CALL(rc) \
{ \
AMGX_RC err; \
char amg_msg[4096]; \
char err_msg[4096]; \
switch(err = (rc)) { \
case AMGX_RC_OK: \
break; \
default: \
AMGX_get_error_string(err, amg_msg, 4096); \
sprintf(err_msg, "AmgX: ERROR: %s\n " \
"file %s line %6d\nCUDA: LAST ERROR: %s\n", \
amg_msg, __FILE__, __LINE__, cudaGetErrorString(cudaGetLastError())); \
mexErrMsgIdAndTxt("AmgX:SafeCall", err_msg); \
AMGX_abort(NULL, 1); \
break; \
} \
}On Windows open System Properties and click Environment Variables.
Add LM_LICENSE_FILE and provide the pathname to the downloaded license file.
In Matlab run compile.m in the repository source directory \src.
Read further instructions inside compile.m. After compilation
run test_mex_amgx.m in the \validate directory.