Help installing cuOpt solver

I have put significant effort in installing cuOpt solver.

Overview what I have done:

  • I am running Ubuntu 24.04 with Rtx 5070 ti GPU.
  • Installed AMPL CE (activated it) and put it to Path (ampl command is found from terminal)
  • I’ve installed Nvidia PPA 575 drivers that come with CUDA 12.9 (nvidia-smi confirms successful installation)
  • Installed Docker app as instructed on Docker web page
  • Installed Nvidia Container Toolkit
  • Installed Nvidia CUDA Toolkit
  • Installed Conda environment with Python 3.12
  • Installed cuOpt with pip as instructed on cuOpt web page quickstart guide for C interface (cuopt_cli runs ok)
  • Run from ampl dir (this is basically suggested on AMPL’s cuOpt solver webpage)

sudo docker run -it --rm --gpus all -v $(pwd):/workspace -w /workspace nvidia/cuda:12.9.0-runtime-ubuntu24.04 /bin/bash

  • Docker successfully launches CUDA environment within AMPL dir (nvidia-smi shows correctly empty process list as it is docker, with 575 drivers; and ls command confirms it is AMPL dir)
  • run ./ampl
  • Pasted simple model to AMPL

var x >= 0;
var y >= 0;
maximize Objective: 3x + 5y;
subject to Constraint1: x + 2y <= 10;
subject to Constraint2: 2
x + y <= 8;
option solver cuopt;
solve;
display x, y, Objective;

  • I am getting error that cuopt is not found. The same applies if I set cuoptmp or cuopt_cli as solver.

I am still probably missing something. Can you help me set it up?

1 Like

I got it working by running:

  • python3 -m amplpy.modules install cuopt
  • put cuopt libraries to path so that pure AMPL can find it without Python
  • docker image was not needed in my case probably as I installed both toolkits independently

Currently cuopt link libraries are still not available on AMPL Portal, only throw amplpy. Will you and when put them on portal to make installation easier for native AMPL users?

1 Like

I’ve made full model and I am receiving the error that solution can not be retrieved. Can you check on this?

Optimal solution found at root node. Objective 4.7774651165753068e+02. Time 102.76.
B&B added a solution to population, solution queue size 0 with objective 477.747
Consuming B&B solutions, solution queue size 1
Solution objective: 477.746512 , relative_mip_gap 0.000000 solution_bound 477.746512 presolve_time 0.033406 total_solve_time 106.555949 max constraint violation 0.000000 max int violation 0.000000 max var bounds violation 0.000000 nodes 0 simplex_iterations 0
CUOPT 25.5.0: optimal; objective 477.7465117
absmipgap=9.66338e-13, relmipgap=2.0227e-15
Error at _cmdno 27 executing “solve” command
(file /home/karlo/Desktop/VRP/vrp.run, line 36, offset 945):
Solution obtained using an unauthorized or unknown solver. Please contact support@ampl.com.

Hi @KSepetanc ,

Thanks for your messages, are you activating your license through the uuid?

Like

python3 -m amplpy.modules activate <your-uuid>

Hi @KSepetanc,

cuOpt is now listed on the AMPL Portal and available for Download from Download cuOpt.

Regarding the message Solution obtained using an unauthorized or unknown solver. Please contact support@ampl.com, please upgrade your AMPL installation to the latest version by downloading the AMPL module from Download AMPL. AMPL versions prior to the release of cuOpt will not recognize it as one of the free solvers to use with AMPL CE.

@marcos I activated using

ampl: shell “amplkey activate --uuid ”;

@fdabrandao everything works now. Thank you.

Maybe it could be bundled with default install as all other solvers are. Right now it needs to be downloaded from portal separately, but it works.

1 Like