Skip to content

Latest commit

 

History

203 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GAMS solver link for NVIDIA cuOpt solver

Build cuOpt link for GAMS Build cuOpt link for GAMS

This project builds and packages the GAMS and GAMSPy solver link for the NVIDIA cuOpt solver.

You can get more details and tips by reading the blog post "GPU-Accelerated Optimization with GAMS and NVIDIA cuOpt".

Supported model types are LP, MIP, RMIP, QCP, RMIQCP. QCP and RMIQCP models must be convex. Mixed-integer quadratic models (MIQCP) are not supported, since cuOpt's MIP solver only handles linear objectives and constraints.

Requirements

  • Operating System: Linux, Windows 11 through WSL2
  • CPU architecture: x86_64, arm64
  • GAMS: Version 54 or newer
  • GAMSPy: Version 1.12.1 or newer
  • NVIDIA GPU: Volta architecture or better
  • CUDA Runtime Libraries: 12 or 13

Installation using fetch-cuoptlink.py

You can automatically download, install, test, and manage the cuOpt solver link using the provided fetch-cuoptlink.py script.

Quickstart: The script has no external dependencies, so you can download and run it directly:

curl -O https://raw.githubusercontent.com/GAMS-dev/cuoptlink-builder/main/fetch-cuoptlink.py
python fetch-cuoptlink.py

or as a one-liner with uv:

uv run https://raw.githubusercontent.com/GAMS-dev/cuoptlink-builder/main/fetch-cuoptlink.py

Interactive Mode

Running the script with no arguments launches an interactive prompt. It auto-detects your GAMS path (via which gams) and system CUDA version, prompting you for any missing options:

python fetch-cuoptlink.py

Calling uninstall without additional options will interactively prompt for the GAMS directory path:

python fetch-cuoptlink.py uninstall

Non-interactive CLI Mode

You can also pass command-line arguments to automate installation and uninstallation:

# Basic installation using detected GAMS directory and CUDA runtime download
python fetch-cuoptlink.py install --gams-dir /opt/gams/gams55.0_linux_x64_64_sfx --cuda-runtime

# Specify a CUDA version and release tag explicitly
python fetch-cuoptlink.py install -g /opt/gams/gams55.0 -c 12 -r v0.0.8

# Uninstall the solver link from a GAMS system directory
python fetch-cuoptlink.py uninstall -g /opt/gams/gams55.0

Note: Successful installations automatically verify the solver link by running the GAMS trnsport test model with solver=cuopt.

Manual installation

  • Make sure CUDA runtime is installed
  • Download and unpack cuopt-link-release-cu12-{x86_64,arm64}.zip or cuopt-link-release-cu13-{x86_64,arm64}.zip (for CUDA 12 and 13 respectively) from the releases page:
    • Unpack the contents of cuopt-link-release-cu*-*.zip into your GAMS system directory. For GAMSPy, you can find out your system directory by running gamspy show base. So for example you can run unzip -o cuopt-link-release-cu*-*.zip -d $(gamspy show base).
    • Caution: This will overwrite any existing gamsconfig.yaml file in that directory. The contained gamsconfig.yaml contains a solverConfig section to make cuOpt available to GAMS.

The neccessary files from the CUDA 12 or 13 runtime can also be downloaded as convenient archive cu12-runtime-{x86_64,arm64}.zip or cu13-runtime-{x86_64,arm64}.zip from the releases page.

Test the setup

Get an example model and explicitly choose cuopt as lp or mip solver:

gamslib trnsport
gams trnsport lp cuopt

Examples

Notebooks

GAMS models

Various GAMS models can be found in subfolder examples/models and are used to verify the solver link.

Regression tests

The self-checking models in examples/models/regression_tests cover dual signs and reduced costs, QP/QCQP marginals, RMIQCP, option handling, error reporting, LP limit points, GMO handling (e.g. =N= rows, requestMarginals=2), rejection of unsupported features (SOS, semi-integer, MIQCP) and solve/model status mapping. Each model aborts if a result deviates from the reference values (obtained with CPLEX). Run them all against the GAMS system found in your PATH (it needs a GPU and the installed solver link):

examples/models/regression_tests/run_tests.sh

The script prints [PASS] or [FAIL] per model and keeps the listing and log file of failed models for inspection. Its exit code is the number of failed models.

Releases

Packages

Used by

Contributors

Languages