Skip to content

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

deprecated

Matlab interface for NVIDIA AmgX

Obtain NVIDIA AmgX

  • 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.

Overlay NVIDIA AmgX

After cloning this repository, before compiling the Matlab interface, it is required to overlay NVIDIA AmgX. From the extracted download:

  • Copy the \configs directory to the repository directory \.
  • Copy the NVIDIA AmgX dynamic-link library (Windows: amgxsh.dll ) to the repository directory \.
  • Copy amgx_capi.h and amgx_config.h to the repository source-directory \src.

Match NVIDIA CUDA Runtime Libraries

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_??.dll and cusparse64_??.dll in Program Files\NVIDIA GPU Computing Toolkit\CUDA\v?.?\bin to the repository directory \.
  • Rename the version number in _??.dll to the version NVIDIA AmgX depends on; assuming hardly any change in the ABI (application binary interface) of CuBLAS and CuSPARSE.

Safe Error Messages

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; \
  } \
}

Configure License

On Windows open System Properties and click Environment Variables. Add LM_LICENSE_FILE and provide the pathname to the downloaded license file.

Compile and Validate

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.

mexAmgX — License

About

Matlab wrapper for NVIDIA AmgX

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Contributors

Languages