Skip to content

[None][fix] Propagate NCCL_INCLUDE_DIR to common header dirs#16216

Open
lucifer1004 wants to merge 1 commit into
NVIDIA:mainfrom
lucifer1004:fix/nccl-include-dir
Open

[None][fix] Propagate NCCL_INCLUDE_DIR to common header dirs#16216
lucifer1004 wants to merge 1 commit into
NVIDIA:mainfrom
lucifer1004:fix/nccl-include-dir

Conversation

@lucifer1004

@lucifer1004 lucifer1004 commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

When building against a custom NCCL via --nccl_root (e.g. the pip nvidia-nccl-cu13 wheel, whose headers do not live in a compiler default path), FindNCCL resolves NCCL_INCLUDE_DIR correctly but the directory is never added to the compile include paths — multi-device translation units then fail with nccl.h: No such file or directory even though configure succeeded.

Append NCCL_INCLUDE_DIR to COMMON_HEADER_DIRS when ENABLE_MULTI_DEVICE is on. No behavior change for builds whose NCCL headers already sit in default include paths.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Fixed multi-device builds so components can locate the NCCL header when the NCCL include directory is configured.

build_wheel.py exposes --nccl_root and FindNCCL honors it, but the
located NCCL_INCLUDE_DIR was never propagated to compilation: nccl.h
is included from common/opUtils.h whenever ENABLE_MULTI_DEVICE is on,
including by targets that do not link NCCL::nccl. Builds only worked
when nccl.h happened to sit in the compiler's default search path (as
in the release containers), so pointing --nccl_root at an NCCL
installed anywhere else failed with 'nccl.h: No such file or
directory'. Append the found include directory to COMMON_HEADER_DIRS
so --nccl_root is usable end to end.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Zihua Wu <13583761+lucifer1004@users.noreply.github.com>
@lucifer1004 lucifer1004 requested a review from a team as a code owner July 10, 2026 04:53
@coderabbitai

coderabbitai Bot commented Jul 10, 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: CHILL

Plan: Enterprise

Run ID: 8381d5c4-66d1-4ffd-8ff9-d3e9767f40cc

📥 Commits

Reviewing files that changed from the base of the PR and between 6929451 and b251f8c.

📒 Files selected for processing (1)
  • cpp/CMakeLists.txt

📝 Walkthrough

Walkthrough

The CMake configuration now appends NCCL_INCLUDE_DIR to COMMON_HEADER_DIRS when multi-device support is enabled and the directory is available, allowing targets to locate nccl.h without directly linking NCCL::nccl.

Changes

Multi-device build configuration

Layer / File(s) Summary
Propagate NCCL include path
cpp/CMakeLists.txt
When ENABLE_MULTI_DEVICE is enabled and NCCL_INCLUDE_DIR is set, the build adds that directory to COMMON_HEADER_DIRS for nccl.h discovery.

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

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the issue and fix, but it omits the required Test Coverage and PR Checklist sections. Add a Test Coverage section and complete the PR Checklist items, or clearly mark any non-applicable items.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change and follows the repository's required [None][fix] format.
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant