NVIDIA / NVIDIA/cuopt

Hide internal C++ symbols exported from libcuopt

Open
#1,213 6 comments 0 reactions 1 assignee View on GitHub

@akifcorduk is already working on this.

Since May 14, 2026.

awaiting response
Dominant language
Cuda
Stars
1k
Forks
233
Avg merge
4d 4h
Merged PRs (30d)
95

Description

Summary

libcuopt.so currently exports a large internal C++/CUDA symbol surface, including CUB/Thrust/RAFT/RMM symbols and cuOpt detail implementation symbols. This matches the RAPIDS-wide symbol visibility problem tracked in rapidsai/build-infra#53.

Evidence

Local audit of cpp/build/latest/libcuopt.so with readelf --dyn-syms --wide | c++filt found approximately:

  • 10,383 defined dynamic symbols
  • 2,020 cub:: symbols
  • 2,318 thrust:: symbols
  • 1,028 raft:: symbols
  • 2,691 rmm:: symbols
  • 2,628 cuopt::linear_programming::detail symbols
  • 1,574 cuopt::routing::detail symbols
  • 376 grpc:: symbols
  • 361 google::protobuf symbols
  • 579 tbb:: symbols

detect-weak-linking (https://github.com/rapidsai/detect-weak-linking) did not report default weak CUDA kernel duplicates for the sampled test executable, but compute-sanitizer reports duplicate CUB kernel registration in test runs and the broad exported-symbol surface increases collision risk.

Desired direction

Follow the treatment used in RAPIDS libraries such as cuML, cuDF, RAFT, and RMM:

  • Set hidden-by-default visibility for cuOpt shared library targets.
  • Add a CUOPT_EXPORT macro for public ABI symbols.
  • Mark public C API declarations and any public C++ API/types/template instantiations that must remain visible.
  • Add a CI/package symbol check similar to cuDF's ci/check_symbols.sh, with cuOpt-specific forbidden export patterns.

References

  • rapidsai/build-infra#53
  • rapidsai/cuml#8037
  • rapidsai/cudf#15982
  • rapidsai/raft#3006
  • rapidsai/rmm#1654

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.