RoCE MTU Mismatch. Completion Error 12 / Vendor Err 129
RoCE MTU mismatches between the NIC and switch cause NCCL RDMA queue-pair errors (completion error 12, vendor error 129). Training hangs or crashes during NCCL init or the first collective. Denpex detects the MTU mismatch from NCCL debug logs and identifies the misconfigured endpoint.
RoCE MTU mismatches between the NIC and switch cause NCCL RDMA queue-pair errors (completion error 12, vendor error 129).
- Symptom
NCCL WARN Got completion with error 12, vendor err 129- Root cause
- The NIC MTU (active_mtu from ibstat) does not match the switch port MTU, causing RDMA packet fragmentation or drops that manifest as completion error 12. Vendor error 129 is Mellanox-specific: the NIC's firmware rejected the packet because the MTU exceeded the port's configured maximum. After a switch firmware upgrade, the default MTU may change from 2048 to 4096 without updating the NIC configuration.
- Recommended fix
NCCL_IB_RETRY_CNT=7- How Denpex helps
- Denpex investigates RoCE MTU Mismatch. Completion Error 12 / Vendor Err 129 using the evidence you provide or your connected workload collects. Earlier rank, host or application evidence is needed to distinguish an initiating failure from a downstream report.
What this failure is
RoCE MTU Mismatch. Completion Error 12 / Vendor Err 129 is a Communication failure seen during ML training runs. RoCE MTU mismatches between the NIC and switch cause NCCL RDMA queue-pair errors (completion error 12, vendor error 129). Training hangs or crashes during NCCL init or the first collective. Denpex detects the MTU mismatch from NCCL debug logs and identifies the misconfigured endpoint. Common tags: Roce, Mtu, Infiniband, Rdma.
Is this what broke your run? Paste your log.
You're reading about RoCE MTU Mismatch. Completion Error 12 / Vendor Err 129. Paste your own traceback and relevant evidence for an investigation of your workload, with a next action or a specific missing fact. A reference entry does not establish your cause. No account or card for the free diagnosis. Review data handling before submitting sensitive logs.
Before uploading, review cloud data handling and local options.
Upload your log file. Large files are processed in your browser. Only selected evidence is submitted when you run diagnosis.
Why it happens (the mechanism)
The NIC MTU (active_mtu from ibstat) does not match the switch port MTU, causing RDMA packet fragmentation or drops that manifest as completion error 12. Vendor error 129 is Mellanox-specific: the NIC's firmware rejected the packet because the MTU exceeded the port's configured maximum. After a switch firmware upgrade, the default MTU may change from 2048 to 4096 without updating the NIC configuration. Docker containers may inherit the host MTU but the RoCE device has a different MTU configured. Taken together, these mechanisms explain why the failure is reproducible, why it tends to surface on specific workloads or scales, and why generic mitigation attempts often fall short without addressing the underlying cause.
What you'll observe
- NCCL init succeeds but the first all-reduce or all-gather fails with completion error 12
- Training hangs at NCCL communication with ibv completion errors in dmesg
- Single-node training works but multi-node RoCE fails immediately
Common symptoms and what they mean
Check possible explanations against the incident evidence. A matching symptom alone does not establish its cause.
| Symptom | Possible explanation |
|---|---|
| NCCL WARN Got completion with error 12, vendor err 129 | The NIC MTU (active_mtu from ibstat) does not match the switch port MTU, causing RDMA packet fragmentation or drops that manifest as completion error 12 |
| ibv_post_send fails on specific node pairs but not others | Vendor error 129 is Mellanox-specific: the NIC's firmware rejected the packet because the MTU exceeded the port's configured maximum |
| NCCL_DEBUG=INFO shows IB transport errors during channel setup | After a switch firmware upgrade, the default MTU may change from 2048 to 4096 without updating the NIC configuration |
| ibstat shows active_mtu 2048 but switch port is configured for 4096 or vice versa | Docker containers may inherit the host MTU but the RoCE device has a different MTU configured |
Which systems are affected
- Multi-node training over RoCEv2 (Mellanox ConnectX-5/6/7)
- AWS EFA-based clusters with custom MTU settings
- Bare-metal clusters with mixed switch firmware
- Environments where switch MTU was changed without updating NIC MTU
How to confirm this is the problem
Use this checklist to test the hypothesis against a small reproduction. No single line proves the root cause, so preserve the preceding events and compare one variable at a time.
- ✓Reproduce the failure from a clean checkpoint/seed: the symptom must appear without warm-up state from a previous run.
- ✓Verified signal present: NCCL WARN Got completion with error 12, vendor err 129
- ✓Verified signal present: ibv_post_send fails on specific node pairs but not others
- ✓Verified signal present: NCCL_DEBUG=INFO shows IB transport errors during channel setup
- ✓Verified signal present: ibstat shows active_mtu 2048 but switch port is configured for 4096 or vice versa
- ✓A targeted fix from the "How to fix it" section eliminates or substantially reduces the symptom within one validation pass.
Root cause
- The NIC MTU (active_mtu from ibstat) does not match the switch port MTU, causing RDMA packet fragmentation or drops that manifest as completion error 12
- Vendor error 129 is Mellanox-specific: the NIC's firmware rejected the packet because the MTU exceeded the port's configured maximum
- After a switch firmware upgrade, the default MTU may change from 2048 to 4096 without updating the NIC configuration
- Docker containers may inherit the host MTU but the RoCE device has a different MTU configured
The fix and how to prevent it
How to fix it
- Verify MTU on both ends: run ibstat on every node and check active_mtu; compare with switch port MTU configuration
- Set MTU to 4096 on both NICs and switch ports for optimal RoCE performance: sudo ip link set dev ib0 mtu 4096
- After changing MTU, restart the RDMA subsystem: sudo systemctl restart opensmd or reboot the node
- Set NCCL_IB_RETRY_CNT=7 and NCCL_IB_TIMEOUT=22 to increase RDMA retry tolerance while the MTU is being fixed
- Use Denpex to validate MTU consistency across all nodes before launching multi-node training
Step-by-step remediation
- 1Verify MTU on both ends: run ibstat on every node and check active_mtu; compare with switch port MTU configuration
- 2Set MTU to 4096 on both NICs and switch ports for optimal RoCE performance: sudo ip link set dev ib0 mtu 4096
- 3After changing MTU, restart the RDMA subsystem: sudo systemctl restart opensmd or reboot the node
- 4Set NCCL_IB_RETRY_CNT=7 and NCCL_IB_TIMEOUT=22 to increase RDMA retry tolerance while the MTU is being fixed
- 5Use Denpex to validate MTU consistency across all nodes before launching multi-node training
How to prevent it
- Standardize MTU to 4096 across all RoCE NICs and switch ports in the cluster
- Add MTU validation to cluster health checks: ibstat | grep active_mtu must match across all nodes
- Include MTU checks in training job pre-flight scripts
- Use Denpex pre-flight validation to catch MTU mismatches before they waste GPU hours
Save this diagnosis and catch the next crash automatically
All root cause, fix, and prevention steps above are free to read. Create a free account with any email or GitHub to keep your saved diagnosis history across the encyclopedia and run cloud checks, or use a work email below for the 30-day Team evaluation. No card required.
Or start a 30-day free Team trial (work email)
Verified work email unlocks all 14 fleet diagnostic tools, Slack alerts, and team history for 30 days. No card and no automatic charge.
Searchable error signature
NCCL WARN Got completion with error 12, vendor err 129Use this text as a lookup key in logs and upstream issue trackers. It is not presented as a captured customer log. Confirm the cause from your own preceding events, versions, configuration and the cited references.
Diagnose your own log automatically
The root cause and fix steps above stay free. Create a free account to analyze full job logs, attribute the first failed rank, and keep saved incident history.
Sign up free. Analyze your cluster logsNo credit card. Daily allowance follows verified trust tier. Instant access.
Diagnose this failure in VS Code
Select the traceback or open the failed terminal, then run Denpex locally to inspect matched failure patterns, supporting evidence and next checks without uploading the log. Verify recommendations against your workload before changing production.
Install the free VS Code extensionNCCL errors in context
An NCCL error can follow an earlier worker failure. The hub connects documented collective errors with their interpretation limits, worker evidence and configuration checks.
Compare related nccl errorsRelated failures to investigate next
Don't just read the fix, diagnose your run
The encyclopedia explains documented failure patterns. Denpex investigates your logs, configuration and stack, shows the supporting evidence, and asks for missing details when needed.