{"id":"a2474e3e-3eb8-42b6-95dc-fc9d91f93499","slug":"doca-programming-guide","kind":"skill","name":"doca-programming-guide","summary":"Use this skill when the user is writing their first DOCA app or asking a library-agnostic programming question — picking a shipped sample to copy and modify, wiring the canonical pkg-config doca-{libr","owner":"NVIDIA","repoUrl":"https://github.com/NVIDIA/skills/tree/HEAD/skills/doca-programming-guide","license":"Apache-2.0","licenseTier":"permissive","trust":"official","stars":3586,"match":null,"fewStars":false,"format":"skill","createdAt":null,"addedAt":"2026-10-14T05:43:41.434Z","logoUrl":"https://avatars.githubusercontent.com/u/1728152?v=4","linkOnly":false,"collection":{"name":"skills","repo":"nvidia/skills"},"skillPath":"skills/doca-programming-guide","categories":["developer-tools","writing","memory-knowledge"],"tags":["agentic-ai","ai-agents","claude-code","codex","coding-agents","cuda","developer-tools","llm"],"runtime":"binary","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-14T05:43:41.429Z","sample":false,"url":"https://conduits.dev/tools/doca-programming-guide","language":"Python","transports":[],"install":{},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"> Use this skill when the user is writing their first DOCA app or asking a library-agnostic programming question — picking a shipped sample to copy and modify, wiring the canonical pkg-config doca-{library} + meson build (or FFI from Rust / Go / Python against the public C ABI), walking the cfg-create → init → start → use → stop → destroy lifecycle, validating a spec before commit, or decoding a DOCA_ERROR_* return with doca_error_get_descr(). Trigger even when the user does not say \"DOCA programming guide\" — implicit phrasings: \"write my first DOCA program\", \"meson line for doca_rdma_*\", \"got DOCA_ERROR_BAD_STATE on my first call\", \"call DOCA from Rust without writing C\", \"built clean but nothing on the wire\", \"what order do doca_*_pipe calls go in\". Refuse and route for install / hugepages / pkg-config not resolving doca-{library} (doca-setup), docs or version lookup (doca-public-knowledge-map), and library-internal API construction like Flow pipe topology or RDMA QP setup (matching library skill).\n\n# DOCA programming guide\n\n**Where to start:** Read [`## Audience`](#audience) to confirm the user\nis *consuming* DOCA, not *contributing* to it. Then jump to the H2\nthat matches the verb (`## modify` for first-app derivation,\n`## build` for the canonical build pattern, `## test` for the test\nloop, `## debug` for the program-class debug ladder).\n\n## Example questions this skill answers well\n\nThese are the CLASSES of program-class questions the skill is built\nto answer, each with one worked example. Library-specific overlays\n(Flow / DMS / Caps / …) live in the matching library skill; this\nskill answers the library-agnostic shape.\n\n- **\"How do I write my first DOCA program for &lt;any library&gt;?\"** —\n  worked example: *\"I want to write my first DOCA Flow application.\"*\n  Answered by the modify-a-shipped-sample workflow in\n  [`TASKS.md ## modify`](TASKS.md#modify) plus the canonical build\n  pattern in [`TASKS.md ## build`](TASKS.md#build).\n- **\"What's the right build line for any DOCA library?\"** — worked\n  example: *\"How do I compile a program that calls `doca_rdma_*`?\"*\n  Answered by the `pkg-config doca-<library>` pattern in\n  [`TASKS.md ## build`](TASKS.md#build) (C/C++ Track 1) and the\n  FFI/bindings pattern in Track 2.\n- **\"What's the lifecycle every DOCA object follows?\"** — worked\n  example: *\"What's the right order of `doca_flow_pipe_*` calls in my\n  program?\"* Answered by the cfg-create / init / start / use / stop /\n  destroy template in [`CAPABILITIES.md ## Capabilities and modes`](CAPABILITIES.md#capabilities-and-modes).\n- **\"`DOCA_ERROR_*` came back — what does it mean and what do I do?\"**\n  — worked example: *\"My code got `DOCA_ERROR_BAD_STATE`.\"* Answered\n  by the cross-library `doca_error_get_descr()` rule in\n  [`CAPABILITIES.md ## Error taxonomy`](CAPABILITIES.md#error-taxonomy)\n  + the program-class debug order in\n  [`TASKS.md ## debug`](TASKS.md#debug).\n- **\"My program built and started, but does nothing on the wire.\"** —\n  worked example: *\"My Flow program runs cleanly but no traffic is\n  matched.\"* Answered by the validate-before-commit rule in\n  [`CAPABILITIES.md ## Safety policy`](CAPABILITIES.md#safety-policy)\n  and the layered program-class debug ladder in\n  [`TASKS.md ## debug`](TASKS.md#debug).\n- **\"What does &lt;language&gt; consumer of DOCA look like (FFI /\n  bindings)?\"** — worked example: *\"How do I call DOCA Comch from Rust\n  without writing C?\"* Answered by Track 2 of\n  [`TASKS.md ## build`](TASKS.md#build) (FFI against the public C\n  ABI) and the language-neutral lifecycle in\n  [`CAPABILITIES.md ## Capabilities and modes`](CAPABILITIES.md#capabilities-and-modes).\n- **\"How should I classify and build all the shipped DOCA samples and\n  applications? What's the difference between a sample and an\n  application?\"** — worked example: *\"I tried to build all DOCA apps\n  and 20/159 failed — which ones are real regressions vs missing\n  optional stacks?\"* Answered by the sample-vs-application model and\n  the category / dependency / skip-vs-fail taxonomy in\n  [`TASKS.md ## sample-and-app-categorization`](TASKS.md#sample-and-app-categorization),\n  which separates *\"the SDK is broken\"* from *\"the optional GPU /\n  RMAX / MPI stack is not on this BlueField\"*.\n\nIf the question is env-class (install / build env / hugepages /\ndevices), route to [`doca-setup`](../doca-setup/SKILL.md). If it is\nlibrary-specific (Flow pipe topology, RDMA QP setup, DMS service\ndeploy), layer the matching library skill on top.\n\n## Audience\n\nThis skill serves **external developers building applications that\n*consume* DOCA libraries** — i.e., users whose code calls one or more\n`doca_<library>_*` symbols (directly in C/C++, or through FFI /\nbindings from another language). It is *programming **with** DOCA*,\nnot *programming **of** DOCA*: it is *not* for NVIDIA developers\ncontributing to DOCA itself, and it does *not* assume access to the\nDOCA source tree, internal NVIDIA tooling, or any non-public\ninformation. The only inputs it ever points the agent at are the\nones any external user has: the public docs at\n[`docs.nvidia.com/doca/sdk/`](https://docs.nvidia.com/doca/sdk/),\nthe public catalog at\n[`catalog.ngc.nvidia.com`](https://catalog.ngc.nvidia.com/), the\npublic GitHub repos under\n[`github.com/NVIDIA`](https://github.com/NVIDIA) /\n[`github.com/NVIDIA-DOCA`](https://github.com/NVIDIA-DOCA), the\npublic developer forum, and the on-disk `/opt/mellanox/doca` tree\nthat the public DOCA install (or the public NGC DOCA container,\n`nvcr.io/nvidia/doca/doca`) puts on the user's host. *Where to find*\nand *how to install* questions are routed elsewhere — see *Related\nskills* below.\n\n**Language scope.** DOCA itself is a C library family; every shipped\nsample in `/opt/mellanox/doca/samples/` and every shipped reference\napplication in `/opt/mellanox/doca/applications/` is C. C and C++\nconsumers are the canonical case for every prescriptive workflow in\nthis skill. Other-language consumers (Rust, Go, Python, …) consume the\nsame `*.so` libraries through FFI or language-specific bindings against\nthe public C ABI; the skill keeps the lifecycle, capability, error,\nobservability, and safety guidance language-neutral, and routes the\nlanguage-specific build / FFI work back to the consumer's own toolchain\nwithout authoring wrappers.\n\n## When to load this skill\n\nLoad this skill when the user has DOCA installed *and* the env-class\npreconditions are already satisfied (i.e.,\n[`doca-setup`](../doca-setup/SKILL.md) has produced a clean install\nwhere `pkg-config doca-<library>` resolves, hugepages are mounted, and\ndevices are visible), and is now asking a question about **how to\nactually program against DOCA** in a library-agnostic way:\n\n- Understanding what DOCA's pieces are (libraries, apps, services,\n  tools) and which side of the wire they run on.\n- The canonical `pkg-config` + meson build pattern any DOCA application\n  follows, regardless of which library it consumes.\n- The universal *derive a custom first application from a shipped\n  sample* workflow that every library skill extends with\n  library-specific overrides — moved here from `doca-setup` because it\n  is a programming verb, not an env verb.\n- The universal DOCA lifecycle (`cfg-create → init → start → use →\n  stop → destroy`) and how it manifests across libraries.\n- The general `DOCA_ERROR_*` pattern, `doca_error_t`, and\n  `doca_error_get_descr()` — the cross-library shape, not Flow- or\n  RDMA-specific overlays.\n- The validate-before-commit rule and the program-side safety policy\n  that every library skill inherits.\n- Programming patterns that apply to consumers in *any* language\n  (C/C++ directly, FFI / bindings for Rust / Go / Python / …) — the\n  skill keeps the patterns language-neutral and points the agent at\n  the public C ABI as the authoritative surface.\n\nDo **not** load this skill for:\n\n- *\"Is my install healthy? Why does `pkg-config` not find `doca-flow`?\n  How do I mount hugepages? I don't have DOCA installed yet — can I\n  use a container?\"* — env-class questions belong in\n  [`doca-setup`](../doca-setup/SKILL.md), which owns install\n  verification, env preparation, env-class debugging, and the\n  *no-install → NGC container fallback* path for any user on macOS,\n  Windows, or Linux without DOCA.\n- *\"What is DOCA? Where is the Flow programming guide? Which package\n  do I install?\"* — routing / orientation questions belong in\n  [`doca-public-knowledge-map`](../doca-public-knowledge-map/SKILL.md).\n- *\"How do I construct a Flow pipe / set up an RDMA queue / use Comch\n  to send a message?\"* — library-internal API questions belong in the\n  matching library skill (e.g.\n  [`doca-flow`](../libs/doca-flow/SKILL.md)).\n\n## What this skill provides\n\nThis is a **thin loader**. The body keeps only the orientation needed\nto pick the right next file. The substantive material lives in two\ncompanion files:\n\n- `CAPABILITIES.md` — what every DOCA program looks like in the\n  abstract: the shape of DOCA (host / DPU / switch, libraries / apps /\n  services / tools, build flavor selection rationale), the universal\n  program lifecycle, the unified version-compat rule that applies to\n  any program linking DOCA, the cross-library `DOCA_ERROR_*` taxonomy,\n  the program-side observability surface (DOCA logging, capability\n  snapshots), and the program-side safety policy that every library\n  skill inherits.\n- `TASKS.md` — step-by-step workflows for the six in-scope programming\n  verbs: `configure`, `build`, `modify`, `run`, `test`, `debug`. The\n  `## modify` verb owns the universal *derive a custom first app from\n  a sample* pattern that every DOCA library skill extends with\n  library-specific overrides; the `## build` verb owns the canonical\n  `pkg-config doca-<library>` build pattern in two language tracks\n  (C/C++ direct, non-C via FFI).\n\nThis skill assumes [`doca-setup`](../doca-setup/SKILL.md) has already\nproduced a clean install. It does **not** cover env preparation; that\nis `doca-setup`'s job, including the *no-install → NGC container\n(`nvcr.io/nvidia/doca/doca`)* fallback for users on macOS, Windows, or\nLinux without DOCA.\n\n## What this skill deliberately does not ship\n\nThis skill is **agent guidance**, not a samples or templates bundle.\nIt deliberately does not contain — and pull requests should not add:\n\n- **Pre-written DOCA application source code, in any language.** This\n  includes C / C++ files, Rust crates, Go packages, Python modules,\n  and wrapper code for any other language. The DOCA API surface\n  evolves between releases and code written from documentation prose\n  cannot be verified without compiling / linking / FFI-loading it\n  against the live library on a real install. The verified DOCA\n  application source code is the shipped C samples on the user's\n  installed system; the agent's job is to route the user to that file\n  and prescribe a minimum-diff modification on it\n  ([`TASKS.md ## modify`](TASKS.md#modify)) — for C/C++ users — or to\n  route non-C users to the public C ABI surface that their bindings\n  will call ([`TASKS.md ## build`](TASKS.md#build) Track 2), *not* to\n  author the wrapper.\n- **Standalone build manifests** (`meson.build`, `CMakeLists.txt`,\n  `Cargo.toml`, `setup.py`, `go.mod`, …) parked inside the skill. The\n  agent constructs the build manifest *in the user's project\n  directory* against the user's installed DOCA, where `pkg-config\n  --modversion doca-<library>` is the source of truth.\n- **A `samples/`, `bindings/`, or `reference/` subtree** of any kind.\n  A mock or incomplete artifact in this skill's tree, even one\n  labeled \"reference\", is misleading: users will read it as\n  buildable.\n\n## Loading order\n\n1. Read this `SKILL.md` first to confirm the user's question is a\n   programming-class question (not env, not routing, not library-API).\n2. **For the DOCA shape, the universal lifecycle, the cross-library\n   error taxonomy, the program-side observability surface, and the\n   safety policy that every library skill inherits, see\n   [CAPABILITIES.md](CAPABILITIES.md).**\n3. **For step-by-step programming workflows — `configure`, `build`,\n   `modify`, `run`, `test`, `debug` — see [TASKS.md](TASKS.md).**\n\nIf the user is asking for a *first app* in a specific library, walk\nthrough [`TASKS.md ## modify`](TASKS.md#modify) for the universal\ncopy-and-edit pattern, then hand off to the library skill (e.g.\n[`doca-flow`](../libs/doca-flow/SKILL.md)) for the library-specific values\nto swap.\n\n## Related skills\n\n- [`doca-public-knowledge-map`](../doca-public-knowledge-map/SKILL.md)\n  — public DOCA documentation routing and the on-disk layout of an\n  installed DOCA package. This skill defers all *\"where is X\n  documented\"*, *\"where on disk is Y\"*, and *\"how do I check the\n  installed version\"* questions to the knowledge-map.\n- [`doca-setup`](../doca-setup/SKILL.md) — env preparation, install\n  verification, env-class debugging, and the *I have no install yet*\n  procedure with the NGC container (`nvcr.io/nvidia/doca/doca`) as\n  the universal Stage-1 fallback for any user on macOS, Windows, or\n  Linux without DOCA. This skill assumes `doca-setup`'s preconditions\n  are already satisfied.\n- [`doca-flow`](../libs/doca-flow/SKILL.md) — DOCA Flow on BlueField.\n  Extends this skill's `## modify` (universal first-app derivation)\n  with the Flow-specific list of fields to swap."}