doca-dma

Guides DOCA DMA context setup, memcpy task configuration, and error debugging on BlueField hardware.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Programming the DOCA DMA library correctly requires navigating context lifecycle rules, device capability queries, mmap permission flags, and a layered error taxonomy — mistakes surface as cryptic DOCA_ERROR_* returns or silent missing completions. This Skill gives an AI agent the verified workflows to configure, build, run, test, and debug DOCA DMA memcpy offloads on BlueField DPUs and ConnectX NICs without inventing symbols or mis-sizing buffers.

Core Features & Use Cases

  • Context and task configuration: Walks through bringing up a doca_dma context, enabling the single doca_dma_task_memcpy task type, and querying device capabilities via doca_dma_cap_task_memcpy_* before sizing buffers.
  • Permission and safety enforcement: Applies the source/destination mmap permission matrix (LOCAL_READ_ONLY / LOCAL_READ_WRITE, plus doca_mmap_export_* for cross-peer copies) to prevent NOT_PERMITTED failures.
  • Layered debugging: Maps DOCA_ERROR_* returns (BAD_STATE, INVALID_VALUE, AGAIN, NOT_PERMITTED, NOT_SUPPORTED, DRIVER) to root causes across lifecycle, permission, capability, and driver layers.
  • Use Case: A developer asks "memcpy a host buffer to the BlueField without using the CPU" — the agent loads this Skill, confirms DMA is the right library versus RDMA or Comch, queries device capabilities, and walks the user through a small-buffer smoke test before the bulk copy.

Quick Start

Ask your agent to help you bring up a doca_dma context and copy a buffer from host memory to DPU memory using the doca_dma_task_memcpy task.

Frequently Asked Questions about doca-dma

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

FAQPage Schema
How do I copy a buffer between host and DPU memory with DOCA DMA?

Create a doca_dma context on a doca_dev, enable the memcpy task via doca_dma_task_memcpy_set_conf, set source mmap to LOCAL_READ_ONLY and destination to LOCAL_READ_WRITE, then submit doca_dma_task_memcpy tasks and drive completions with doca_pe_progress. For cross-peer copies, export the source mmap via doca_mmap_export_* first.

When should I use DOCA DMA versus DOCA RDMA or Comch?

Use DOCA DMA for bulk mmap-to-mmap copies on the same host or across a host-DPU PCIe boundary. Use DOCA RDMA when data must traverse the network, DOCA Comch for producer/consumer messaging between host and DPU processes, and a plain CPU memcpy for tiny one-shot copies.

Why does my DOCA DMA memcpy return DOCA_ERROR_NOT_PERMITTED?

NOT_PERMITTED means a mmap permission flag is missing: the source needs DOCA_ACCESS_FLAG_LOCAL_READ_ONLY, the destination needs LOCAL_READ_WRITE, and cross-peer sources must be exported via doca_mmap_export_*. Set permissions with doca_mmap_set_permissions before doca_mmap_start and the first task submit.

How do I find the maximum DMA buffer size on my device?

Query doca_dma_cap_task_memcpy_get_max_buf_size against the active doca_devinfo before sizing any buffer, and use _get_max_buf_list_len for scatter-gather lists. These limits are device-dependent; exceeding them returns DOCA_ERROR_INVALID_VALUE and requires application-layer fragmentation.

Why does my submitted DMA task never produce a completion?

Missing completions almost always mean the progress engine is not being driven — the program must call doca_pe_progress repeatedly to pump completion events. Also verify the context reached RUNNING state before submission, using DOCA_LOG_LEVEL=trace to observe lifecycle transitions.

What are the requirements for using DOCA DMA?

DOCA DMA requires the DOCA SDK installed at /opt/mellanox/doca on Linux (Ubuntu 22.04/24.04 or RHEL/SLES) with a BlueField DPU or ConnectX NIC attached. The library is consumed as a C API via the pkg-config module doca-dma, with samples shipped under /opt/mellanox/doca/samples/doca_dma/.