doca-compress

Guides DOCA Compress programming for hardware-accelerated DEFLATE and LZ4 decompression on BlueField DPUs.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers offloading compression to NVIDIA BlueField DPUs or ConnectX NICs face a complex API surface: per-task capability queries, mmap permission matrices, buffer sizing against device limits, and layered DOCA_ERROR_* diagnostics. This Skill teaches AI agents the correct DOCA Compress workflows so they produce grounded, version-aware guidance instead of hallucinated API calls.

Core Features & Use Cases

  • Task configuration guidance: Walks through enabling compress-deflate, decompress-deflate, decompress-lz4-stream, and decompress-lz4-block tasks on a doca_compress context, including decompress-only as a valid standalone shape.
  • Capability discovery and sizing: Enforces runtime doca_compress_cap_* queries for task support and per-task maximum buffer sizes before any submission, plus the source/destination mmap permission matrix.
  • Offload path selection: Provides the size-threshold rule for deciding between accelerator offload and CPU zlib/zstd, and routes pure mmap-to-mmap copies to doca-dma.
  • Debug and validation workflows: Supplies a round-trip smoke test methodology, an iterative test loop, a five-phase debug loop, and a bounded rollback procedure.
  • Use Case: A developer asks their agent to "decompress incoming network data on the BlueField" — the agent loads this Skill, queries device capabilities, configures a decompress-only context with correct mmap permissions, and validates with a known DEFLATE fixture before bulk traffic.

Quick Start

Ask your agent to help you configure a DOCA Compress context to offload gzip-style DEFLATE compression of a large buffer on your BlueField DPU, including capability checks and a round-trip validation.

Frequently Asked Questions about doca-compress

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

FAQPage Schema
How do I offload gzip compression to a BlueField DPU with DOCA?

Create a doca_compress context, enable the doca_compress_task_compress_deflate task before doca_ctx_start, and size buffers against the cap query. DOCA Compress supports DEFLATE, the same algorithm behind gzip and zlib, on the encode side.

When should I use DOCA Compress instead of CPU zlib or zstd?

Use DOCA Compress for bulk inputs of a few KiB or larger, repeated operations, or data already pinned in doca_mmap memory. For tiny one-shot buffers, CPU compression with zlib or zstd is faster than the DMA-to-accelerator round-trip.

Does DOCA Compress support LZ4 compression?

DOCA Compress supports LZ4 only on the decompress side, via the lz4_stream and lz4_block task families, each independently capability-gated. LZ4 encode is not supported; use a CPU LZ4 library for outbound LZ4 encoding.

Can I use DOCA Compress only for decompression?

Yes, a decompress-only consumer is a fully valid standalone shape. Enable only doca_compress_task_decompress_deflate (or an LZ4 decode task) without enabling the compress task, and validate against a CPU-produced fixture.

Why does doca_compress task submission return DOCA_ERROR_INVALID_VALUE?

This usually means the source buffer exceeds the per-task max buffer size from the capability query, or the destination buffer is too small for worst-case output. Re-run the matching doca_compress_cap_*_get_max_buf_size query and resize.

What mmap permissions does DOCA Compress require?

The source mmap needs at least DOCA_ACCESS_FLAG_LOCAL_READ_ONLY and the destination mmap needs DOCA_ACCESS_FLAG_LOCAL_READ_WRITE, both set before the first task submission. Missing permissions surface as DOCA_ERROR_NOT_PERMITTED at submit time.