AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The doca-debug skill provides a structured, cross-cutting methodology for investigating issues across the DOCA stack. It employs a layered ladder approach—moving from installation and versioning through build, link, and runtime phases—to isolate the root cause of failures. The skill emphasizes a read-only, evidence-first diagnostic process, guiding users to capture necessary state information before attempting any repairs. It acts as a central hub that coordinates with environment-specific and library-specific debug skills, ensuring that users follow a consistent path for log collection, verbosity configuration, and reporting to the NVIDIA DOCA Developer Forum.
What it does
- Provides a canonical layered ladder for isolating DOCA failures across install, build, link, and runtime.
- Guides users on how to increase verbosity for DOCA libraries and tools using standard environment variables.
- Defines the procedure for capturing reproducible state for bug reports and forum posts.
- Offers diagnostic steps for interpreting stack traces, core dumps, and container-specific observability.
- Routes users to specialized skills for environment-class or library-specific debugging.
- Enforces a disciplined, evidence-based approach to troubleshooting before applying speculative fixes.
When to use it
- When a build fails to compile or a link step cannot resolve doca_* symbols.
- When a runtime call returns a DOCA_ERROR_* code or a service behaves silently.
- When you need to increase log verbosity for a DOCA tool or library.
- When you need to capture a reproducible state for a support request or forum post.
- When you are analyzing a stack trace, valgrind output, or core dump from a DOCA application.
- When you need to determine if a symptom is caused by the environment, the build, or the runtime.
Advantages
- Prevents premature, speculative fixes by mandating evidence collection first.
- Standardizes the troubleshooting process across different DOCA libraries.
- Clearly separates cross-cutting debug logic from library-specific or environment-specific concerns.
- Provides a consistent path for escalating issues to the community forum.
- Reduces ambiguity by identifying the specific layer (install, link, runtime) where a failure occurs.
Usage examples
- “My linker is failing with undefined reference to doca_flow_init. What should I do?”
- The agent will identify this as a link-time failure and request specific pkg-config outputs and the full linker invocation to diagnose the version or build configuration mismatch.
- “How do I get more logs from my DOCA Flow program?”
- The agent will guide you through the log-level and trace-flavor surface to enable verbosity for the specific library.
- “I need to file a forum post for a DOCA issue. What info should I include?”
- The agent will provide the capture-a-reproducible-state workflow to ensure your forum post contains all necessary context for a resolution.
- “Hugepages are empty inside my DOCA container. Is this a bug?”
- The agent will explain container-specific debug constraints and help determine if this is an expected runtime behavior or an environment configuration issue.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/nvidia/doca-debug/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip doca-debug.zip -d .agents/skills
Documentation by NVIDIA
DOCA debug
Examples
"My DOCA build / link / runtime failed — which layer is it?" — this is in scope. Walk the layered ladder; do not jump to library-internal debug first.
"How do I turn up verbosity for any DOCA library or tool?" — use the log-level / trace-flavor surface, then capture state for a forum post.
Instructions
An undefined reference is a Link-layer symptom, not proof of a
missing library or an application-code defect. Before recommending edits,
request these observations from the same host/container and shell that
ran the failing build:
pkg-config --modversion doca-commonand the selected library's version; for Flow,pkg-config --modversion doca-flow.pkg-config --libs doca-<library>; for Flow,pkg-config --libs doca-flow.The actual failing compiler/linker invocation from the build log and its full error output.
pkg-configreports flags, not the command that failed.
If these outputs are missing, request them and pause before prescribing a
repair. Listing a check is not evidence that it passed. Do not append a
speculative fix, guessed -L/-l flags, predicted library filenames, or a
replacement compiler command to that capture request. Once evidence is
available, compare the original invocation with the complete observed
pkg-config output through the existing build system; do not hand-assemble
DOCA's version-dependent split libraries. Use ldd only if a relevant binary
was actually produced; a declaration in a header does not prove that a linked
shared object exports the symbol.
Follow doca-version/TASKS.md#configure for version coherence,
doca-programming-guide/TASKS.md#debug for the
environment-before-program investigation, and
doca-public-knowledge-map/SKILL.md for verified
install locations and public documentation. A bundle skill name is not an SDK
page slug: never construct a documentation URL from it. If no matching guide
has been verified, use the DOCA SDK index
and say the specific page is not yet confirmed.
Then follow TASKS.md for the staged investigation; later
phases are conditional on observed results, not instructions to guess a fix.
First reply when only a linker error is available (Flow example). Use this capture-only shape, adapting the library to the actual question:
This is a link-time failure. An undefined-symbol message does not tell us the installed version or which build setting is wrong. From the same host/container and shell as the failing build, please paste these outputs:
pkg-config --modversion doca-common pkg-config --modversion doca-flow pkg-config --libs doca-flowAlso include the actual failing linker invocation, full error output and whether the build ran on the host or in a container. Do not change flags, packages or source yet. Phases 3–5 are pending this evidence; no repair has been selected. Once the observations are available, we can compare them, choose one justified correction and rerun the original build. The link check is successful only when that build exits cleanly without the missing symbols; it does not establish runtime or hardware correctness.
End that first reply at the evidence request and pending decision. Do not add an example repair command after it, even with a disclaimer to verify it later.
Where to start: This skill is the canonical layered-ladder
reference both doca-setup/SKILL.md
and doca-programming-guide/SKILL.md
escalate to. If the symptom does not fit cleanly in env-class or
program-class, start at the tasks companion — the
full layered ladder lives there.
Example questions this skill answers well
The CLASSES of debug questions this skill is built to answer, each with one worked example.
"My DOCA build / link / runtime / program failed — which layer is it?" — worked example: "
ldsaysundefined reference to doca_flow_init— which layer?" Answered by the canonical layered ladder in the tasks companion (layer 4 = Link)."How do I turn up verbosity for any DOCA library or tool?" — worked example: "My DOCA Flow program is silent — where do I get more log output?" Answered by the trace-flavor / log-level surface in the capabilities companion
the run-with-verbosity workflow in the tasks companion.
"How do I capture state for a forum question or bug report?" — worked example: "I'd like to file a forum question with reproducible context — what should I include?" Answered by the capture-a-reproducible-state workflow in the tasks companion.
"What does this DOCA tool's output mean / which tool answers this?" — worked example: "
doca_capsreturned nothing for RDMA — does that mean unsupported?" Answered by the tool-vs-capability decision tree in the capabilities companioncross-link to
doca-caps/SKILL.md.
"I'm debugging inside the NGC container — what's observable?" — worked example: "
hugepagesis empty inside the container; is that a real problem or a container thing?" Answered by the container-specific debug constraints in the capabilities companionthe tasks companion layer 5 (Runtime).
"Where do I ask for help with this?" — worked example: "Where is the customer-facing DOCA forum and what should the post contain?" Answered by the Developer-Forum routing rule in the tasks companion plus
doca-public-knowledge-map/SKILL.md.
If the symptom is purely env-class, route to
doca-setup/SKILL.md; if purely
program-class, route to
doca-programming-guide/SKILL.md.
This skill is the cross-cutting layer both call into.
When to load this skill
Load this skill when the user is debugging anything DOCA-related — a build that won't compile, a link step that can't resolve a doca_* symbol, a runtime call that returns DOCA_ERROR_*, a packet that does not appear on the wire, a service that won't start, or a tool that returns no useful output. Concretely:
The user reports a symptom and needs to find the layer that caused it (install / version / build / link / runtime / program).
The user asks "how do I get more logs?" or "how do I turn up the verbosity?" for any DOCA library or tool.
The user wants to capture state for a forum question or an internal bug report (the bundle does not own the internal-bug-report channel; it routes to the public DOCA Developer Forum).
The user is reading a stack trace, a
valgrindoutput, or a core dump from a DOCA program and wants to know where to look first.The user is debugging inside the NGC DOCA container and needs to know what is and is not observable from inside it.
Do not load this skill for:
"What is
DOCA_ERROR_BAD_STATE?", "what error codes does DOCA return?" — that is the cross-library error taxonomy, owned bydoca-programming-guide/SKILL.md. This skill consumes that taxonomy; it does not redefine it."My
pkg-configcannot finddoca-flow", "hugepages are not mounted", "my representor isn't visible" — those are env-class symptoms, owned bydoca-setup/SKILL.md. This skill is the canonical pointer that env-class debug ladder redirects to once the symptom escalates beyond install / version / build prerequisites.Library-specific debugging (Flow pipe trace, RDMA queue-pair state, Comch channel statistics) — those live in the matching library skill (e.g.
doca-flow/SKILL.md). This skill provides the cross-cutting debug ladder; library skills layer their library-specific debug surface on top of it.
What this skill provides
This is a thin loader. The body keeps only the orientation needed to pick the right next file. The substantive debug material lives in two companion files:
the capabilities companion — what kinds of debug surface DOCA exposes: the layered debug model (install / version / build / link / runtime / program), the read-only-first stance, version-availability of debug tools (e.g.
doca_capssince DOCA 2.6.0), the cross-library error taxonomy (cross-link only — owned bydoca-programming-guide), the observability primitives DOCA emits (stderrlogs,--sdk-log-level, thedoca-<lib>-tracebuild flavor, library counters), and the safety constraints on debug actions (read-only first, don't mutate install tree mid-investigation).the tasks companion — the actual debug workflows:
## configure(set up env for high-verbosity debug),## test(capture a reproducible state),## debug(the canonical layered ladder, the universal entry point that every library## debugredirects to), and the Where to ask for help routing (NVIDIA DOCA Developer Forum). Three other anchors (build,modify,run) route todoca-programming-guide/SKILL.md, which owns those verbs after the env / program split.
Loading order
Read this skill first to confirm the user's symptom is cross-cutting debug (not env-class only, not program-class only, not library-internal only).
For the layered debug model, the read-only stance, the version-availability of debug tools, and the observability surface DOCA emits, see the capabilities companion.
For the canonical layered debug ladder and the capture-and-report workflow, see the tasks companion. The
build,modify, andrunanchors in the tasks companion are stubs that route todoca-programming-guide/SKILL.md; their substance lives there.If the user's symptom turns out to be env-class (install / build prerequisites), hand off to
doca-setup/SKILL.md. If program-class, hand off todoca-programming-guide/SKILL.md. If library-internal, hand off to the matching library skill's## debug(e.g.doca-flow/SKILL.md).
The two companion files cross-link to each other and to doca-public-knowledge-map/SKILL.md whenever the right answer is "look it up in the public docs or the installed package layout" rather than "debug-specific guidance".
Related skills
doca-public-knowledge-map/SKILL.md— public DOCA documentation routing and the on-disk layout of an installed DOCA package. This skill defers all "where is X documented", "where on disk is Y", and "how do I check the installed version" questions to the knowledge-map.doca-setup/SKILL.md— env-class debug (install / build prerequisites):pkg-configfailures, missing hugepages, representors not visible, header-vs-runtime version mismatches.doca-setup ## debugis the env-class layered ladder; this skill is the cross-cutting debug ladder both env and program ladders escalate to.doca-programming-guide/SKILL.md— program-class debug (lifecycle order,DOCA_ERROR_*interpretation,doca_error_get_descr()use, the validate-before-commit rule).doca-programming-guide ## debugis the program-class layered ladder; this skill picks up where it leaves off when the symptom involves cross-library tooling (gdb,valgrind, container introspection, core dumps).Library skills (e.g.
doca-flow/SKILL.md,doca-dms/SKILL.md,doca-caps/SKILL.md) — library-specific debug overlays. Each library's## debugbuilds on the cross-cutting ladder defined here, then adds its own counters, traces, and inspector tools.
Files
- ATTRIBUTION.mdAdded by AutoGineer888 B
- BENCHMARK.md9.8 KiB
- CAPABILITIES.md30.9 KiB
- LICENSELicence file added by AutoGineer11.2 KiB
- SKILL.md12.5 KiB
- TASKS.md31.8 KiB
- evals/evals.json3.1 KiB
- skill-card.md4.5 KiB
- skill.oms.sig4.9 KiB
CAPABILITIES.md
DOCA debug — capabilities, version compatibility, errors, observability, safety
Where to start: The 7-layer table in
## Capabilities and modes is the load-bearing
content of this file. Identify the layer first, then drill into the
matching section. The pattern overview below names the recurring debug
families across all 7 layers.
Read this file when the loader sent you here from SKILL.md. For the step-by-step workflows that use the surface described here, see TASKS.md. For env-class equivalents (install / build prerequisites, env-class errors, env observability), see doca-setup/SKILL.md. For program-class equivalents (the cross-library DOCA_ERROR_* taxonomy, doca_error_get_descr(), the universal lifecycle), see doca-programming-guide/SKILL.md. For where to find official documentation or the on-disk install layout, route through doca-public-knowledge-map/SKILL.md.
This file describes the shape of every DOCA debug surface — which kinds of debug exist, which version of DOCA exposes which surface, how DOCA reports errors that the agent must interpret, what DOCA emits that the agent can observe, and what safety constraints the agent must respect while debugging. Library-specific overlays (Flow pipe traces, RDMA queue-pair stats, Comch channel statistics, etc.) live in the matching library skill; this file is the cross-cutting reference they all build on.
Pattern overview
Every cross-cutting debug task this skill teaches resolves into one of FIVE patterns. Reach for the pattern first; the H2 below it carries the substance. The patterns are CLASSES — they apply across every DOCA library, service, and tool, regardless of which layer triggered.
| Pattern | Class shape | Where it lives |
|---|---|---|
| 1. Layer identification | Symptom → which of the 7 layers (install / version / build / link / runtime / program / driver) | ## Capabilities and modes 7-layer table |
| 2. Read-only-first capture | Capture the current state with no side effects before any mutation (gdb attach, mod reload, eswitch change, …) | ## Capabilities and modes read-only stance |
| 3. Verbosity escalation | Raise log levels / switch to trace flavor to make hidden state observable | ## Observability trace-flavor + --sdk-log-level |
| 4. Reproducer assembly | Package state + steps + versions so someone else (forum / colleague) can repro | TASKS.md ## test capture-a-reproducible-state |
| 5. Hand-off / escalation | When the symptom is library-internal, env-class, or needs upstream, route to the right next skill / channel | TASKS.md ## debug "Where to ask for help" + cross-skill routing |
Two cross-cutting rules:
Identify the layer before the tool. Running
gdbon a process that won't link, ordmesgon apkg-configfailure, is the most common waste of debug effort. The 7-layer table below is the layer-classifier the agent must consult first.Read-only before state-changing. Every layer has at least one read-only entry point (
doca_caps --list-devs,pkg-config --modversion,cat /proc/meminfo | grep Huge,ip link show). The state-changing actions (gdb attach, module reload, eswitch flip) come after the read-only picture is captured, never as the first move.
Capabilities and modes
DOCA debug is layered. Each layer has its own surface, its own tools, and its own kind of evidence. The agent must identify which layer the symptom belongs to before recommending any tool — running gdb on a process that won't link, or reading dmesg for a pkg-config failure, wastes the user's time and obscures the real problem.
| Layer | What goes wrong here | First evidence to capture | Owning skill |
|---|---|---|---|
| Install | Package missing, package incomplete, wrong arch, partial upgrade. | dpkg -l (Debian/Ubuntu) or rpm -qa (RHEL/Rocky) for doca-* packages; ls /opt/mellanox/doca for tree presence. | doca-setup ## debug (doca-setup/TASKS.md#debug) layers 1–2. |
| Version | Host-package version, BFB version, header version, runtime *.so version not aligned. | pkg-config --modversion doca-common, cat /opt/mellanox/doca/applications/VERSION, doca_caps --version. All three should agree. | doca-setup ## debug (doca-setup/TASKS.md#debug) layer 3 + doca-public-knowledge-map ## Where to find the version (doca-public-knowledge-map/SKILL.md#where-to-find-the-version). |
| Build | pkg-config cannot find module, header not found, missing experimental-API flag. | pkg-config --list-all | grep doca, the failing compile command, the exact error string. | doca-setup ## debug (doca-setup/TASKS.md#debug) layer 4 + doca-programming-guide ## build (doca-programming-guide/TASKS.md#build). |
| Link | undefined reference to doca_*; possible version skew, missing dependency or link-order error. Flow's shared-object split is release-dependent. | Actual failing linker invocation and error, pkg-config --modversion doca-common, selected-library version and pkg-config --libs doca-<library> from that build environment. ldd only for a relevant binary that actually exists. | This skill — see Link-time debug in TASKS.md ## debug. |
| Runtime | Program runs but does nothing on the wire, or returns DOCA_ERROR_* from a runtime call. | --sdk-log-level 70 (TRACE) + the trace build flavor; per-library inspector tools (doca-flow-tune, etc.). | This skill — see Runtime debug in TASKS.md ## debug. Library-specific overlays in matching library skill. |
| Program | Lifecycle out of order (e.g. start before init), DOCA_ERROR_BAD_STATE returned, validate-before-commit skipped. | doca_error_get_descr(err) quoted verbatim from the program's logs; the actual call sequence. | doca-programming-guide ## debug (doca-programming-guide/TASKS.md#debug). |
| Driver / firmware | DOCA_ERROR_DRIVER returned. The layer below DOCA reported failure. | dmesg | tail (kernel-side), mlxconfig -d <pci> q (firmware capability snapshot), devlink dev show. | doca-setup ## debug (doca-setup/TASKS.md#debug) layer 5 — DOCA cannot fix what the driver below it reports. |
The agent's rule: always start at the lowest layer the symptom is consistent with, not the highest. Most "first DOCA app" failures are install / version / build problems wearing the costume of a runtime error. A bad pkg-config returns a successful binary that fails to link; a header from one DOCA version compiled against a runtime from another version returns DOCA_ERROR_INVALID_VALUE from a call that should never fail.
Read-only entry points exist at every layer. Each layer above has at least one side-effect-free probe — doca_caps --list-devs, pkg-config --modversion doca-common, cat /proc/meminfo | grep Huge, ip link show. The capture-first, mutate-second discipline that governs when to run these versus the state-changing actions (gdb attach, kernel-module reload, eswitch-mode change) is owned by ## Safety policy item 1; this layer map only marks which probes are safe to run first.
Container vs native runtime. Inside the NGC DOCA container (doca-setup ## no-install (doca-setup/TASKS.md#no-install) Path 0), debug is constrained: the container can introspect its own process tree, its own logs, its own DOCA install — but it cannot read host kernel state (dmesg shows the container's view, which is empty for hardware events on the host) and it cannot see the host's network devices unless explicitly mapped in. For runtime symptoms involving real packets / real hardware, move to a native install (Path B/C), or write captures to an operator-approved host bind mount and extract existing logs/dumps with the container runtime's documented copy command. Do not add privileged device or host-filesystem mappings merely for debug. Debugging a Flow pipe in an unmapped container is build/link only.
Version compatibility
For the canonical DOCA version-detection chain, the four-way match rule, NGC container semantics, the headers-win-over-docs rule, and the routing to the DOCA Compatibility Policy, see doca-version/SKILL.md. The body lives there; this skill does not duplicate it.
The debug-side overlay is that debug tooling itself is versioned — a capability the agent reaches for may not exist on the user's installed train. The agent must quote the verified installed version (from doca-version TASKS.md ## configure (doca-version/TASKS.md#configure)) BEFORE recommending any debug surface below.
BFB-version probe ban (same as in doca-version). When the user's debug session is about a BFB / BlueField-Arm-side question (debug of a workload running on the DPU, BFB upgrade fallout, BlueField networking misconfiguration), the BFB-image DOCA version is read with bfver plus cat /etc/mlnx-release on the BlueField Arm console — NOT with mlxprivhost (configures privileged-host mode, not version) and NOT with bfb-info (not a real NVIDIA-documented tool). Both are common hallucinations even when the visible-but-wrong binary is on the host's /usr/bin/. See doca-version CAPABILITIES.md ## Capabilities and modes (doca-version/CAPABILITIES.md#capabilities-and-modes).
| Debug surface | First DOCA version it shipped in | Verification |
|---|---|---|
doca_caps CLI (capability snapshot, side-effect-free) | DOCA 2.6.0. | which doca_caps and doca_caps --version. Older trains: capability discovery had to go through the per-library API. See doca-caps/SKILL.md. |
doca-flow-trace pkg-config module (trace build flavor of Flow) | Available across recent DOCA trains; the runtime location of the trace *.so is documented in doca-setup CAPABILITIES.md ## Capabilities and modes (doca-setup/CAPABILITIES.md#capabilities-and-modes). | pkg-config --exists doca-flow-trace. Per-library trace flavors follow the same doca-<library>-trace pattern when they exist. |
| Flow Inspector Service (Flow-specific mirrored-flow debug surface) | Not covered by this bundle — the Flow Inspector Service is outside this bundle's scope; documented per the public Flow Inspector Service guide. | Route to the public docs via doca-public-knowledge-map/SKILL.md. |
doca-flow-tune tool (Flow visibility / analysis) | Alpha at the time of the public guide; may rev. | Listed in doca-public-knowledge-map ## DOCA tools (doca-public-knowledge-map/SKILL.md#doca-tools); verify on the user's install with which doca-flow-tune (or whatever the binary name is on their train). |
doca-bench (performance evaluation) | Listed in the public DOCA tools index. | See doca-public-knowledge-map ## DOCA tools (doca-public-knowledge-map/SKILL.md#doca-tools). |
DOCA_VERSION_MAJOR / MINOR / PATCH macros (in doca_version.h) | Header has been part of the public surface across recent trains. Use these macros in user code rather than parsing version strings. | grep -RH 'DOCA_VERSION_' "$(pkg-config --variable=includedir doca-common)/" to confirm presence on the user's install. |
The version string is descriptive, not predictive. Do not infer downstream patch lineage from the shape of a version string (e.g. "3.5.0 must contain every fix in 3.2.3 (LTS)" — LTS trains backport bug fixes on their own cadence and may release later than a numerically-higher GA). Mixing GA and LTS trains is a doca-version TASKS.md ## debug (doca-version/TASKS.md#debug) layer-2 diagnosis, not a debug-tooling question.
Error taxonomy
The cross-library DOCA_ERROR_* taxonomy is owned by doca-programming-guide CAPABILITIES.md ## Error taxonomy (doca-programming-guide/CAPABILITIES.md#error-taxonomy). This skill does not redefine it; it only adds the debug-side framing the agent needs when interpreting an error from logs.
Three rules every debug session must follow:
Quote
doca_error_get_descr(err)verbatim. Every DOCA library exposes this function. Its return is the library's own canonical statement of what went wrong; never paraphrase it from memory or invent a description from the error name. If the user's program does not log the descriptor, instrument it (seedoca-programming-guide ## modify(doca-programming-guide/TASKS.md#modify) for how to add diagnostics to a sample) before forming any hypothesis.Map the error family to the right debug layer. A
DOCA_ERROR_INVALID_VALUEis a program bug (wrong argument); aDOCA_ERROR_BAD_STATEis a lifecycle bug (wrong call order); aDOCA_ERROR_NOT_SUPPORTEDis a capability bug (this hardware/firmware can't); aDOCA_ERROR_DRIVERis a layer-below-DOCA bug. The taxonomy indoca-programming-guide CAPABILITIES.md ## Error taxonomynames which family routes to which layer; this skill's## debugladder consumes that mapping.Never paper over an error with a retry loop.
DOCA_ERROR_TIME_OUTmay genuinely be timing-related, but any retry must use a documented operation-specific bound and backoff; if no bound is documented, do not retry automatically. Once that bound is exhausted, capture the unchanged result and advance the debug loop.DOCA_ERROR_INVALID_VALUE,DOCA_ERROR_BAD_STATE,DOCA_ERROR_NOT_SUPPORTED,DOCA_ERROR_INITIALIZATION, andDOCA_ERROR_DRIVERwill not become success on retry. Retrying these masks the bug and produces logs that are harder to debug than the original failure.
The env-class error surface (missing *.pc, hugepages not mounted, representor not visible) is separate and lives in doca-setup CAPABILITIES.md ## Error taxonomy (doca-setup/CAPABILITIES.md#error-taxonomy). The debug ladder always starts at the env layer; do not begin program-side debug until the env-side errors are clear.
Observability
DOCA emits a fixed observability surface that every library inherits and every library can extend. The agent's job in any debug session is to turn the surface up before forming hypotheses — most "I can't see what's happening" symptoms are a default log level too low, not an actual missing surface.
The cross-library logging surface. DOCA libraries log via the doca_log_register_* API and emit to stderr by default. The verbosity is controlled by one of:
The CLI flag
--sdk-log-level <level>on any DOCA tool / sample / application that accepts it.The environment variable
DOCA_LOG_LEVELfor programs that read it (verify in the program; not all do).The programmatic call
doca_log_backend_set_sdk_level(<level>)from inside the program.
Log levels (numeric, on the public Programming Guide):
10=DOCA_LOG_LEVEL_DISABLE,20=DOCA_LOG_LEVEL_CRIT,30=DOCA_LOG_LEVEL_ERROR,40=DOCA_LOG_LEVEL_WARNING— quieter than INFO.50=DOCA_LOG_LEVEL_INFO— quiet, production default.60=DOCA_LOG_LEVEL_DEBUG— useful debug detail.70=DOCA_LOG_LEVEL_TRACE— every call traced; the right setting for any first run of any new code path and for any debug session whose first hypothesis is "I don't see enough."
For a side-effect-free smoke-test entry point (when the agent wants to confirm DOCA is callable without doing anything visible), prefer doca_log_* over a real lifecycle call. Logging initialization is harmless and exercises the library binding without touching hardware.
The trace build flavor. Linking a library against pkg-config doca-<library>-trace (instead of doca-<library>) selects the trace flavor of that library, which adds runtime input-sanitation and emits additional log lines at DEBUG / TRACE level. The release flavor does not emit those lines no matter how high you set --sdk-log-level, because the additional checks aren't compiled in. Use the trace flavor during development and any debug session; switch to release for performance measurements (see ## Safety policy).
Capability snapshots. doca_caps (the CLI tool, see doca-caps/SKILL.md) is a side-effect-free snapshot of "what DOCA sees on this host right now." Capture it at the start of any debug session — capabilities can change between runs (firmware reflash, eswitch mode change, kernel-module reload), and a stale capability picture is a leading cause of "it worked yesterday."
Library-specific surfaces. Pipe counters (Flow), queue-pair statistics (RDMA), channel send/recv counters (Comch), tracing dumps (per library), and inspector tools (doca-flow-tune) are owned by the matching library skill. The library skill names the call (e.g. doca_flow_resource_query_entry) and the right cadence to query it.
Standard Linux observability the agent can reach for alongside DOCA. Read-only and always available on a healthy install:
dmesg | tail -100— kernel-side device events,mlx5_coredriver messages, link state changes.journalctl -u <service> -e— for DOCA services (DMS, DTS, etc.) running under SystemD.ip link show,ip addr show,ethtool <iface>,devlink dev show— interface and device visibility.cat /proc/meminfo | grep Huge,mount | grep huge— hugepage state.ldd /path/to/binaryonly for a relevant existing binary;nm -D <observed-shared-object-path>for exports of a shared object actually identified on the target install. Do not infer either artifact from a header declaration or a guessed install path.lsmod | grep mlx,modinfo mlx5_core— kernel-module state.strace -e trace=openat -f <command>— what files the program is trying to open (catches missing-config-file failures fast).
Service log paths. DOCA services configure their own log destinations (not always stderr). Check /var/log/doca*, /var/log/syslog, or the service's own README before assuming output is missing.
Universal debug-loop contract
Every investigation of a symptom (build error, link error, runtime error, DOCA_ERROR_*, segfault, hang, "does nothing on the wire", "counter didn't increment", "my program is misbehaving") MUST follow the 5-phase debug-loop contract below. These are evidence-dependent phases of the investigation, not five actions to execute in every reply. A first reply without captures identifies the layer, requests the applicable observations and marks phases 3–5 pending evidence. That is a complete first response, not a refusal to help. Later replies resume only when the required observations arrive. This is the bundle-wide contract that every per-library ## debug redirects to; debug is iterative, not a fabricated single-shot fix.
Evidence gate between phases 2 and 3. A requested capture is not an
observed capture. If results are missing, stop at the read-only request and
explain the pending decision; do not complete the five phases with hypothetical
outputs or a speculative repair. For a link-only symptom, the capture is the
failing build invocation/error, its host/container environment and observed
DOCA versions/pkg-config flags. Runtime traces and ldd of a nonexistent
binary are not substitutes. A read-only query is an observation, not the
single-variable mutation in phase 3.
| Phase | What the agent must do | Why this phase exists | Forbidden shortcut |
|---|---|---|---|
| 1. Layer identification | Name the lowest layer in the 7-layer ladder from ## Capabilities and modes the symptom is consistent with (install / version / build / link / runtime / program / driver). Cite the layer by name. Identification is mechanical: an undefined reference to doca_* is initially classified as layer 4 (Link), regardless of the user's interpretation, but the mandatory version-chain capture in phase 2 must rule out layer-2 skew before any link-line mutation. | Most "first DOCA app" failures are install / version / build / link problems wearing the costume of a runtime error. Starting at the highest plausible layer is the single most expensive debug mistake. | Starting at runtime ("let's add print statements") when a build/link layer has not been ruled out. |
| 2. Read-only capture (the triple) | Capture the triple from TASKS.md ## test step 3 at the failed layer, before any mutation. Build/link: (a) actual failing compiler/linker invocation and full error output; (b) the host/container, OS/architecture and existing build-tool context; (c) pkg-config --modversion doca-common, pkg-config --modversion doca-<library> and pkg-config --libs doca-<library>. A symbol name alone is not installed-version evidence. Do not request program traces or ldd when no relevant binary exists. Runtime: (a) program stderr and supported --sdk-log-level 70 trace; (b) relevant system/service logs such as dmesg | tail -200 or journalctl --since "5 min ago"; (c) version evidence and doca_caps --list-devs when device capabilities are involved. Name the applicable commands and record unavailable evidence instead of replacing it with assumptions. Absent-doca_caps rule for (c). If doca_caps is not on PATH where pkg-config --modversion doca-common succeeds, record doca_caps absent (partial install — see doca-version CAPABILITIES.md ## Version compatibility). A per-library C capability probe may substitute only when that exact probe already exists in an installed shipped sample or the user's existing program; run it unchanged or with the sample's documented arguments. Never generate probe code from an API-name pattern. If no existing probe/sample is present, the capability view remains unavailable and the session routes to doca-setup ## configure (doca-setup/TASKS.md#configure) to install the documented tools/samples component or repair the install before capability-dependent diagnosis continues. If pkg-config --modversion doca-common also fails, record the exact probe failure as the DOCA view, classify the install as absent or broken, and route to layer 1; do not compile a fallback probe or fabricate capability data. | A hypothesis formed without the captured triple is a guess. The triple is the artifact the rest of the loop iterates on; without it the agent cannot tell what changed. | Forming a hypothesis from the user's prose description alone, without the triple in hand. Inventing doca_caps output or generating replacement C probe code when the binary is absent. |
| 3. Single-variable hypothesis change | Pending evidence if any required phase-2 result is missing; do not select a repair yet. Otherwise, use the observed results to justify exactly one mutation at the identified layer (one confirmed dependency-wiring correction, one log-level change or one lifecycle reorder). Name the observation supporting that change. Running a version/dependency/capability query is capture, not a mutation. If the user is the operator, the agent prescribes the single mutation; if the agent is the operator, it applies and pauses. | Multi-variable changes destroy the ability to attribute the result. A session that mutates three things and the symptom disappears has not learned which mutation was the fix and is not done. | Bundling several mutations into one "try these" list and asking the user to report back if any of them worked. |
| 4. Re-capture and compare | Re-run the exact same triple from phase 2. Compare against the baseline capture. There are three possible outcomes: (a) symptom unchanged — the hypothesis was wrong or the layer was wrong; go to phase 5 outcome unchanged; (b) symptom shape changed — the mutation took effect; go to phase 5 outcome shape-changed; (c) symptom resolved — the green signal appears; go to phase 5 outcome resolved. | The mutation is not evidence — the re-capture is. Without the side-by-side compare, the agent cannot distinguish "the fix worked" from "the symptom was already intermittent." | Asking the user "did it work?" without re-running the same capture commands. |
| 5. Exit condition or loop | Resolve to one of three exits: (a) resolved — name the green signal (the specific metric / log / counter / status field that confirms healthy state, per the universal verification contract step 5); the session is done; (b) shape-changed — loop back to phase 1 with the new symptom (a layer-3 fix often unmasks a layer-5 symptom; re-identify the layer for the new picture, do not assume the prior layers are still clean); (c) unchanged — loop back to phase 1, the layer was wrong; try the next-lowest layer the symptom is consistent with. If the ladder exhausts at layer 7 (driver/firmware) with no green signal, escalate to the DOCA Developer Forum (see TASKS.md ## debug "Where to ask for help") with the captured triples from every iteration. | The most common failure mode is declaring done at phase 3 ("I applied the fix") without re-capturing in phase 4 and without naming the green signal in phase 5. "I applied the fix" is not a green signal; the named metric reading the expected value is. | Declaring the bug fixed after the mutation is applied, without re-capturing the triple and without naming what "green" looks like. |
Termination invariant. An unchanged result advances strictly to
the next plausible layer toward layer 7. A shape-changed result may
restart at layer 1 only when the re-captured triple is materially
different from the prior triple; otherwise it is unchanged. Never
revisit the same (symptom, layer, triple) state. If a sequence of
shape changes returns to a previously captured state, stop and
escalate with the cycle's captures rather than looping again.
Stacking rule. When a per-library ## debug anchor is loaded (e.g. doca-flow ## debug (doca-flow/TASKS.md#debug)), the library-specific overlay layers on top of the universal contract — it does not replace it. The agent runs both: the universal 5 phases as the spine, the library-specific overlay as the per-phase instantiation (e.g. for Flow: phase 2's DOCA view also includes the doca_flow_query_pipe_miss / doca_flow_query_entry / doca_flow_shared_resources_query counter family — not a synthesized doca_flow_aggr_query; the lib's CAPABILITIES.md ## Observability enumerates the actual counter family for that release).
Cross-cutting layering. When doca-version is also loaded (see the activation triggers in bundle AGENTS.md#cross-cutting-overlay-activation-triggers), phase 2 (Read-only capture) MUST include the four-source detection chain from doca-version CAPABILITIES.md ## Capabilities and modes (doca-version/CAPABILITIES.md#capabilities-and-modes) in the DOCA view, not just pkg-config --modversion. When doca-hardware-safety is also loaded, phase 3 (Single-variable hypothesis change) is constrained: any mutation that touches hardware state (kernel-module reload, eswitch flip, hugepage change, PCIe rebind, mlxconfig write) must follow the pre-flight inventory → apply → verify → rollback discipline from doca-hardware-safety TASKS.md ## configure (doca-hardware-safety/TASKS.md#configure); a single-variable hypothesis that lacks a documented rollback is forbidden, not deferred.
Relationship to the verification contract. The debug-loop contract and the universal verification contract (doca-setup/CAPABILITIES.md#universal-verification-contract) are siblings. Verification is "I am applying a change; how do I prove it worked?" — the loop terminates when the green signal appears at production scale. Debug is "the system is misbehaving; how do I find the cause?" — the loop terminates when the green signal appears at the smallest reproducible scope. Both end at the same kind of named, observable signal; both refuse "done" without one.
Safety policy
Debug actions can themselves change the system. The agent must distinguish read-only debug from state-changing debug, and follow a capture-first, mutate-second discipline.
Always capture state before mutating it. Before changing a log level, attaching
gdb, reloading a kernel module, or modifying any environment, run the read-only snapshot first:doca_caps --list-devs,pkg-config --modversion doca-common,dmesg | tail -100,mount | grep huge,ip link show. Save the output. Mutation is allowed after this snapshot exists, never before.Do not modify the install tree (
/opt/mellanox/doca/lib*/) during debug. It is the release. Build flavor changes go viaLD_LIBRARY_PATHor the-tracepkg-configmodule, never by editinglib/. If you find yourself wanting to patch a.soto debug it, stop — the symptom is not in the.so(which is the same binary every other DOCA user has); it's in the program's interaction with it.gdbattach pauses the process. A debugger that stops at a breakpoint can starve a watchdog, miss a heartbeat, drop a network connection, or confuse a peer that expects timely responses. For server-class workloads, prefer non-pausing observability (logs, traces, counters) and reach forgdbonly when those are exhausted. For client-class workloads, attaching is fine; just be aware the wall-clock view will lie.The trace build flavor has measurable overhead. It is invaluable while learning the API surface and during any active debug session, but it adds runtime cost that distorts performance measurements. Switch back to the release flavor (
pkg-config doca-<library>without the-tracesuffix) before any performance reading is taken seriously, and document the switch.Core dumps may contain sensitive payload data. A
gcoreor post-crash dump from a DOCA program processing real traffic includes packet contents in the program's memory. Treat dumps as confidential by default; do not paste them into public forum posts without redaction.Container debug cannot see the host kernel. The container-vs-native introspection limit — in-container
dmesg/journalctl//sysreturn the container's view, not the host's — is described in## Capabilities and modesunder Container vs native runtime. The safety consequence: for any symptom about a device disappearing or an interface dropping, reach a host shell (or the container's host-side companion tooling) before forming hardware-event hypotheses, or debugging from inside the container will mislead.Env mutations are global. Hugepage changes, eswitch mode changes,
mlxconfigresets, BFB updates — all are global system state and may affect other users / other tenants on the same machine. The env-side rules indoca-setup CAPABILITIES.md ## Safety policy(doca-setup/CAPABILITIES.md#safety-policy) bind every debug session; no debug action overrides them. If the user must change global state to reproduce a symptom, document the change, capture the before/after, and revert as soon as the reproduction is complete.Public forum posts must respect the public-sources contract. The DOCA Developer Forum (https://forums.developer.nvidia.com/c/infrastructure/doca/370) is the right escalation channel when the bundle's debug ladder runs out. When helping the user file a forum post, ensure the post does not include internal NVIDIA hostnames, internal package mirror URLs, internal build numbers, or anything that contradicts ground rule #1 in bundle
AGENTS.md. Customer-facing public artifacts only.
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.
The author says: No DOCA install required to read this skill (it is an overlay loaded against any DOCA artifact skill); the validation steps within DO require a live DOCA install at /opt/mellanox/doca.
Security
What our scanner noticed· Medium risk
- Large base64-encoded blobs
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
- Publisher
- NVIDIA (Official)
- Source
- NVIDIA/skills · skills/doca-debug · 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.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download doca-debug.zip