Skip to content

contrib: exclude rdma-core libs from wheel packaging#1929

Open
GuangguanWang wants to merge 1 commit into
ai-dynamo:mainfrom
GuangguanWang:main
Open

contrib: exclude rdma-core libs from wheel packaging#1929
GuangguanWang wants to merge 1 commit into
ai-dynamo:mainfrom
GuangguanWang:main

Conversation

@GuangguanWang

@GuangguanWang GuangguanWang commented Jul 13, 2026

Copy link
Copy Markdown

Add libibverbs and libmlx5 to AUDITWHEEL_EXCLUDES so auditwheel does not bundle host RDMA userspace libraries into NIXL wheels. This avoids loading a wheel-private libibverbs alongside the system libibverbs used by other RDMA consumers such as NCCL, and lets UCX resolve rdma-core providers from the host environment.

What?

The NIXL wheel currently bundles two rdma-core shared libraries — libibverbs and libmlx5 — because they are not listed in AUDITWHEEL_EXCLUDES in contrib/build-wheel.sh. After auditwheel repair, these appear as renamed files in the wheel, for
example:

nixl_cu13.libs/libibverbs-1de1263b.so.1.14.48.0
nixl_cu13.libs/libmlx5-79ef1d27.so.1.24.48.0

(Verified from nixl-cu13==1.3.1 on PyPI.)

These libraries should be excluded from the wheel and resolved from the host system at runtime.

Why?

1. rdma-core must match the host kernel's RDMA subsystem

rdma-core libraries (libibverbs, provider plugins like libmlx5, etc.) communicate directly with kernel RDMA drivers via /dev/infiniband/ device nodes and kernel ABI. Bundling a fixed version in the wheel can produce silent failures or undefined behavior when deployed on hosts running a different kernel RDMA stack.

Furthermore, different deployment environments require different RDMA stacks — some use upstream rdma-core, while others require MLNX_OFED >= 5.0 for features like GPUDirect RDMA or SHARP. Bundling a specific rdma-core version in the wheel forces a single choice and prevents users from selecting the RDMA stack that matches their hardware and deployment requirements.

2. Dual-libibverbs conflict when NCCL and UCX coexist

NCCL is not bundled with the wheel, so when a process uses NCCL's IB net plugin, it resolves libibverbs.so from the system at runtime. Meanwhile, the UCX transport module libuct_ib.so inside the wheel has been patched by auditwheel to load the bundled libibverbs-<hash>.so.

If a process uses both NCCL and NIXL simultaneously:

UCX path:  wheel's libuct_ib.so → wheel's libibverbs-<hash>.so  (bundled copy)
NCCL path: NCCL IB net plugin  → system libibverbs.so.1         (system copy)

Two independent instances of libibverbs in the same process maintain separate device lists and internal state, which can cause unpredictable RDMA behavior.

3. Bundling libmlx5 locks out non-Mellanox RDMA providers

The wheel currently bundles libmlx5.so (a Mellanox/NVIDIA-specific userspace driver) as a build-time artifact. On hosts with non-Mellanox RDMA hardware — such as Alibaba eRDMA, Intel/Cornelis OPX, Broadcom, or other ibverbs-capable devices. These hosts provide their own vendor-specific provider libraries (e.g., liberdma.so, libhfi1.so) through the system's rdma-core installation.

By excluding rdma-core from the wheel, NIXL would use whatever ibverbs providers the host system offers, enabling RDMA support across a wider range of hardware.

Summary by CodeRabbit

  • Bug Fixes
    • Updated the wheel repair process to further prevent selected high-speed hardware communication libraries from being bundled into repaired wheel packages (by adding additional exclusion patterns).

@GuangguanWang
GuangguanWang requested a review from a team as a code owner July 13, 2026 07:21
@copy-pr-bot

copy-pr-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions

Copy link
Copy Markdown

👋 Hi GuangguanWang! Thank you for contributing to ai-dynamo/nixl.

Your PR reviewers will review your contribution then trigger the CI to test your changes.

🚀

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: ce9bb30a-d897-46e4-9e73-4fae20037989

📥 Commits

Reviewing files that changed from the base of the PR and between 65b31ec and 5c322bc.

📒 Files selected for processing (1)
  • contrib/build-wheel.sh

📝 Walkthrough

Walkthrough

The wheel build script expands its auditwheel repair exclusion list to include libibverbs* and libmlx5*.

Changes

Wheel build configuration

Layer / File(s) Summary
Extend auditwheel exclusions
contrib/build-wheel.sh
Adds libibverbs* and libmlx5* to AUDITWHEEL_EXCLUDES.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: excluding rdma-core libraries from wheel packaging.
Description check ✅ Passed The description includes the required What and Why sections and provides sufficient detail for the change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

Add libibverbs and libmlx5 to AUDITWHEEL_EXCLUDES so auditwheel does not
bundle host RDMA userspace libraries into NIXL wheels. This avoids loading
a wheel-private libibverbs alongside the system libibverbs used by other
RDMA consumers such as NCCL, and lets UCX resolve rdma-core providers from
the host environment.

Signed-off-by: Guangguan Wang <guangguan.wang@linux.alibaba.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant