doca-programming-guide

Guides library-agnostic DOCA application development from shipped samples through build, test, and debug workflows.

3.2k|370|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/NVIDIA/skills --skill doca-programming-guide
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: doca-programming-guide
Source: https://github.com/NVIDIA/skills/tree/main/skills/doca-programming-guide
Command: npx skills add https://github.com/NVIDIA/skills --skill doca-programming-guide

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing a first DOCA application is hard because the SDK spans many libraries, build flavors, and a strict object lifecycle, and mistakes surface as cryptic DOCA_ERROR_* codes. This Skill gives agents the library-agnostic programming shape every DOCA program shares so they can derive, build, test, and debug applications correctly without inventing unverified code.

Core Features & Use Cases

  • First-app derivation: Copy a shipped sample from /opt/mellanox/doca/samples and apply a minimum-diff modification using a five-slot modify-schema, never authoring DOCA source from scratch.
  • Canonical build pattern: Wire pkg-config doca-<library> with meson for C/C++, or FFI/bindings against the public C ABI from Rust, Go, or Python.
  • Lifecycle and error guidance: Apply the universal cfg-create → init → start → use → stop → destroy lifecycle and decode any doca_error_t with doca_error_get_descr().
  • Use Case: A developer says "write my first DOCA Flow program" — the agent picks the smallest shipped sample, fills the modify-schema, builds with the trace flavor, validates before commit, and runs staged against one representor.

Quick Start

Ask your agent to help you write your first DOCA program by deriving it from a shipped sample and building it with pkg-config and meson.

Frequently Asked Questions about doca-programming-guide

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write my first DOCA application?

Start by copying the smallest shipped sample for your library from /opt/mellanox/doca/samples into a writable directory, then apply a minimum-diff modification of only the user-domain values. Build it with meson using the pkg-config doca-<library> module and run it staged against the smallest scope first.

How do I build a program that calls doca_rdma or doca_flow?

Declare the dependency in meson.build via the library's pkg-config module name, such as doca-flow or doca-rdma, rather than hand-typed link flags. Use the doca-<library>-trace module during development and switch to the release module for performance work.

Can I call DOCA from Rust, Go, or Python?

Yes, through FFI or bindings against the public C ABI, since DOCA ships only C samples. Use bindgen for Rust, cgo for Go, or cffi/ctypes for Python, and follow the same lifecycle and call order as the shipped C samples.

What does DOCA_ERROR_BAD_STATE mean?

DOCA_ERROR_BAD_STATE means the object is not in a state where the call is valid, usually because lifecycle calls were made out of order. Call doca_error_get_descr() for the exact descriptor and check your sequence against the cfg-create, init, start, use, stop, destroy lifecycle.

When should I not use this skill for DOCA questions?

Do not use it for install, hugepages, or pkg-config resolution problems, which belong to doca-setup, or for documentation lookup, which belongs to doca-public-knowledge-map. Library-internal API questions like Flow pipe topology belong to the matching library skill such as doca-flow.