An Ansible collection for rocm-ernic: roles that turn a prepared Ubuntu guest into an RDMA node on the emulated NIC, and prepare the host that serves it.
rocm-ernic emulates an RDMA NIC for a mesh of QEMU guests. Getting a guest to
the point where ibv_devices shows a device takes a DKMS kernel driver, an
rdma-core with the ionic provider, and addressing on the emulated NIC. This
collection packages that work so it can be applied to any guest, not just the
test mesh in the rocm-ernic repo.
The guest runs the upstream ionic and ionic_rdma drivers built by DKMS
from a patched upstream kernel tree, with the upstream providers/ionic, and
each instance gets a host TAP on a shared bridge so the guests can reach each
other over IP.
It does not build a guest image. The base image is expected to carry a kernel
new enough for the driver and the toolchain to build it — in this repo that is
the CI guest image, defined in ci/images/guest/ and
published to GHCR, which boots mainline 7.2.6 on Ubuntu 26.04 (resolute) and
has the RDMA userspace, DKMS toolchain and perftest. It has no password and
no SSH key: ernicctl vm-launch authorizes yours at each boot.
The kernel floor is not negotiable in either direction:
drivers/infiniband/hw/ionic merged in 6.18, and ionic-ernic calls
ib_umem_get_va, which lands after 7.0 — so a 7.0 guest compiles the floor
check and then fails the DKMS build. ernic_ionic_min_kernel asserts the
lower bound against the running guest.
| Role | Runs on | Purpose |
|---|---|---|
ernic_guest_setup |
guest VM | DKMS ionic driver, rdma-core, udev rules, NIC addressing, rocm-xio |
ernic_host_setup |
host | build/install/run the rocm-ernic service, TAP/bridge networking, bind GPUs to vfio-pci, stage rocm-xio |
ernic_source |
controller | resolve or clone the rocm-ernic checkout the others copy from (included automatically) |
ernic_srq_dkms |
host or guest | build the SRQ-patched ionic modules from files/patches/srq/ as a DKMS package; a compile gate by default |
ernic_srq_provider |
guest | build and install rdma-core's ionic provider with SRQ support, from files/patches/rdma-core/ |
ernic_p4_dkms |
guest | build and load ernic_p4.ko, the guest's control driver for the emulated NIC's P4 pipeline |
The collection is not published to Ansible Galaxy. Each release of it, tagged
ernic-ansible-v<VERSION>, carries the built collection as an asset, which
installs without cloning the rocm-ernic repo:
ansible-galaxy collection install \
https://github.com/ROCm/rocm-ernic/releases/download/ernic-ansible-v<VERSION>/rocm-ernic-<VERSION>.tar.gzOr in a requirements.yml:
collections:
- name: https://github.com/ROCm/rocm-ernic/releases/download/ernic-ansible-v<VERSION>/rocm-ernic-<VERSION>.tar.gz
type: urlFor a commit between releases, install it from that commit, matching the server you run:
ansible-galaxy collection install \
git+https://github.com/ROCm/rocm-ernic.git#/ansible/,<SHA>- name: Make each guest a rocm-ernic RDMA node
hosts: ernic_vms
become: true
roles:
- role: rocm.ernic.ernic_guest_setup
vars:
ernic_guest_vm_ip: "192.168.200.{{ 10 * (vm_index | int) }}"Set ernic_guest_build_deps: true if the base image does not already carry
dkms, cmake, ninja-build and the rdma-core build dependencies.
By default the roles clone ROCm/rocm-ernic on the controller to get the
driver and provider sources, at the version you set in
ernic_source_repo_version: the release's tag, or the SHA you installed the
collection from. Point them at a checkout you already have with
ernic_source_dir instead.
ernic_rdma_core_version defaults to 61.0, which Ubuntu 26.04 packages. The
role writes a provider stamp and skips the source build when the installed
provider already matches, so on resolute nothing is built and nothing
dpkg-owned is overwritten — and because nothing is overwritten, the packages
in ernic_rdma_core_hold_packages are left unheld and keep taking archive
updates. Raise it only for a provider genuinely newer than the archive's; the
source build that follows records itself in the guest, and the holds come back
with it on that run and on every later one.
ansible-core>= 2.18, which is whatcommunity.general>= 13.3.0 needscommunity.general>= 13.3.0 (modprobe,make)- A rocm-ernic checkout on the controller, or git and network access to clone one
- A guest running a kernel >= 6.18, and >= 7.2 to build
ionic-ernic
MIT