Rdma Verbs logo

Rdma Verbs

Community
mohitmishra786
rdma-verbs

RDMA verbs skill for InfiniBand and RoCE programming. Use when using libibverbs API, creating queue pairs, RDMA read/write operations, or benchmarking with perftest. Activates on queries about libibverbs, ibv_reg_mr, ibv_create_qp, RDMA, RoCE, ib_send_bw, or rdma-sys.

Overview

Publishermohitmishra786
Repositorylow-level-dev-skills
Skill namerdma-verbs
Stars
266
Forks
31
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by mohitmishra786 on GitHub. Read the source before you install it.

Installation

Install the Rdma Verbs AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/mohitmishra786/low-level-dev-skills/tree/main/skills/hpc/rdma-verbs
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills.git /tmp/low-level-dev-skills
mkdir -p .claude/skills
cp -r /tmp/low-level-dev-skills/skills/hpc/rdma-verbs .claude/skills/rdma-verbs
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Rdma Verbs in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Rdma Verbs on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Rdma Verbs is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

RDMA Verbs

Purpose

Guide agents through RDMA programming with libibverbs: one-sided vs two-sided operations, RC/UC/UD transports, device setup (ibv_get_device_list, protection domains, memory registration, completion queues, queue pairs), work requests and completions, RoCE vs InfiniBand, perftest benchmarking, and Rust rdma-sys bindings.

When to Use

  • Building ultra-low-latency storage or database networking
  • Bypassing CPU for remote memory access (one-sided RDMA)
  • Setting up RoCE on Ethernet fabrics
  • Benchmarking network fabric with perftest tools
  • Integrating RDMA into MPI or custom RPC systems
  • Debugging RDMA connection and completion errors

Workflow

1. RDMA concepts

RDMA stack
├── Application (libibverbs)
├── Kernel RDMA driver (mlx5, rdma_rxe)
├── NIC/HCA hardware
└── Fabric (InfiniBand or RoCE/Ethernet)

Operation types
├── Two-sided: Send/Recv (both sides participate)
└── One-sided: RDMA Read/Write (remote CPU not involved)

Transports:

TypeReliableConnectionUse
RC (Reliable Connected)Yes1:1 QP pairGeneral purpose
UC (Unreliable Connected)No1:1Multicast-like
UD (Unreliable Datagram)NoMany:ManyMPI, discovery

2. Device discovery

bash
# List RDMA devices
ibv_devices
ibv_devinfo

# RoCE link status
rdma link show
ibstat

# Perftest prerequisites
modprobe ib_umad

3. Minimal libibverbs setup

c
#include <infiniband/verbs.h>
#include <stdio.h>
#include <stdlib.h>

int main(void) {
    int num_devices;
    struct ibv_device **dev_list = ibv_get_device_list(&num_devices);
    if (!dev_list || num_devices == 0) {
        fprintf(stderr, "No RDMA devices\n");
        return 1;
    }

    struct ibv_context *ctx = ibv_open_device(dev_list[0]);
    struct ibv_pd *pd = ibv_alloc_pd(ctx);

    char buf[4096];
    struct ibv_mr *mr = ibv_reg_mr(pd, buf, sizeof(buf),
        IBV_ACCESS_LOCAL_WRITE | IBV_ACCESS_REMOTE_WRITE);

    struct ibv_cq *cq = ibv_create_cq(ctx, 10, NULL, NULL, 0);

    struct ibv_qp_init_attr qp_attr = {
        .send_cq = cq,
        .recv_cq = cq,
        .cap = { .max_send_wr = 10, .max_recv_wr = 10,
                 .max_send_sge = 1, .max_recv_sge = 1 },
        .qp_type = IBV_QPT_RC,
    };
    struct ibv_qp *qp = ibv_create_qp(pd, &qp_attr);

    printf("QP num %u, MR lkey %u rkey %u\n",
           qp->qp_num, mr->lkey, mr->rkey);

    ibv_destroy_qp(qp);
    ibv_dereg_mr(mr);
    ibv_destroy_cq(cq);
    ibv_dealloc_pd(pd);
    ibv_close_device(ctx);
    ibv_free_device_list(dev_list);
    return 0;
}
bash
gcc -o rdma_setup rdma_setup.c -libverbs

4. Connection setup (RC)

RC requires exchanging QP info (lid, gid, qp_num, psn) out-of-band:

c
// Simplified: exchange via TCP socket before RDMA
struct qp_info {
    uint16_t lid;
    uint32_t qpn;
    uint32_t psn;
    union ibv_gid gid;
};

// Modify QP to INIT → RTR → RTS states
struct ibv_qp_attr attr = { .qp_state = IBV_QPS_INIT, ... };
ibv_modify_qp(qp, &attr, IBV_QP_STATE | IBV_QP_PKEY_INDEX | ...);
// RTR: set path_mtu, dest_qp_num, rq_psn, ah_attr
// RTS: set sq_psn, timeout, retry_cnt

Use rdmacm (librdmacm) for simplified connection management:

c
#include <rdma/rdma_cma.h>
// rdma_create_event_channel, rdma_connect, rdma_accept

5. Send/Recv (two-sided)

c
// Post receive
struct ibv_recv_wr recv_wr = {}, *bad_wr;
struct ibv_sge recv_sge = { .addr = (uint64_t)recv_buf, .length = 4096, .lkey = mr->lkey };
recv_wr.wr_id = 1;
recv_wr.sg_list = &recv_sge;
recv_wr.num_sge = 1;
ibv_post_recv(qp, &recv_wr, &bad_wr);

// Post send
struct ibv_send_wr send_wr = {}, *bad_send;
struct ibv_sge send_sge = { .addr = (uint64_t)send_buf, .length = msg_len, .lkey = mr->lkey };
send_wr.wr_id = 2;
send_wr.opcode = IBV_WR_SEND;
send_wr.sg_list = &send_sge;
send_wr.num_sge = 1;
ibv_post_send(qp, &send_wr, &bad_send);

// Poll completion
struct ibv_wc wc;
while (ibv_poll_cq(cq, 1, &wc) == 0);
if (wc.status != IBV_WC_SUCCESS)
    fprintf(stderr, "WC error: %s\n", ibv_wc_status_str(wc.status));

6. RDMA Write (one-sided)

c
struct ibv_send_wr wr = {}, *bad;
struct ibv_sge sge = { .addr = (uint64_t)local_buf, .length = len, .lkey = local_mr->lkey };

wr.wr_id = 3;
wr.opcode = IBV_WR_RDMA_WRITE;
wr.send_flags = IBV_SEND_SIGNALED;
wr.sg_list = &sge;
wr.num_sge = 1;
wr.wr.rdma.remote_addr = remote_addr;  // from peer exchange
wr.wr.rdma.rkey = remote_rkey;

ibv_post_send(qp, &wr, &bad);

Remote CPU is not interrupted — data appears in remote memory directly.

7. RoCE vs InfiniBand

InfiniBandRoCE
PhysicalDedicated IB fabricEthernet (lossless DCB/PFC)
LID/GIDBothPrimarily GID (IPv6-like)
SetupSubnet managerDCB config, PFC, ECN
bash
# RoCEv2 GID
cat /sys/class/infiniband/mlx5_0/ports/1/gids/3

8. perftest benchmarking

bash
# Server
ib_send_bw -d mlx5_0 -x 3

# Client
ib_send_bw -d mlx5_0 -x 3 <server_ip>

# Latency
ib_send_lat -d mlx5_0 <server_ip>

# RDMA write bandwidth
ib_write_bw -d mlx5_0 <server_ip>

9. Rust rdma-sys

toml
# Cargo.toml
rdma-sys = "0.1"

Wrap libibverbs with safe abstractions or use async-rdma crate for higher-level API.

Common Problems

SymptomCauseFix
ibv_reg_mr failsMemory limit or wrong permissionsCheck ulimit -l; set access flags
WC status rem_inv_reqBad rkey/addrRe-exchange MR info after reconnect
QP RTS failureWrong PSN or pathVerify lid/gid match; subnet manager
RoCE packet lossNo PFC on switchesEnable lossless Ethernet; DCQCN
Low bandwidthSmall message sizeIncrease MTU; use larger WRs
Device not foundDriver not loadedmodprobe mlx5_ib; check ibv_devices

Related Skills

  • skills/hpc/mpi — MPI often uses RDMA under UCX/IB verbs
  • skills/async-io/dpdk — alternative userspace networking
  • skills/allocators/numa-programming — NUMA-local MR registration
  • skills/profilers/linux-perf — CPU-side RDMA completion polling
  • skills/kernel/device-drivers — RDMA driver internals
  • skills/virtualization/qemu-kvm — SR-IOV VF passthrough for RDMA

Frequently asked questions

What does the Rdma Verbs AI skill do?

RDMA verbs skill for InfiniBand and RoCE programming. Use when using libibverbs API, creating queue pairs, RDMA read/write operations, or benchmarking with perftest. Activates on queries about libibverbs, ibv_reg_mr, ibv_create_qp, RDMA, RoCE, ib_send_bw, or rdma-sys.

Why use Rdma Verbs on TypingMind?

Because you install it once and use it with any model. Rdma Verbs is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Rdma Verbs in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/mohitmishra786/low-level-dev-skills/tree/main/skills/hpc/rdma-verbs. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Rdma Verbs?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Rdma Verbs?

As many as you like. As long as a model supports skills, you can use Rdma Verbs with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Rdma Verbs AI skill free?

Yes. It is published on GitHub by mohitmishra786 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇