Skip to content

GTEST: Distribute CUDA and ROCm test headers in make dist - #12223

Open
0z5a wants to merge 2 commits into
openucx:masterfrom
0z5a:fix/gtest-dist-headers
Open

0z5a wants to merge 2 commits into
openucx:masterfrom
0z5a:fix/gtest-dist-headers

Conversation

@0z5a

@0z5a 0z5a commented Nov 3, 2026 •

Copy link
Copy Markdown

What?

Add seven headers that the gtest sources include to noinst_HEADERS in test/gtest/Makefile.am, so make dist ships them:

  • common/cuda.h
  • uct/cuda/cuda_vmm_mem_buffer.h, uct/cuda/test_kernels.h, uct/cuda/test_kernels_uct.h
  • uct/rocm/test_kernels_uct.h
  • ucp/cuda/test_kernels.h, ucp/rndv_frag_mpools.h (the last one added in UCP/RNDV: Throttle rndv fragment requests #11062)

Why?

The tarball from make dist on current master can't build gtest with CUDA:

uct/test_device.cc:19:10: fatal error: cuda/test_kernels.h: No such file or directory

The distcheck jobs in buildlib/tools/builds.sh configure without CUDA or gtest, so CI doesn't catch this.

How?

Tested on master f3bca4b:

  • before (x86_64, CUDA 13.3): make dist, unpack, contrib/configure-release --with-cuda=... --enable-gtest && make → the error above;
  • after (aarch64, CUDA 13.2): the same steps build test/gtest/gtest, including the CUDA device tests (uct/test_device.cc).

🤖 Generated with Claude Code

Seven headers used by the gtest sources were missing from
noinst_HEADERS, so the tarball from "make dist" could not build gtest
with --with-cuda --enable-gtest:

  uct/test_device.cc:19:10: fatal error: cuda/test_kernels.h: No such file or directory

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@0z5a
0z5a requested a review from a team as a code owner November 3, 2026 14:39
@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

Comment thread test/gtest/Makefile.am
@@ -365,6 +365,7 @@ gtest_LDADD += \
endif

noinst_HEADERS = \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: can we also extend test/gtest/AGENTS.md ("New tests must be listed in the relevant Makefile.am source list") to mention noinst_HEADERS? 7 headers drifted out of the list, so a one-line rule there would stop it happening again.

Rationale: REVIEW.md asks reviewers to check whether changed folders need AGENTS.md guidance for recurring patterns, and the existing bullet in test/gtest/AGENTS.md covers only source lists, which is exactly the gap this PR cleans up.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in df008be: the bullet in test/gtest/AGENTS.md now also says new headers go in noinst_HEADERS so make dist ships them.

@svc-nvidia-pr-review

Copy link
Copy Markdown

Residual coverage gap (worth noting, not a blocker): both make distcheck invocations in buildlib/tools/builds.sh (build_release_pkg via contrib/configure-release, build_ugni via common_disable_config_args) run with gtest disabled, so nothing in CI builds gtest from a dist tarball. That is why the omission was never caught, and it also means CI will not prove the fix. Adding a gtest-enabled distcheck job is far heavier than this PR, so I would not ask for it here; worth keeping in mind if these entries drift again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Review complete — no issues found.

Comment thread test/gtest/Makefile.am
@@ -365,6 +365,7 @@ gtest_LDADD += \
endif

noinst_HEADERS = \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also fix the same gap in test/mpi/Makefile.am? test_cuda_check_def.h, test_cuda_common.h, test_lib_check_def.h, test_mpi_tags_def.h, test_ucp.h and test_ucx_check_def.h are not in noinst_HEADERS, so a tarball build with MPI and CUDA fails the same way; ompi.supp (used by run_mpi.sh) is also missing from EXTRA_DIST. Fine to do it in a separate PR if you prefer to keep this one gtest-only.

noinst_HEADERS = \
	test_cuda_check_def.h \
	test_cuda_common.h \
	test_lib_check_def.h \
	test_mpi_tags_def.h \
	test_ucp.h \
	test_ucx_check_def.h

EXTRA_DIST = ompi.supp

@tvegas1

tvegas1 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Did you or your organisation sign CLA?

This branch has not been deployed

No deployments
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.

3 participants