Skip to content

Fix CUDA profiling builds with NVTX3 - #479

Merged
shakedregev merged 1 commit into
developfrom
fix/cuda-nvtx3-profiling
Oct 6, 2026
Merged

shakedregev merged 1 commit into
developfrom
fix/cuda-nvtx3-profiling

Conversation

@nychiang

@nychiang nychiang commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Fix CUDA profiling builds with recent CUDA toolkits that no longer provide the legacy CUDA::nvToolsExt library target.

With CUDA 12.9, enabling RESOLVE_USE_PROFILING caused CMake generation to fail because libnvToolsExt is no longer shipped. NVTX3 is its supported header-only replacement.

No additional dependencies are required.

Proposed changes

  • Prefer the CMake CUDA::nvtx3 target when available.
  • Include <nvtx3/nvToolsExt.h> for NVTX3 builds.
  • Export RESOLVE_USE_NVTX3 to downstream consumers.
  • Retain CUDA::nvToolsExt as a fallback for older CUDA/CMake environments.

The change was built using CUDA 12.9.1 for SM90 and tested on an NVIDIA H100.

Checklist

  • All tests pass (make test and make test_install per testing instructions). Code tested on
    • CPU backend
    • CUDA backend
    • HIP backend
  • I have manually run the non-experimental examples and verified that residuals are close to machine precision. (In your build directory run: ./examples/<your_example>.exe -h to get instructions how to run examples). Code tested on:
    • CPU backend
    • CUDA backend
    • HIP backend
  • Code compiles cleanly with flags -Wall -Wpedantic -Wconversion -Wextra.
  • The new code follows Re::Solve style guidelines.
  • There are unit tests for the new code.
  • The new code is documented.
  • The feature branch is rebased with respect to the target branch.
  • I have updated CHANGELOG.md to reflect the changes in this PR. This is a minor CUDA compatibility fix, so no changelog entry was added.

Further comments

The following smoke tests passed:

  • CPU: version, matrix, logger, and parameter tests
  • CUDA: GMRES, sparse matrix, vector, and device-memory tests

The installed CMake package was also checked and correctly exports CUDA::nvtx3 and RESOLVE_USE_NVTX3.

@nychiang
nychiang requested a review from pelesh October 5, 2026 22:52

@shakedregev shakedregev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good and tested.

@shakedregev
shakedregev merged commit 1ccc7c3 into develop Oct 6, 2026
6 checks passed
@shakedregev
shakedregev deleted the fix/cuda-nvtx3-profiling branch October 6, 2026 16:09
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.

2 participants