Examples#
Remote execution uses the same Python, C API, and cuopt_cli
entry points as a local solve. After you start cuopt_grpc_server on the
GPU server (Quick Start), set the client environment and run the
integrated examples below unchanged — no code edits are required. The
gRPC linear programming client
section is separate: it uses Client(host, port) and does not read
CUOPT_REMOTE_*.
On the client machine, before running the example commands or scripts:
export CUOPT_REMOTE_HOST=<gpu-server-hostname-or-ip>
export CUOPT_REMOTE_PORT=5001
Add TLS or tuning variables from Advanced Configuration if your deployment uses them.
Note
Routing does not read CUOPT_REMOTE_HOST/CUOPT_REMOTE_PORT. Use the
gRPC routing client below, or the
HTTP/JSON REST self-hosted server and
Examples.
Where to Find Examples#
Python (LP / QP / MIP)#
Convex Optimization Examples — runnable Python samples (LP, QP). With
CUOPT_REMOTE_HOSTandCUOPT_REMOTE_PORTset on the client, solves go to the remote server automatically.MIP Examples — runnable Python samples (MIP). With
CUOPT_REMOTE_HOSTandCUOPT_REMOTE_PORTset on the client, solves go to the remote server automatically.
C API (LP / QP / MIP)#
Convex Optimization C API Examples — LP and QP C examples.
MIP C API Examples — MIP C examples.
Compile and run these programs with the same exports in the shell;
cuOptSolveuses gRPC when both remote variables are set (see cuOpt Convex Optimization C API Reference for API reference).
cuopt_cli#
Examples —
cuopt_cliinvocations. With the exports above, the CLI forwards solves tocuopt_grpc_server.
Minimal Demos (This Section)#
Included with the gRPC docs source for a quick copy-paste path (also walked through in Quick Start):
gRPC Linear Programming Client#
For explicit job control (submit / wait / cancel / stream logs or incumbents)
without CUOPT_REMOTE_*, use cuopt.grpc.linear_programming.Client:
gRPC Linear Programming Client — overview
gRPC Linear Programming Client Examples — log streaming and incumbent streaming
gRPC Linear Programming Client API Reference — API reference
gRPC Routing Client#
For VRP, TSP, and PDP problems, use cuopt.grpc.routing.RoutingClient.
Routing does not read CUOPT_REMOTE_*:
gRPC Routing Client — overview and
remote_routing_demo.pygRPC Routing Client API Reference — API reference
Custom gRPC Client#
Integrations that use neither remote execution, the gRPC linear programming
client, nor the gRPC routing client should speak CuOptRemoteService
directly. See gRPC API (Reference),
gRPC Server Behavior, and cpp/docs/grpc-server-architecture.md
in the repository for protos and server behavior.
More Samples#
NVIDIA cuOpt examples on GitHub — set the remote environment on the client before running notebooks or scripts.
REST vs gRPC#
Self-hosted HTTP/JSON — Examples targets the REST server; request shapes follow the OpenAPI workflow, not the
CuOptRemoteServiceprotos.