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.
- 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
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.pyor as a one-liner with uv:
uv run https://raw.githubusercontent.com/GAMS-dev/cuoptlink-builder/main/fetch-cuoptlink.pyRunning 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.pyCalling uninstall without additional options will interactively prompt for the GAMS directory path:
python fetch-cuoptlink.py uninstallYou 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.0Note: Successful installations automatically verify the solver link by running the GAMS
trnsporttest model withsolver=cuopt.
- Make sure CUDA runtime is installed
- Download and unpack
cuopt-link-release-cu12-{x86_64,arm64}.ziporcuopt-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*-*.zipinto your GAMS system directory. For GAMSPy, you can find out your system directory by runninggamspy show base. So for example you can rununzip -o cuopt-link-release-cu*-*.zip -d $(gamspy show base). - Caution: This will overwrite any existing
gamsconfig.yamlfile in that directory. The containedgamsconfig.yamlcontains asolverConfigsection to make cuOpt available to GAMS.
- Unpack the contents of
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.
Get an example model and explicitly choose cuopt as lp or mip solver:
gamslib trnsport
gams trnsport lp cuopt
- examples/trnsport_cuopt.ipynb for CUDA 12 on x86_64
- examples/trnsport_cuopt.ipynb for CUDA 13 on x86_64
Various GAMS models can be found in subfolder examples/models and are used to verify the solver link.
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.