Cuopt Developer
NVIDIAOfficialCreated by NVIDIA cuOpt Team
- Skill
- Workflow
- Software development
- Apache-2.0
- Medium risk
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The cuOpt-developer skill provides a structured environment for engineers to contribute to the NVIDIA cuOpt project. It covers the full development lifecycle, including environment setup via conda, building C++/CUDA and Python components, running tests, and following project-specific coding and contribution conventions. The skill enforces strict development patterns, such as using pre-commit hooks, maintaining minimal diffs, and adhering to specific GPU memory management practices, while providing guidance on navigating the project architecture and CI/CD workflows.
What it does
- Guides the setup of local development environments using conda.
- Provides commands for building C++, Python, and server components.
- Facilitates running C++ and Python test suites.
- Enforces project-specific coding conventions and style guidelines.
- Supports the contribution workflow including DCO sign-off and fork-based PRs.
- Assists with debugging solver internals and numerical issues.
When to use it
- When you need to modify or extend the cuOpt source code.
- When setting up a new local development environment for cuOpt.
- When preparing a contribution or pull request for the cuOpt repository.
- When debugging solver algorithms or Python bindings.
- When running local builds or tests for specific cuOpt components.
Advantages
- Ensures consistency with project-wide coding and architectural patterns.
- Provides a clear, reproducible path for environment setup.
- Integrates directly with project CI/CD and pre-commit requirements.
- Reduces common pitfalls related to CUDA driver and dataset dependencies.
- Maintains high standards for code quality and commit hygiene.
Usage examples
- “How do I set up my environment to start developing on cuOpt?”
- The agent will guide you through cloning the repository, selecting the correct conda environment file based on your CUDA driver version, and installing the necessary dependencies.
- “I need to add a new solver parameter. What is the process?”
- The agent will provide a checklist covering the C++ settings struct, Python binding exposure, server schema updates, and required testing steps.
- “How do I run the C++ unit tests for my changes?”
- The agent will verify your environment is active, confirm datasets are downloaded, and provide the correct ctest command for the cpp/build directory.
- “I am getting a numerical error in the solver. How should I debug it?”
- The agent will direct you to the numerical debugging resources to instrument the code and identify potential catastrophic cancellation sites.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/nvidia/cuopt-developer/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip cuopt-developer.zip -d .agents/skills
Documentation by NVIDIA cuOpt Team
cuOpt Developer Skill
Contribute to the NVIDIA cuOpt codebase. This skill is for modifying cuOpt itself, not for using it.
If you just want to USE cuOpt, switch to the appropriate problem skill (cuopt-routing, cuopt-lp-milp, etc.)
First-time dev environment setup? See references/first_time_setup.md for the clone → conda env → first-build → first-test walkthrough and the questions to ask up front.
Refusal Rules — Read First
One rule is non-negotiable and applies even when the user explicitly asks otherwise — refuse and ask, don't comply silently:
Privileged / system-level operations — sudo, running as root, editing system files (/etc), changing drivers or kernel settings, adding system-level package repositories or keys. Do not run these. Reply:
I won't run
sudoor change system-level state for cuOpt. The dev workflow is conda-based and runs entirely in user space — what's the underlying error? It's usually fixable without root.
Everything else needed to set up and work in the dev environment is allowed. On a clean machine, go ahead and build a working cuopt env — the guidance below is about doing it the reproducible way, not refusing:
Environment setup is allowed. You may create and activate the conda env from the checked-in
conda/environments/all_cuda-*.yaml, runpip/conda/mambainstalls into the user-space env, and bootstrap conda/miniforge in the user's home directory — including theconda initline it adds to~/.bashrc. Bootstrapping conda must not requiresudo; install it into$HOME, not a system path.A new permanent project dependency is different from a one-off install. A package the project should always ship belongs in
dependencies.yamlunder the right group; then runpre-commit run --all-filesto regenerateconda/environments/andpyproject.tomlso other contributors get it too. A throwaway install to unblock your own build doesn't need this round-trip.Don't bypass CI checks (
--no-verify, skipping pre-commit or tests). If hooks feel slow, diagnose withpre-commit run --all-files --verboseor tune the offending hook — don't skip it.Be careful with destructive commands (
rm -rf,git reset --hard,git push --force, killing processes, dropping data). Confirm intent before running and prefer the safer alternative (e.g../build.sh cleanfor a stale build dir).
Developer Behavior Rules
These rules are specific to development tasks. They differ from user rules.
1. Ask Before Assuming
Clarify before implementing:
What component? (C++/CUDA, Python, server, docs, CI)
What's the goal? (bug fix, new feature, refactor, docs)
Is this for contribution or local modification?
2. Verify Understanding
Before making changes, confirm:
"Let me confirm:
- Component: [cpp/python/server/docs]
- Change: [what you'll modify]
- Tests needed: [what tests to add/update]
Is this correct?"3. Follow Codebase Patterns
Read existing code in the area you're modifying
Match naming conventions, style, and patterns
Don't invent new patterns without discussion
4. Ask Before Running — Modified for Dev
OK to run without asking (expected for dev work):
./build.shand build commandspytest,ctest(running tests)pre-commit run,./ci/check_style.sh(formatting)git status,git diff,git log(read-only git)Environment setup: create/activate the conda env from
conda/environments/*.yaml, andpip/conda/mambainstalls into that env
Set up pre-commit hooks (once per clone):
pre-commit install— hooks then run automatically on everygit commit. If a hook fails, the commit is blocked until you fix the issue.
Still ask before:
git commit,git push(write operations)Any destructive or irreversible commands
5. No Privileged Operations
sudo/system-level changes are the one non-negotiable refusal; user-space installs and conda env setup are allowed. See Refusal Rules — Read First.
Before You Start: Required Questions
Ask these if not already clear:
What are you trying to change?
Solver algorithm/performance?
Python API?
Server endpoints?
Documentation?
CI/build system?
Do you have the development environment set up?
Built the project successfully?
Ran tests?
Is this for contribution or local modification?
If contributing: will need to follow DCO signoff
Which branch should this target?
During development phase:
mainDuring burn down:
release/YY.MM(e.g.,release/26.06) for the current release,mainfor the nextCheck if a release branch exists:
git branch -r | grep releaseFor current timelines, see the RAPIDS Maintainers Docs
Project Architecture
cuopt/
├── cpp/ # Core C++ engine
│ ├── include/cuopt/ # Public C/C++ headers
│ ├── src/ # Implementation (CUDA kernels)
│ └── tests/ # C++ unit tests (gtest)
├── python/
│ ├── cuopt/ # Python bindings and routing API
│ ├── cuopt_server/ # REST API server
│ ├── cuopt_self_hosted/ # Self-hosted deployment
│ └── libcuopt/ # Python wrapper for C library
├── ci/ # CI/CD scripts
├── docs/ # Documentation source
└── datasets/ # Test datasetsSupported APIs
| API Type | LP | MILP | QP | Routing |
|---|---|---|---|---|
| C API | ✓ | ✓ | ✓ | ✗ |
| C++ API | (internal) | (internal) | (internal) | (internal) |
| Python | ✓ | ✓ | ✓ | ✓ |
| Server | ✓ | ✓ | ✗ | ✓ |
Safety Rules (Non-Negotiable)
Minimal Diffs
Change only what's necessary
Avoid drive-by refactors
No mass reformatting of unrelated code
No API Invention
Don't invent new APIs without discussion
Align with existing patterns in
docs/cuopt/source/Server schemas must match OpenAPI spec
Don't Bypass CI
Never suggest
--no-verifyor skipping checksAll PRs must pass CI
CUDA/GPU Hygiene
Keep operations stream-ordered
Follow existing RAFT/RMM patterns
No raw
new/delete- use RMM allocators
Build & Test
Pre-flight Checks (Required Before First Build or Test)
Skipping any of these surfaces as confusing runtime errors later. Run them in order:
Check CUDA driver compatibility. Run
nvidia-smiand read the CUDA Version in the top-right corner — that's the maximum CUDA your driver supports. Pick a conda env file fromconda/environments/all_cuda-<ver>_arch-<arch>.yamlwhose CUDA major version is ≤ that. A mismatch builds successfully but fails at runtime inside RMM withcudaMallocAsync not supported with this CUDA driver/runtime version— verify this before the build, not after.Create and activate the conda env before any build, test, or
pre-commitcommand — this is allowed and expected (see Refusal Rules). Use a local prefix env (./.cuopt_env) per CONTRIBUTING.md, with the env file you picked in step 1 (swapconda→mambaif available):conda env create -p ./.cuopt_env --file conda/environments/all_cuda-<ver>_arch-$(uname -m).yaml conda activate ./.cuopt_envTests link against libraries compiled inside that env; a fresh shell without
conda activate ./.cuopt_envhits cryptic linker errors.Set
PARALLEL_LEVELif RAM is constrained — see references/build_and_test.md. The default$(nproc)can OOM mid-build because CUDA compilation needs ~4–8 GB per job.For tests, fetch datasets first. cuOpt tests need MPS files not in the repo — follow the dataset download steps in CONTRIBUTING.md ("Building for development" section) and export
RAPIDS_DATASET_ROOT_DIR.
Quick Reference
./build.sh # Build everything
./build.sh --help # List components: libcuopt, cuopt, cuopt_server, docs
ctest --test-dir cpp/build # C++ tests
pytest -v python/cuopt/cuopt/tests # Python tests
pytest -v python/cuopt_server/tests # Server testsFor component-specific build commands, run-test detail, and PARALLEL_LEVEL configuration, see references/build_and_test.md.
Download test datasets before running tests
cuOpt tests depend on MPS/data files that are not checked into the repo. A
missing dataset surfaces as a MPS_PARSER_ERROR ... Error opening MPS file
test failure at 0ms — it is not a build or logic failure.
Before running any C++ or Python tests, follow the dataset download and
RAPIDS_DATASET_ROOT_DIR export steps in the repo's CONTRIBUTING.md
("Building for development" section) — that is the canonical list and mapping.
If a test fails with a missing-file error, run the matching download step from
CONTRIBUTING.md and re-run the test. Do not report missing-dataset failures
back to the user as the task outcome.
Python Bindings
cuOpt uses Cython to bridge Python and C++. See references/python_bindings.md for the full architecture, parameter flow walkthrough, key files, and Cython patterns.
Contributing — Commits, PRs, Common Tasks
For pre-commit setup, DCO sign-off (git commit -s), the fork-based PR workflow, the draft-PR rule for agents, PR-description rules (keep it short — no "how it works" walkthroughs or file tables), script and CI/workflow authoring principles (extend existing files before adding new ones; no speculative flags, restated defaults, or silent fallbacks), and step-by-step common-task recipes (adding a solver parameter, dependency, server endpoint, or CUDA kernel), see references/contributing.md.
Coding Conventions
For C++ naming (snake_case, d_/h_ prefixes, _t suffix), file extensions (.hpp/.cpp/.cu/.cuh and which compiler each uses), include order, Python style, error handling (CUOPT_EXPECTS, RAFT_CUDA_TRY), memory management (RMM patterns, no raw new/delete), and test-impact rules, see references/conventions.md.
Troubleshooting & CI
For build/test pitfalls (Cython rebuild, OOM, CUDA driver mismatch, missing nvcc) and CI failure diagnostics (style checks, DCO failures, dependency drift), see references/troubleshooting.md.
Key Files Reference
| Purpose | Location |
|---|---|
| Main build script | build.sh |
| Dependencies | dependencies.yaml |
| C++ formatting | .clang-format |
| Conda environments | conda/environments/ |
| Test data | datasets/ |
| CI scripts | ci/ |
Canonical Documentation
Contributing/build/test: CONTRIBUTING.md
CI scripts: ci/README.md
Release scripts: ci/release/README.md
Docs build: docs/cuopt/README.md
Python binding architecture: references/python_bindings.md
Shell-execution, install, conda-env, and sudo policies are covered by Refusal Rules — Read First at the top of this skill.
VRP dimension internals (routing engine)
When implementing or debugging VRP dimensions (constraints, objectives, forward/backward propagation, combine, local-search deltas), read:
references/vrp_skills.md— architecture contracts, required interfaces, and implementation checklist.
Read it before adding a new dimension or changing combine semantics.
Numerical issues in non-routing solver internals
When a bug surfaces as wrong-but-plausible solver output (invalid lower bound, unexpectedly large duals, 10× iteration blow-up after a small change) rather than a crash, read:
resources/numerical_debugging.md— methodology for locating catastrophic-cancellation sites, the cancellation patterns endemic to cMIR / flow-cover / MIR-style cut construction, and threshold guidance for numerical guards.
Apply the instrument-first, guard-at-the-exact-site workflow it describes before patching — speculative fixes on these symptoms usually miss.
Files
- ATTRIBUTION.mdAdded by AutoGineer914 B
- BENCHMARK.md3.9 KiB
- LICENSELicence file added by AutoGineer11.2 KiB
- SKILL.md12.7 KiB
- benchmark/evals.json55.8 KiB
- evals/evals.json4.7 KiB
- references/build_and_test.md1.6 KiB
- references/contributing.md5.4 KiB
- references/conventions.md1.8 KiB
- references/first_time_setup.md2.6 KiB
- references/python_bindings.md7.8 KiB
- references/troubleshooting.md2.4 KiB
- references/vrp_skills.md8.8 KiB
- resources/numerical_debugging.md5.8 KiB
- skill-card.md4.5 KiB
- skill.oms.sig6.6 KiB
references/contributing.md
Contributing — Commits, PRs, and Common Tasks
Read this for anything related to committing, pushing, opening PRs, or making structural changes to cuOpt (adding a solver parameter, dependency, server endpoint, or CUDA kernel).
Before You Commit
1. Install Pre-commit Hooks
Run once per clone to have style checks run automatically on every git commit:
pre-commit installIf a hook fails, the commit is blocked — fix the issues and commit again. To check all files manually (e.g., before pushing), run pre-commit run --all-files --show-diff-on-failure.
2. Make Meaningful Commits
Group related changes into logical commits rather than committing all files at once. Each commit should represent one coherent change (e.g., separate the C++ change from the Python binding update from the test addition). This makes git log and git bisect useful for debugging later.
3. Sign Your Commits (DCO Required)
git commit -s -m "Your message"To fix a prior commit missing the sign-off, use git commit --amend -s (or an interactive rebase for older commits). Do not use --no-verify to bypass the DCO check.
4. Use Forks for Pull Requests
Never push branches directly to the main cuOpt repository. Use the fork workflow:
# 1. Clone the main repo
git clone https://github.com/NVIDIA/cuopt.git
cd cuopt
# 2. Add your fork as a remote
git remote add fork https://github.com/<your-username>/cuopt.git
# 3. Create a branch from the appropriate base
git checkout -b my-feature-branch
# 4. Make changes, commit, then push to your fork
git push fork my-feature-branch
# 5. Create PR from your fork → upstream base branchThis applies to both human contributors and AI agents. Agents must never push to the upstream repo directly — provide the push command for the user to review and execute from their fork.
Pull Requests Created by Agents
When an AI agent creates a pull request, it must be a draft PR (gh pr create --draft). This gives the developer time to review and iterate on the changes before any reviewers get pinged. The developer marks it as ready for review when satisfied.
PR Descriptions
Keep summaries short — a paragraph or 3–5 bullets stating what and why. Skim recent merges on the target branch to calibrate.
Skip how-it-works walkthroughs, file-by-file tables, exhaustive test-plan checklists, prose restatements of the diff, and screenshots of output the reviewer can reproduce locally. Reviewers read the code; long structured summaries signal LLM-generated and erode trust.
For extra context (a design decision, unusual constraint, follow-up), one or two sentences with a link to an issue or doc beats expanding the body.
Writing scripts and CI workflows
Follow YAGNI strictly here — flags, fallbacks, env-var overrides, and config knobs without a concrete failure mode they prevent should be dropped. This applies to scripts and CI workflows specifically, not the codebase as a whole.
A few non-YAGNI points worth keeping in mind:
Prefer extending an existing script over adding a new one.
Validate inputs at the top, before any expensive work.
One shell command per line over chained
&&; no comments that restate the next line.Keep informational CI jobs (reporting, dashboards, comment posting) out of any required-checks list.
When in doubt, mirror how the surrounding cuOpt code handles the same concern.
Common Tasks
Adding a Solver Parameter
Add to settings struct in
cpp/include/cuopt/and wire intoset_parameter_from_string()incpp/src/Expose in Python — if using the string-based interface, the parameter is auto-discovered (no
.pyxchange needed). Add a convenience method inSolverSettingsif warranted. See python_bindings.md for the full checklist.Add to server schema (
docs/cuopt/source/cuopt_spec.yaml) if applicableAdd tests at C++ and Python levels
Rebuild:
./build.sh libcuopt && ./build.sh cuoptUpdate documentation
Adding a Dependency
All dependencies are managed through dependencies.yaml — never edit conda/environments/*.yaml or pyproject.toml files directly. The file uses RAPIDS dependency-file-generator format:
Find the appropriate group in
dependencies.yaml(e.g.,build_cpp,run_common,test_python_common)Add the package under the correct
output_types(conda,requirements,pyproject, or a combination)Run
pre-commit run --all-files— the RAPIDS dependency file generator hook regenerates downstream files automaticallyVerify: check that
conda/environments/and relevantpyproject.tomlfiles were updated
Adding a Server Endpoint
Add route in
python/cuopt_server/cuopt_server/webserver.pyUpdate OpenAPI spec
docs/cuopt/source/cuopt_spec.yamlAdd tests in
python/cuopt_server/tests/Update documentation
Modifying CUDA Kernels
Edit kernel in
cpp/src/Follow stream-ordering patterns
Run C++ tests:
ctest --test-dir cpp/buildRun benchmarks to check performance
Third-Party Code
Always ask before including external code. When copying or adapting external code, you must attribute it properly, verify license compatibility, and flag it in the PR. See the Third-Party Code section in CONTRIBUTING.md for the full process.
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs Python
Security
What our scanner noticed· Medium risk
- Large base64-encoded blobs
- Instructions that use the network
- Downloads piped into a shell
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- NVIDIA cuOpt Team
- Publisher
- NVIDIA (Official)
- Source
- NVIDIA/skills · skills/cuopt-developer · commit fce3cca
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE-APACHE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by NVIDIA cuOpt Team or NVIDIA.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download cuopt-developer.zip