Skip to content

[BUG] Source build fails against rmm 26.10: hand-rolled rmm::device_uvector forward declaration is ambiguous #1605

Description

@maxwbuckley

Describe the bug

Building libcuopt from source against rmm 26.10 fails to compile. rmm 26.10 places device_uvector inside an ABI inline namespace (rmm::RMM_ABI_NAMESPACE, see rmm/detail/export.hpp), while cuOpt hand-rolls a forward declaration of it in the plain rmm namespace in cpp/src/pdlp/utilities/problem_checking.cuh:

namespace rmm {
template <typename T>
class device_uvector;
}  // namespace rmm

This injects a second, distinct rmm::device_uvector, so every use becomes ambiguous.

Steps/Code to reproduce

Configure and build libcuopt from source with rmm 26.10 on the include path (CUDA 13.3 / GCC 14 / sm_120a here, but the ambiguity is compiler/arch independent).

Error

cpp/src/pdlp/utilities/problem_checking.cuh(36): error: "rmm::device_uvector" is ambiguous
cpp/src/utilities/copy_helpers.hpp(82): error: "rmm::device_uvector" is ambiguous
...

The failures then cascade into follow-on namespace "cuopt::raft" has no member "add_op" and thrust "this pragma must immediately precede a declaration" errors in the same translation units; all of them trace back to this one forward declaration (fixing it alone clears them).

Root cause

problem_checking.cuh is the only place in the tree that manually forward-declares an rmm type. cuOpt already opts out of thrust's and cub's ABI namespaces (-DTHRUST_DISABLE_ABI_NAMESPACE / -DCUB_DISABLE_NAMESPACE_MAGIC); rmm's ABI inline namespace is newer and has no such opt-out, so the plain forward declaration no longer matches rmm's real declaration.

Fix

Replace the hand-rolled forward declaration with #include <rmm/device_uvector.hpp> (rmm's own, correctly ABI-namespaced declaration). PR to follow.

Environment

  • cuOpt: main
  • rmm / raft: 26.10
  • CCCL: 3.4.0, CUDA 13.3 toolkit, GCC 14
  • GPU: RTX 5090 (sm_120a)

Metadata

Metadata

Labels

awaiting responseThis expects a response from maintainer or contributor depending on who requested in last comment.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions