Generated banner for Doca Gpunetio
Generated logo for Doca Gpunetio

Doca Gpunetio

NVIDIAOfficialCreated by NVIDIA

  • Skill
  • Tool integration
  • Software development
  • Apache-2.0
  • Medium risk

From the author

Use this skill when the user is doing hands-on DOCA GPUNetIO programming — wiring a CUDA kernel on an NVIDIA GPU to a doca-eth queue via doca_gpu_eth_rxq / doca_gpu_eth_txq, standing up the per-CUDA-device doca_gpu context, designing the persistent CUDA kernel that drains the GPU-visible queue, running the dual capability check (DOCA cap-query plus cudaGetDeviceProperties), registering cudaMalloc pools via doca_buf_arr_create_*, or debugging DOCA_ERROR_* returns from the GPUNetIO API. Trigger even when the user does not explicitly mention "DOCA GPUNetIO" or "persistent kernel" — typical implicit phrasings include "CUDA kernel reading packets directly from the NIC", "GPU-initiated networking on BlueField", "DOCA_ERROR_DRIVER on doca_gpu_create", "nvidia_peermem not loaded", "kernel-per-packet is too slow", or "which GPU supports GPU-side packet I/O". Refuse and route elsewhere for general CUDA programming, DOCA Ethernet queue bring-up, DOCA DPA, or DOCA install — those belong to other skills.
— the description by NVIDIA

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides specialized support for developers building applications that use the DOCA GPUNetIO library. It focuses on the integration between host-side C/C++ code and device-side CUDA kernels, specifically for scenarios involving GPU-initiated networking on BlueField DPU or ConnectX NIC environments. The skill covers the lifecycle of GPU-visible network queues, persistent kernel design, memory registration, and capability verification across both DOCA and CUDA layers.

What it does

  • Assists in wiring CUDA kernels to doca_gpu_eth_rxq and doca_gpu_eth_txq handles.
  • Guides the setup of per-CUDA-device doca_gpu contexts.
  • Provides patterns for persistent CUDA kernels that process packets directly from NIC queues.
  • Supports dual capability checking using DOCA cap-query and cudaGetDeviceProperties.
  • Details the registration of cudaMalloc pools via doca_buf_arr_create_*.
  • Helps diagnose and debug DOCA_ERROR_* codes specific to the GPUNetIO API.

When to use it

  • When developing applications that require direct packet processing on an NVIDIA GPU.
  • When troubleshooting GPUNetIO setup failures like DOCA_ERROR_DRIVER or missing nvidia_peermem.
  • When verifying compatibility between specific DOCA versions and CUDA toolkit versions.
  • When implementing the GPU Packet Processing reference application pattern.
  • When needing to resolve errors during the initialization of GPU-visible network queues.

Advantages

  • Provides a clear, structured approach to complex GPU-NIC integration tasks.
  • Ensures adherence to the DOCA Compatibility Policy for hardware and software versions.
  • Offers a systematic debugging framework for layered DOCA and CUDA errors.
  • Maintains a clean separation between GPUNetIO logic and general DOCA or CUDA programming.

Usage examples

“How do I get a CUDA kernel to receive packets directly from the NIC?”
The agent provides the persistent-kernel pattern and the GPU-side bring-up workflow to link a doca_gpu_eth_rxq to your CUDA kernel.
“Why does my GPUNetIO setup fail with DOCA_ERROR_NOT_SUPPORTED?”
The agent guides you through checking environment preconditions, specifically verifying if nvidia_peermem is loaded and GPUDirect RDMA is enabled.
“Can I run GPUNetIO on this GPU?”
The agent instructs you to perform a dual capability check using DOCA cap-query and cudaGetDeviceProperties to confirm hardware support.
“How do I move data between CUDA-allocated buffers and a DOCA queue?”
The agent explains the process of using cudaMalloc for buffer pools and registering them with DOCA via doca_buf_arr_create_* before starting the context.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/nvidia/doca-gpunetio/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip doca-gpunetio.zip -d .agents/skills

Documentation by NVIDIA

DOCA GPUNetIO

Examples

  • "CUDA kernel reading packets directly from the NIC." — this is in scope. Stay on doca_gpu_eth_rxq / _txq and the persistent kernel; do not rewrite it as host-CPU Ethernet.

  • "DOCA_ERROR_DRIVER on doca_gpu_create." — check CUDA device match and dmabuf / nvidia-peermem registration before changing queue type.

Instructions

Follow Loading order below. Open the tasks companion for configure / build / run. Open the capabilities companion for GPU vs host path selection. Do not open every companion file.

Where to start: This skill assumes DOCA is already installed, the CUDA toolkit is installed and matched to the DOCA install, and the user is doing hands-on GPUNetIO work — i.e. wiring a DOCA network queue into a CUDA kernel on an NVIDIA GPU. Open the tasks companion if the user wants to do something (configure / build / modify / run / test / debug); open the capabilities companion when the question is what can GPUNetIO express on this version + this GPU. If the user has not installed DOCA yet, route to doca-setup/SKILL.md first; if the user has not set up the underlying Ethernet RX/TX queues yet, that is a DOCA Ethernet question — route to doca-eth/SKILL.md.

Example questions this skill answers well

The CLASSES of GPUNetIO questions this skill is built to answer, each with one worked example. The agent should treat the class as the load-bearing piece — the worked example is a single instance.

  • "How do I get a CUDA kernel to receive packets directly from the NIC?" — worked example: "persistent kernel on one GPU reads packets from a doca_gpu_eth_rxq built on top of a representor doca_eth_rxq and counts them per-flow". Answered by the persistent-kernel pattern in

    Capabilities and modes

    • the GPU-side bring-up workflow in

    configure.

  • "Can I run GPUNetIO on this GPU?" — worked example: "my host has one Ampere card and one Turing card; which one supports GPU-initiated networking?". Answered by the dual capability-discovery rule (DOCA cap-query AND cudaGetDeviceProperties against the CUDA device ordinal) in

    Capabilities and modes

    • the device-enumeration step in

    configure.

  • "Why does my GPUNetIO setup fail with DOCA_ERROR_NOT_SUPPORTED even though doca-eth came up fine?" — worked example: "nvidia_peermem is not loaded so GPUDirect RDMA is unavailable". Answered by the env preconditions in ## Safety policy

    • the env checklist in

    configure step 1.

  • "How do I move data between CUDA-allocated buffers and a DOCA queue?" — worked example: "use cudaMalloc for the receive buffer pool and register it with DOCA via doca_buf_arr_create_* before starting the context". Answered by the CUDA-allocator

    • DOCA-registration overlay in

    Safety policy

    • the buffer-prep step in

    configure step 4.

  • "Is the GPUNetIO API I'm reading about on my installed DOCA + CUDA combination?" — worked example: "is the persistent-kernel helper available with the CUDA toolkit version I have?". Answered by the version-compatibility overlay in

    Version compatibility

    which cross-links the canonical detection chain in doca-version/SKILL.md and adds the GPUNetIO-specific DOCA must match CUDA overlay.

  • "What does this DOCA_ERROR_* from a GPUNetIO call mean and which layer caused it?" — worked example: "DOCA_ERROR_DRIVER on doca_gpu_*_create — is it DOCA, CUDA, or the underlying doca-eth queue?". Answered by the GPUNetIO overlay on the cross-library taxonomy in

    Error taxonomy

    • the layered ladder in

    debug that escalates to

    doca-debug/SKILL.md.

Audience

This skill serves external developers building applications that consume the DOCA GPUNetIO library — i.e., users whose code calls doca_gpu_* from host C/C++ to stand up the per-GPU context and the GPU-visible queue handles, and whose CUDA kernel (.cu translation unit) uses those handles from device code to submit / receive packets. The canonical target shape is the GPU Packet Processing reference application: a CUDA persistent kernel on an NVIDIA GPU that polls a GPU-visible RX queue and processes packets in-place on the GPU. It is not for NVIDIA developers contributing to DOCA GPUNetIO itself.

Language scope. DOCA GPUNetIO ships as a C / CUDA library with pkg-config module name doca-gpunetio. The host-side API is C; the device-side API is CUDA C++ used inside a .cu kernel. The shipped samples and the GPU Packet Processing reference application are written in C + CUDA C++ (NVIDIA's choice). Other-language consumers are limited in practice — the device-side API has no FFI escape hatch because the kernel must be a CUDA translation unit — but a Rust / Go / Python host-side wrapper that drives the host-side doca_gpu_* setup and launches a CUDA kernel built separately is still useful, and the skill keeps the lifecycle, capability-discovery, env-precondition, and error-taxonomy guidance language-neutral.

When to load this skill

Load this skill when the user is doing hands-on DOCA GPUNetIO work, in any host language plus CUDA. Concretely:

  • Initializing a doca_gpu against a specific CUDA device ordinal on a host with one or more NVIDIA GPUs.

  • Creating a GPU-visible queue handle (doca_gpu_eth_rxq, doca_gpu_eth_txq) on top of an existing doca_eth_rxq / doca_eth_txq from DOCA Ethernet, and passing the handle into a CUDA kernel for device-side use.

  • Writing or modifying the persistent CUDA kernel that drains the GPU-visible RX queue in a long-running loop (the canonical GPU Packet Processing shape).

  • Allocating GPU buffers via cudaMalloc and registering them with DOCA via the doca_buf_arr_create_* family before doca_ctx_start().

  • Checking which GPUNetIO features are supported on the active doca_devinfo (DOCA cap-query family) AND on the candidate CUDA device (cudaGetDeviceProperties and CUDA-driver-version checks).

  • Debugging a DOCA_ERROR_* returned from a GPUNetIO call — in particular disambiguating DOCA capability missing from CUDA device too old from nvidia_peermem not loaded from CUDA driver + DOCA version skew.

  • Designing host-side bindings for non-C languages that drive a CUDA kernel they built separately — the env-precondition and capability-discovery rules in this skill still apply.

Do not load this skill for general DOCA orientation, install of DOCA or the CUDA toolkit, the underlying DOCA Ethernet queue setup, or non-GPUNetIO library questions. For those, route through doca-public-knowledge-map/SKILL.md to the matching upstream guide.

What this skill provides

This is a thin loader. The body keeps only the orientation needed to pick the right next file. The substantive GPUNetIO-specific material lives in two companion files:

  • the capabilities companion — what GPUNetIO can express on this version

    • this GPU: the doca_gpu per-device context, the GPU-visible RX / TX queue handles layered on doca-eth, the persistent CUDA-kernel pattern as the default usage shape, the capability-query surface (the doca-eth doca_eth_rxq_cap_is_type_supported / doca_eth_rxq_cap_get_* family in doca_eth_rxq.h, plus the matching doca_eth_txq_cap_* family, on the DOCA side, plus cudaGetDeviceProperties on the CUDA side), the GPUNetIO error taxonomy mapped onto the cross-library DOCA_ERROR_* set, the observability surface (CUDA-side counters + DOCA-side per-task completion), and the safety policy that gates env preconditions (CUDA + DOCA version match, dmabuf or nvidia-peermem registration).

  • the tasks companion — step-by-step workflows for the six in-scope GPUNetIO verbs: configure, build, modify, run, test, debug. Plus a ## rollback overlay (GPUNetIO-specific five-step teardown that signals the persistent kernel to drain, unregisters GPU buffers in reverse-register order, and leaves the parent doca-eth queue intact) and the 5-phase universal debug-loop instantiation appended to ## debug. Plus a Deferred task verbs block that points out-of-scope questions at the right next skill.

The skill assumes a host where DOCA is already installed at the standard location, an NVIDIA GPU is physically present, the CUDA toolkit is installed and its version is matched to the DOCA install per the DOCA Compatibility Policy, and the underlying DOCA Ethernet RX/TX queues are already configured (this skill sits on top of doca-eth, not below it). It does not cover installing DOCA or the CUDA toolkit — that path goes through doca-setup/SKILL.md.

What this skill deliberately does not ship

This skill is agent guidance, not a samples or templates bundle. To keep the boundary clean, it deliberately does not contain — and pull requests should not add:

  • Pre-written DOCA GPUNetIO application source code or CUDA kernel source, in any language. The verified GPUNetIO source is the shipped C + CUDA samples at /opt/mellanox/doca/samples/doca_gpunetio/ and the GPU Packet Processing reference application. The agent's job is to route the user to those files and prescribe a minimum-diff modification on them via the universal modify-a-sample workflow in doca-programming-guide/SKILL.md, layered with the GPUNetIO-specific overrides in

    modify.

  • Standalone build manifests (meson.build, CMakeLists.txt, …) parked inside the skill. The agent constructs the build manifest in the user's project directory against the user's installed DOCA + CUDA toolkit, where pkg-config --modversion doca-gpunetio, pkg-config --modversion doca-common, and nvcc --version form the version gate.

  • A samples/, bindings/, or reference/ subtree of any kind. A mock or incomplete artifact in this skill's tree, even one labeled "reference", is misleading: users will read it as buildable.

Loading order

  1. Read this skill first to confirm the user's question is in scope.

  2. For the GPUNetIO capability matrix, the doca_gpu per-device context, the persistent-kernel pattern, the dual capability query, the env-precondition policy, the error taxonomy, the observability surface, and the safety policy, see the capabilities companion.

  3. For step-by-step workflows — configure, build, modify, run, test, debug — see the tasks companion.

Both companion files cross-link to each other, doca-version/SKILL.md for the canonical DOCA version-handling rules (with the GPUNetIO overlay that DOCA must match CUDA), and doca-public-knowledge-map/SKILL.md whenever the right answer is "look it up in the public DOCA GPUNetIO guide, the DOCA Compatibility Policy, the CUDA toolkit docs, or the on-disk install layout" rather than "GPUNetIO-specific guidance".

  • doca-public-knowledge-map/SKILL.md — the routing table for every public DOCA documentation source and the on-disk layout of an installed DOCA package. The GPUNetIO public guide is at https://docs.nvidia.com/doca/sdk/DOCA-GPUNetIO/index.html; the GPU Packet Processing reference application is reachable from there. The CUDA toolkit and DOCA Compatibility Policy links live in the same routing table.

  • doca-setup/SKILL.md — env preparation, install verification, CUDA toolkit install / verification, and the I have no install yet path with the public NGC DOCA container. This skill assumes its preconditions are satisfied AND that CUDA is installed at a version that matches DOCA.

  • doca-version/SKILL.md — canonical DOCA version-handling rules. This skill's ## Version compatibility cross-links the four-way match rule and adds the GPUNetIO-specific DOCA-and-CUDA must match overlay per the DOCA Compatibility Policy.

  • doca-structured-tools-contract/SKILL.md — the bundle's structured-tools precedence rule (detect / prefer / fall back / report). The Command appendix in the tasks companion honors this contract.

  • doca-programming-guide/SKILL.md — general DOCA programming patterns shared by every library: the canonical pkg-config + meson build pattern, the universal modify-a-shipped-sample first-app workflow, the universal lifecycle, the cross-library DOCA_ERROR_* taxonomy, and the program-side debug order. This skill layers GPUNetIO specifics on top.

  • doca-debug/SKILL.md — the cross-cutting debug ladder (install / version / build / link / runtime / program / driver). GPUNetIO-specific debug (CUDA + DOCA version skew, nvidia_peermem missing, persistent-kernel silent hangs, CUDA-allocator + DOCA-registration mismatches) overlays on top of that ladder.

DOCA Ethernet is GPUNetIO's mandatory companion library: GPU-visible RX / TX queue handles are layered on top of doca_eth_rxq / doca_eth_txq from DOCA Ethernet. For the underlying queue setup, route to doca-eth/SKILL.md.

Files

CAPABILITIES.md

DOCA GPUNetIO capabilities, version overlay, errors, observability, safety

Where to start: Pick the H2 anchor that matches your question (per-GPU context / GPU-visible queue handles / persistent-kernel pattern / dual capability discovery / env preconditions / errors) and read that section end-to-end. The tables in each section are the load-bearing content; the prose around them is interpretation.

Read this file when the loader sent you here from SKILL.md. For the how of executing each pattern (the verbs configure / build / modify / run / test / debug), jump to TASKS.md. For the canonical DOCA version-handling rules that this skill layers a GPUNetIO overlay on top of, see doca-version/SKILL.md.

Pattern overview

Every GPUNetIO question this skill teaches resolves into one of SIX patterns. The patterns are CLASSES — they apply across every GPUNetIO release and every host + GPU + NIC combination.

PatternWhen it applies (class shape)Where the substance lives
1. Set up the underlying Ethernet queues firstdoca-eth doca_eth_rxq / doca_eth_txq must be configured before any GPUNetIO call; GPUNetIO does not own the queue, it exposes it to the GPU## Capabilities and modes layering rule + TASKS.md ## configure step 2
2. Create the per-GPU doca_gpu contextOne context per GPU (created from the GPU's PCIe bus-id string); a multi-GPU host needs one doca_gpu per device## Capabilities and modes per-device-context rule + TASKS.md ## configure step 3
3. Build the GPU-visible queue handles on top of doca-ethdoca_gpu_eth_rxq / doca_gpu_eth_txq are passed into a CUDA kernel for device-side packet I/O## Capabilities and modes handle table + TASKS.md ## configure step 5
4. Use the persistent-kernel pattern, not kernel-per-packetOne long-running CUDA kernel polls the GPU-visible RX queue, processes in place, optionally pushes results out via the GPU-visible TX queue## Capabilities and modes persistent-kernel section + TASKS.md ## modify
5. Honor env preconditions: CUDA toolkit matched to DOCA, GPU memory registered via dmabuf (or the legacy nvidia-peermem fallback)Mismatched CUDA + DOCA combos fail at link or runtime in confusing ways; neither dmabuf nor nvidia-peermem available disables GPUDirect RDMA## Safety policy env-precondition matrix + TASKS.md ## configure step 1
6. Diagnose a GPUNetIO errorMap DOCA_ERROR_NOT_SUPPORTED / _DRIVER / _AGAIN / _INVALID_VALUE / _BAD_STATE to a root cause without leaving the GPUNetIO layer prematurely## Error taxonomy + TASKS.md ## debug

Two cross-cutting rules that apply to every pattern above:

  • GPUNetIO sits on top of doca-eth, not below it. The agent recommending that the user "create a GPU queue first and the Ethernet queue follows from it" has the layering backwards for every version of GPUNetIO. Configure doca-eth first, then layer GPUNetIO handles on top.

  • Capability is a TWO-axis question. "Is this feature supported on this host" requires BOTH a DOCA cap-query against the active doca_devinfo AND a CUDA device-capability check (cudaGetDeviceProperties). Either axis missing the support fails the feature. An agent that quotes only one axis will miss half the "silently fails on this GPU" cases.

Capabilities and modes

The two orthogonal selection axes for any GPUNetIO design are which CUDA device (doca_gpu per device ordinal) and which doca-eth queue is being exposed to the GPU (RX, TX, or both). Choose both before writing any CUDA kernel code, then drill into the relevant capability-query.

The per-GPU doca_gpu context — one per GPU (created from the GPU's PCIe bus-id string).

ObjectLifetimeWhat it ownsKey calls
doca_gpuOne per GPU; created for a specific GPU on the hostThe DOCA-side bookkeeping for that GPU, the registration of CUDA buffers into DOCA, the GPU-visible queue handles built on top of doca-eth queues for that GPUdoca_gpu_create(const char *gpu_bus_id, ...) — takes the GPU's PCIe bus-id string (e.g. from cudaDeviceGetPCIBusId), not an int ordinal; plus the destroy / re-create flow on rebind

A multi-GPU host needs one doca_gpu per device the user wants to drive — there is no "global GPU context". The agent must ask which CUDA device the user intends to drive before recommending any doca_gpu_* call, and must surface cudaGetDeviceProperties(devOrdinal) as the canonical way to confirm the device is GPUNetIO-capable.

The GPU-visible queue handles — layered on doca-eth.

HandleLayered onDirectionWhere it lives at runtime
doca_gpu_eth_rxqdoca_eth_rxq (from doca-eth)RX (receive)The handle is passed into a CUDA kernel; device-side code reads packets directly from the queue from inside the kernel
doca_gpu_eth_txqdoca_eth_txq (from doca-eth)TX (send)The handle is passed into a CUDA kernel; device-side code submits packets directly to the queue from inside the kernel

The GPU-visible handles do not own the underlying queue — they expose it to the GPU. Tearing down the underlying doca-eth queue without first tearing down the GPU-visible handle is a use-after-free on the GPU side; the agent must surface this ordering explicitly when discussing lifecycle.

Persistent-kernel pattern — the canonical first-app shape. The default GPUNetIO usage shape is one long-running CUDA kernel that polls the GPU-visible RX queue in a loop, processes each packet in place on the GPU, and optionally pushes results out via the GPU-visible TX queue. This is the pattern the GPU Packet Processing reference application uses; the agent should treat it as the default and treat "launch a kernel per packet" as an anti-pattern that defeats the entire reason to use GPUNetIO (the kernel-launch overhead per packet swamps the network savings).

Anti-patternWhy it's wrongRight shape
Launch a CUDA kernel for every received packetKernel-launch overhead dominates; defeats GPU-initiated networking entirelyOne long-running persistent kernel that drains the GPU-visible RX queue in a loop
Drive the queue from host code with cudaMemcpy between every batchRound-trips through the host CPU; that is what GPUNetIO exists to avoidProcess packets in-place on the GPU in the persistent kernel
One persistent kernel across multiple GPUsA CUDA kernel is bound to one CUDA device; multi-GPU means multiple persistent kernels, one per doca_gpuOne persistent kernel per doca_gpu per direction, sized to the GPU it targets

Dual-axis capability discovery — the only rule. Before sizing any queue, assuming a feature is available, or recommending the persistent-kernel pattern works on the user's device, run BOTH a DOCA cap-query AND a CUDA device-capability check. Either axis missing the support fails the feature.

AxisWhat to callWhy the agent must ask
DOCA sidedoca_eth_rxq_cap_is_type_supported(devinfo, ...) against the active doca_devinfo (the doca-eth cap function in doca_eth_rxq.h, plus the doca_eth_rxq_cap_get_* sizing family and the matching doca_eth_txq_cap_is_type_supported / doca_eth_txq_cap_get_* in doca_eth_txq.h) — GPUNetIO itself exposes no cap_is_supported symbol; the queue capability is a doca-eth queryDOCA-side compatibility of the underlying RX/TX queue type with GPU exposure is device-conditional; do not assume the feature is on every NIC + DOCA combo
CUDA sidecudaGetDeviceProperties(props, devOrdinal) against the candidate CUDA deviceGPU-initiated networking depends on per-device CUDA capabilities; older non-Ampere GPUs may not support the GPU-side primitives even if DOCA is happy

DOCA 3.5 public API surface. The GPUNetIO public header is the source of truth for enumerator families and function signatures; do not copy constant lists or prototypes from older DOCA releases. In DOCA 3.5 the following constant families were added or changed: DOCA_GPUNETIO_ETH_READY_MODE_*, DOCA_GPUNETIO_VERBS_READY_MODE_*, DOCA_GPUNETIO_MLX5_WQE_CTRL_*, DOCA_GPUNETIO_VERBS_CQ_*, DOCA_GPUNETIO_VERBS_ATOMIC_EXT_BYTES_*, DOCA_GPUNETIO_VERBS_SYNC_SCOPE_*, DOCA_GPUNETIO_VERBS_NIC_HANDLER_*, and DOCA_GPUNETIO_VERBS_GPU_CODE_OPT_*. See the public header for the exact enumerators.

DOCA 3.5 also added the doca_gpu_verbs_get_qp_* getter family (doca_gpu_verbs_get_qp_cq_rq, doca_gpu_verbs_get_qp_cq_sq, doca_gpu_verbs_get_qp_qp) for retrieving the CQ/RQ, CQ/SQ, and underlying QP from a doca_gpu_verbs_qp; use these getters to obtain QP/CQ members rather than relying on removed or changed fields. DOCA 3.5 added doca_gpu_verbs_req_notify_cq for requesting completion notification on a doca_verbs_cq, and added doca_gpu_nic_handler_to_string for converting a NIC-handler enumerator to a string.

Configuration shape. Mandatory preconditions before any doca_gpu_* call: the underlying doca_eth_rxq / doca_eth_txq must be configured and the doca-eth context must be at the right lifecycle stage for the GPUNetIO layer to attach; the CUDA toolkit must be installed and cudaSetDevice(devOrdinal) must succeed against the target GPU; the CUDA buffers that will hold the receive payload pool must be allocated via cudaMalloc (or equivalent CUDA allocator) and registered with DOCA via the doca_buf_arr_create_* family. Optional configurations (queue sizing, persistent-kernel block / thread counts on the CUDA side) are program-side tunables that ride on top of the same cap-query rule.

Version compatibility

For the canonical DOCA version-detection chain, the four-way match rule, NGC container semantics, and the headers-win-over-docs rule, see doca-version/SKILL.md. The body lives there; this skill does not duplicate it.

The GPUNetIO-specific overlay is:

  • DOCA must match CUDA per the DOCA Compatibility Policy. The public DOCA Compatibility Policy at https://docs.nvidia.com/doca/sdk/doca-compatibility-policy/index.html defines which CUDA toolkit version a given DOCA release supports. Mismatched CUDA + DOCA combos fail at link time (missing CUDA-side symbols) or at runtime (DOCA_ERROR_DRIVER from doca_gpu_create) in confusing ways. The agent must compare pkg-config --modversion doca-gpunetio with pkg-config --modversion doca-common, require those DOCA versions to agree, then compare nvcc --version (and cat /usr/local/cuda/version.txt when present) against the DOCA Compatibility Policy before any GPUNetIO bring-up.

  • DOCA 3.5 changed the GPUNetIO public API. The supported constant families are DOCA_GPUNETIO_ETH_READY_MODE_*, DOCA_GPUNETIO_MLX5_WQE_CTRL_*, DOCA_GPUNETIO_VERBS_ATOMIC_EXT_*, DOCA_GPUNETIO_VERBS_CQ_*, DOCA_GPUNETIO_VERBS_GPU_CODE_OPT_*, DOCA_GPUNETIO_VERBS_NIC_HANDLER_*, DOCA_GPUNETIO_VERBS_READY_MODE_*, and DOCA_GPUNETIO_VERBS_SYNC_SCOPE_*. The agent must treat a constant from outside these families as a DOCA 3.5 API mismatch and route to doca-version TASKS.md ## debug (doca-version/TASKS.md#debug) before GPUNetIO-layer diagnosis. The authoritative list is in the installed GPUNetIO public header that declares doca_gpu_verbs_bridge_export_qp; do not copy constant values or prototypes from memory.

  • The DOCA cap-query AND cudaGetDeviceProperties are both runtime authorities. Per the cross-cutting cap-query rule in doca-version CAPABILITIES.md ## Observability (doca-version/CAPABILITIES.md#observability), the DOCA-side cap query is the runtime authority for "is this GPUNetIO feature on this DOCA install". The CUDA-side device-properties query is the runtime authority for "is this GPU capable of GPU-initiated networking at all". Either being false fails the feature; the agent must report both.

  • doca-gpunetio.pc, doca-common.pc, and the matching CUDA toolkit must all line up at the four-way-match check (per doca-version CAPABILITIES.md ## Version compatibility (doca-version/CAPABILITIES.md#version-compatibility)). A common partial-install pattern is that DOCA was upgraded but the CUDA toolkit on the host was not, or vice versa; the agent must surface that as a four-way-match failure and route to doca-version TASKS.md ## debug (doca-version/TASKS.md#debug) before any GPUNetIO-layer diagnosis.

Error taxonomy

GPUNetIO-specific overlays on the cross-library DOCA_ERROR_* taxonomy. The cross-library taxonomy itself lives in doca-programming-guide CAPABILITIES.md ## Error taxonomy (doca-programming-guide/CAPABILITIES.md#error-taxonomy); the rows below are the GPUNetIO surface meaning that the agent must disambiguate before falling back to the cross-library response.

ErrorGPUNetIO context where it shows upGPUNetIO-specific cause
DOCA_ERROR_NOT_SUPPORTEDdoca_gpu_create; doca_gpu_eth_rxq_* / _txq_* creation; the cap-query familyThe GPU does not support GPUNetIO (e.g. older non-Ampere GPU per cudaGetDeviceProperties), or nvidia_peermem is not loaded so GPUDirect RDMA is unavailable, or the underlying doca-eth queue type is not exposable to the GPU on this NIC + DOCA combo. Run BOTH doca_eth_rxq_cap_is_type_supported(devinfo, ...) (the doca-eth query in doca_eth_rxq.h) AND cudaGetDeviceProperties(devOrdinal); surface which axis is false.
DOCA_ERROR_INVALID_VALUEdoca_gpu_create with a GPU PCIe bus-id string; buffer registration via doca_buf_arr_create_*The PCIe bus-id string does not match a GPU present on the host (mismatched between nvidia-smi -L / cudaDeviceGetPCIBusId and the string passed to DOCA), or the CUDA-allocated buffer has alignment / size that does not match the doca-eth queue expectations. Re-resolve the bus-id and the queue's required alignment; do not paper over with a retry.
DOCA_ERROR_BAD_STATEAny GPUNetIO call against a doca-eth context that is at the wrong lifecycle stage; teardown ordering between the GPU-visible handle and the underlying doca-eth queueLifecycle violation. The most common case is calling doca_gpu_eth_rxq_* against a doca-eth context that has not been started, or destroying the underlying doca_eth_rxq before destroying the GPU-visible handle. Walk the layering rule in ## Capabilities and modes.
DOCA_ERROR_AGAINTX submit from inside the CUDA kernel (device-side); RX drain from the persistent kernelThe GPU-visible queue is full from the GPU side. This is not a hardware error; the persistent kernel must drain completions before re-submitting (the device-side equivalent of the host-side "would-block, retry after progress" pattern).
DOCA_ERROR_DRIVERdoca_gpu_create; any GPUNetIO call when CUDA + DOCA versions are skewedThe CUDA driver layer reported failure to DOCA. Most common cause is a CUDA + DOCA version mismatch per the DOCA Compatibility Policy. Route to doca-setup ## debug (doca-setup/TASKS.md#debug) layer 5 (driver) AND to doca-version TASKS.md ## debug (doca-version/TASKS.md#debug) for the version-skew side.

The agent's rule: never recommend a retry loop on DOCA_ERROR_* without first identifying which of the rows above is the cause. _AGAIN is the only one that wants a device-side drain-then-retry; the others want investigation (env / version / lifecycle), not retry.

Observability

GPUNetIO observability surface is two-sided: there is a DOCA-side observability surface (per-task completions, the DOCA logger, capability-query snapshots) AND a CUDA-side observability surface (CUDA device counters, the persistent-kernel's own in-kernel logging, CUDA error returns from launch / sync). The agent must reach for both, not just one — a hung persistent kernel that produces no DOCA log line is almost always visible on the CUDA side via cuda-gdb or kernel-internal counters.

Three primary signals the agent should reach for:

  1. DOCA-side per-task completions. Every queue submit produces a completion (success or failure) that the persistent kernel can read from the device side. Absence of a completion for submitted packets is always a queue-not-drained bug; the persistent kernel needs an explicit drain step in its loop.

  2. Capability snapshot at configure time. The output of doca_eth_rxq_cap_is_type_supported(devinfo, ...) (the doca-eth query in doca_eth_rxq.h) AND cudaGetDeviceProperties(devOrdinal) together is the baseline of "what the library + the GPU said was possible" before any kernel was launched. Save both; if a runtime call later returns DOCA_ERROR_NOT_SUPPORTED the diff against this baseline is the bug.

  3. CUDA-side health. nvidia-smi -q -d UTILIZATION while the persistent kernel runs shows whether the GPU is actually busy with work; a persistent kernel that reports 0% util is stuck on a queue drain. cuda-gdb attached to the host process can step into the device-side kernel when DOCA-side completions stop arriving without an explicit error.

DOCA 3.5 added two observability/debugging entry points in the public GPUNetIO header (doca_gpunetio.h). Use doca_gpu_nic_handler_to_string() to convert a doca_gpu_dev_verbs_nic_handler value to a string before logging bridge-export configuration; do not log the raw enum. Use doca_gpu_verbs_req_notify_cq() to request a completion notification on a struct doca_verbs_cq obtained from a doca_gpu_verbs_qp through the new doca_gpu_verbs_get_qp_* getter family, so the persistent kernel can wait for completions instead of polling blindly. See doca_gpunetio.h for the exact signatures and the DOCA_GPUNETIO_VERBS_* and DOCA_GPUNETIO_ETH_* constant families.

For cross-cutting observability primitives (--sdk-log-level, the DOCA_LOG_LEVEL env var, the trace build flavor) see doca-debug CAPABILITIES.md ## Observability (doca-debug/CAPABILITIES.md#observability). For the install-tree observability (logger names, package layout, sample tree) defer to doca-public-knowledge-map/SKILL.md.

Safety policy

Overlay on the bundle-wide hardware-safety meta-policy. The rules below are this skill's per-artifact overlay on the cross-cutting rules in doca-hardware-safety CAPABILITIES.md ## Safety policy (doca-hardware-safety/CAPABILITIES.md#safety-policy) (specifically ### Per-artifact overlay pattern (doca-hardware-safety/CAPABILITIES.md#per-artifact-overlay-pattern)). When the two layers disagree, the stricter wins; when either layer says STOP, the agent stops.

GPUNetIO's safety surface is env-precondition-driven. Unlike RDMA (permission-driven) or Comch (representor-visibility-driven), the single most common GPUNetIO first-app failure is that the host's CUDA + DOCA combination is not what the user thinks it is — and the agent's job is to verify that before any doca_gpu_* call, not after the first DOCA_ERROR_DRIVER.

The env-precondition matrix the agent must walk for any new GPUNetIO setup:

PreconditionWhat must be trueHow the agent verifiesWhere to fix
CUDA toolkit installed and matched to DOCAThe CUDA toolkit on the host is installed at a version listed as compatible with both installed DOCA package surfaces per the DOCA Compatibility Policynvcc --version; cat /usr/local/cuda/version.txt; compare both pkg-config --modversion doca-gpunetio and pkg-config --modversion doca-common, require those DOCA versions to agree, then cross-check CUDA against the DOCA Compatibility Policydoca-setup/SKILL.md for the install-side; route to doca-version/SKILL.md for the four-way-match check
nvidia_peermem loaded for GPUDirect RDMAThe nvidia_peermem kernel module is loaded so GPUDirect RDMA between the NIC and the GPU works; without it GPU-initiated networking falls back or fails entirelylsmod | grep nvidia_peermem; missing → sudo modprobe nvidia_peermem; persistent via system configdoca-setup/SKILL.md for the env-side; do not modify the program
CUDA device enumerablecudaGetDeviceCount returns at least 1 and cudaGetDeviceProperties(devOrdinal) succeeds for the device the user intends to drivenvidia-smi -L; programmatic via the CUDA runtime; cudaSetDevice(devOrdinal) must succeeddoca-setup/SKILL.md for the env-side; verify the NVIDIA driver is loaded
doca-eth side already upThe underlying doca_eth_rxq / doca_eth_txq exists and the doca-eth context is at the right lifecycle stage to expose the queue to the GPUThe doca-eth/SKILL.md bring-up workflow is the upstream verbConfigure doca-eth first; do NOT skip ahead to doca_gpu_* calls
CUDA buffers registered with DOCAThe GPU-side payload pool allocated via cudaMalloc is registered with DOCA via the doca_buf_arr_create_* family before doca_ctx_start()Walk the registration sequence in TASKS.md ## configure step 4; a missing registration surfaces as DOCA_ERROR_BAD_STATE from the first device-side submitProgram-layer fix — the registration call goes in the host-side bring-up code, before the persistent kernel is launched

Do not partial-install one side. A CUDA-only install without DOCA, or a DOCA install with no CUDA toolkit, fails GPUNetIO in non-obvious ways: pkg-config may succeed for DOCA while the link line fails on CUDA symbols, or DOCA may succeed at create-time while the first runtime call returns DOCA_ERROR_DRIVER from CUDA below. The fix is to align both sides per the DOCA Compatibility Policy, not to silence the error.

Lifecycle ordering is GPU-aware. The GPU-visible handle must be destroyed BEFORE the underlying doca-eth queue is destroyed; the doca_gpu context must be destroyed BEFORE the CUDA context is unbound from the process. Out-of-order teardown surfaces as DOCA_ERROR_BAD_STATE on subsequent calls but also leaves the GPU in an undefined state for the next process; the agent must surface this ordering explicitly.

Deferred topic boundaries

This skill scopes itself to the DOCA GPUNetIO library. Adjacent topics the agent will get asked but should route elsewhere:

  • CUDA programming in general (CUDA kernel design, CUDA memory model, stream / event semantics, multi-stream scheduling) — outside this skill. Route to the upstream CUDA toolkit documentation; this skill assumes the user already understands CUDA C++ and is asking how to wire a DOCA queue into a CUDA kernel.

  • DOCA Ethernet queue setup (doca_eth_rxq / doca_eth_txq bring-up, RSS, representor selection on the NIC side) — GPUNetIO depends on it but does not redefine it. Route to doca-eth/SKILL.md.

  • DOCA DPA (DPA-side networking primitives, DPA kernel programming) — the sibling DOCA library for offloading device-side compute onto a different non-CPU target. The agent should NAME DPA when asked about "DOCA libraries that integrate with non-CPU compute" (see the worked example in TASKS.md ## modify) but should not invent DPA API surfaces here. Route via doca-public-knowledge-map/SKILL.md to the public DOCA DPA guide.

  • DOCA Core context and progress engine internals — owned by doca-programming-guide/SKILL.md. This skill uses the Core lifecycle; it does not redefine it.

  • Cross-cutting DOCA_ERROR_* taxonomy — owned by doca-programming-guide CAPABILITIES.md ## Error taxonomy (doca-programming-guide/CAPABILITIES.md#error-taxonomy). This skill adds the GPUNetIO overlay, not the taxonomy itself.

  • Cross-cutting debug ladder (install / version / build / link / runtime / program / driver) — owned by doca-debug ## debug (doca-debug/TASKS.md#debug). This skill's ## debug redirects there for layer 1-4; layers 5-7 carry the GPUNetIO-specific overlay (including the CUDA-driver-layer route).

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: Requires DOCA SDK at /opt/mellanox/doca on Linux (Ubuntu 22.04/24.04 or RHEL/SLES) with a BlueField DPU or ConnectX NIC. Reads the local install via `pkg-config doca-gpunetio`. Requires an NVIDIA GPU with CUDA toolkit (matched to DOCA per the DOCA Compatibility Policy) and GPU memory registered via dmabuf (or the legacy nvidia-peermem fallback) for GPUDirect RDMA; some samples need an InfiniBand-capable RNIC. The validation steps require a live DOCA install.

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-gpunetio · 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-gpunetio.zip