From f94918b1c9a094c0152d9b068e7bc947620552a9 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Fri, 3 Apr 2026 18:24:26 -0500 Subject: [PATCH 01/15] Migrate RMM usage to CCCL MR design Replace removed rmm::mr::device_memory_resource base class, owning_wrapper, shared_ptr-based resource management, and deprecated per-device resource APIs with CCCL-native memory resource types: value-typed resources, cuda::mr::any_resource for owning type-erased storage, and rmm::device_async_resource_ref for non-owning references. --- .../graph_operations/graph_operations.cu | 7 +++-- .../vertex_and_edge_partition.cu | 7 +++-- .../mg_graph_algorithms.cpp | 7 +++-- .../sg_graph_algorithms.cpp | 8 +++--- cpp/include/cugraph/algorithms.hpp | 2 +- cpp/include/cugraph/dendrogram.hpp | 4 +-- .../cugraph/host_staging_buffer_manager.hpp | 17 ++++-------- cpp/include/cugraph/large_buffer_manager.hpp | 16 +++++------ cpp/include/cugraph/legacy/functions.hpp | 4 +-- cpp/include/cugraph/legacy/graph.hpp | 8 +++--- cpp/include/cugraph/mtmg/resource_manager.hpp | 27 ++++++++++--------- cpp/tests/mtmg/multi_node_threaded_test.cpp | 2 +- cpp/tests/traversal/mg_graph500_bfs_test.cu | 12 ++++----- cpp/tests/traversal/mg_graph500_sssp_test.cu | 12 ++++----- cpp/tests/utilities/base_fixture.hpp | 21 ++++++++------- 15 files changed, 72 insertions(+), 82 deletions(-) diff --git a/cpp/examples/developers/graph_operations/graph_operations.cu b/cpp/examples/developers/graph_operations/graph_operations.cu index e29a4004498..db73853f6e3 100644 --- a/cpp/examples/developers/graph_operations/graph_operations.cu +++ b/cpp/examples/developers/graph_operations/graph_operations.cu @@ -40,12 +40,11 @@ std::unique_ptr initialize_mg_handle() int comm_rank{}; RAFT_MPI_TRY(MPI_Comm_rank(MPI_COMM_WORLD, &comm_rank)); - std::shared_ptr resource = - std::make_shared(); - rmm::mr::set_current_device_resource(resource.get()); + auto resource = rmm::mr::cuda_memory_resource(); + rmm::mr::set_current_device_resource_ref(resource); std::unique_ptr handle = - std::make_unique(rmm::cuda_stream_per_thread, resource); + std::make_unique(rmm::cuda_stream_per_thread); raft::comms::initialize_mpi_comms(handle.get(), MPI_COMM_WORLD); auto& comm = handle->get_comms(); diff --git a/cpp/examples/developers/vertex_and_edge_partition/vertex_and_edge_partition.cu b/cpp/examples/developers/vertex_and_edge_partition/vertex_and_edge_partition.cu index 8012f2d3d46..0984e2c2176 100644 --- a/cpp/examples/developers/vertex_and_edge_partition/vertex_and_edge_partition.cu +++ b/cpp/examples/developers/vertex_and_edge_partition/vertex_and_edge_partition.cu @@ -37,12 +37,11 @@ std::unique_ptr initialize_mg_handle() int comm_rank{}; RAFT_MPI_TRY(MPI_Comm_rank(MPI_COMM_WORLD, &comm_rank)); - std::shared_ptr resource = - std::make_shared(); - rmm::mr::set_current_device_resource(resource.get()); + auto resource = rmm::mr::cuda_memory_resource(); + rmm::mr::set_current_device_resource_ref(resource); std::unique_ptr handle = - std::make_unique(rmm::cuda_stream_per_thread, resource); + std::make_unique(rmm::cuda_stream_per_thread); raft::comms::initialize_mpi_comms(handle.get(), MPI_COMM_WORLD); auto& comm = handle->get_comms(); diff --git a/cpp/examples/users/multi_gpu_application/mg_graph_algorithms.cpp b/cpp/examples/users/multi_gpu_application/mg_graph_algorithms.cpp index 721b1a62012..9a003e3ffab 100644 --- a/cpp/examples/users/multi_gpu_application/mg_graph_algorithms.cpp +++ b/cpp/examples/users/multi_gpu_application/mg_graph_algorithms.cpp @@ -32,12 +32,11 @@ std::unique_ptr initialize_mg_handle() int comm_rank{}; RAFT_MPI_TRY(MPI_Comm_rank(MPI_COMM_WORLD, &comm_rank)); - std::shared_ptr resource = - std::make_shared(); - rmm::mr::set_current_device_resource(resource.get()); + auto resource = rmm::mr::cuda_memory_resource(); + rmm::mr::set_current_device_resource_ref(resource); std::unique_ptr handle = - std::make_unique(rmm::cuda_stream_per_thread, resource); + std::make_unique(rmm::cuda_stream_per_thread); raft::comms::initialize_mpi_comms(handle.get(), MPI_COMM_WORLD); auto& comm = handle->get_comms(); diff --git a/cpp/examples/users/single_gpu_application/sg_graph_algorithms.cpp b/cpp/examples/users/single_gpu_application/sg_graph_algorithms.cpp index bb962001594..2c56d6449b5 100644 --- a/cpp/examples/users/single_gpu_application/sg_graph_algorithms.cpp +++ b/cpp/examples/users/single_gpu_application/sg_graph_algorithms.cpp @@ -15,12 +15,10 @@ std::unique_ptr initialize_sg_handle() { RAFT_CUDA_TRY(cudaSetDevice(0)); - std::shared_ptr resource = - std::make_shared(); - rmm::mr::set_current_device_resource(resource.get()); + auto resource = rmm::mr::cuda_memory_resource(); + rmm::mr::set_current_device_resource_ref(resource); - std::unique_ptr handle = - std::make_unique(rmm::cuda_stream_per_thread, resource); + std::unique_ptr handle = std::make_unique(); return std::move(handle); } diff --git a/cpp/include/cugraph/algorithms.hpp b/cpp/include/cugraph/algorithms.hpp index b0a626cbf7c..c035a8e239c 100644 --- a/cpp/include/cugraph/algorithms.hpp +++ b/cpp/include/cugraph/algorithms.hpp @@ -840,7 +840,7 @@ template std::unique_ptr> minimum_spanning_tree( raft::handle_t const& handle, legacy::GraphCSRView const& graph, - rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource_ref()); namespace subgraph { /** diff --git a/cpp/include/cugraph/dendrogram.hpp b/cpp/include/cugraph/dendrogram.hpp index 3faa8251b70..f69ad0afb5a 100644 --- a/cpp/include/cugraph/dendrogram.hpp +++ b/cpp/include/cugraph/dendrogram.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -18,7 +18,7 @@ class Dendrogram { void add_level(vertex_t first_index, vertex_t num_verts, rmm::cuda_stream_view stream_view, - rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()) + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource_ref()) { level_ptr_.push_back( std::make_unique>(num_verts, stream_view, mr)); diff --git a/cpp/include/cugraph/host_staging_buffer_manager.hpp b/cpp/include/cugraph/host_staging_buffer_manager.hpp index 77bcf397d9a..59590262f8c 100644 --- a/cpp/include/cugraph/host_staging_buffer_manager.hpp +++ b/cpp/include/cugraph/host_staging_buffer_manager.hpp @@ -10,12 +10,10 @@ #include #include -#include #include #include #include -#include #include namespace cugraph { @@ -32,14 +30,12 @@ class host_staging_buffer_manager { return s.initialized; } - static void init(raft::handle_t const& handle, - std::shared_ptr pinned_mr) + static void init(raft::handle_t const& handle, rmm::mr::pinned_host_memory_resource pinned_mr) { auto& s = state(); CUGRAPH_EXPECTS(s.initialized == false, "host_staging_buffer_manager is already initialized."); - s.initialized = true; - s.pinned_pool_mr = rmm::mr::make_owning_wrapper( - std::move(pinned_mr), init_staging_buffer_size, max_staging_buffer_size); + s.initialized = true; + s.pinned_pool_mr.emplace(pinned_mr, init_staging_buffer_size, max_staging_buffer_size); } static void clear() @@ -53,16 +49,13 @@ class host_staging_buffer_manager { static rmm::device_uvector allocate_staging_buffer(size_t size, rmm::cuda_stream_view stream) { auto& s = state(); - return rmm::device_uvector(size, stream, s.pinned_pool_mr.get()); + return rmm::device_uvector(size, stream, *s.pinned_pool_mr); } private: struct state_t { bool initialized = false; - std::shared_ptr< - rmm::mr::owning_wrapper, - rmm::mr::pinned_host_memory_resource>> - pinned_pool_mr{}; + std::optional pinned_pool_mr{}; }; static state_t& state() diff --git a/cpp/include/cugraph/large_buffer_manager.hpp b/cpp/include/cugraph/large_buffer_manager.hpp index 140105596c3..3413b699678 100644 --- a/cpp/include/cugraph/large_buffer_manager.hpp +++ b/cpp/include/cugraph/large_buffer_manager.hpp @@ -12,8 +12,8 @@ #include #include #include +#include -#include #include namespace cugraph { @@ -23,17 +23,15 @@ namespace detail { class large_memory_buffer_resource_t { public: large_memory_buffer_resource_t() = delete; - large_memory_buffer_resource_t(std::shared_ptr mr) : mr_(mr) - { - } + large_memory_buffer_resource_t(rmm::mr::pinned_host_memory_resource mr) : mr_(mr) {} - rmm::mr::pinned_host_memory_resource* get() const { return mr_.get(); } + rmm::device_async_resource_ref get() { return mr_; } private: - std::shared_ptr + rmm::mr::pinned_host_memory_resource mr_{}; // currently, large memory buffer is backed by CUDA (rmm) pinned host memory, in the // future, we may support different memory resources, in that case, we may update mr_ to - // a std::shared_ptr of a std::variant type, and add additional constructors taking + // a std::variant type, and add additional constructors taking // different memory resources. }; @@ -91,9 +89,9 @@ class large_buffer_manager { } static detail::large_memory_buffer_resource_t create_memory_buffer_resource( - std::shared_ptr mr) + rmm::mr::pinned_host_memory_resource mr) { - return detail::large_memory_buffer_resource_t(std::move(mr)); + return detail::large_memory_buffer_resource_t(mr); } static detail::large_storage_buffer_resource_t create_storage_buffer_resource() diff --git a/cpp/include/cugraph/legacy/functions.hpp b/cpp/include/cugraph/legacy/functions.hpp index 7d2fc0f5214..80ec4a3f8ae 100644 --- a/cpp/include/cugraph/legacy/functions.hpp +++ b/cpp/include/cugraph/legacy/functions.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2020-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -40,7 +40,7 @@ namespace cugraph { template std::unique_ptr> coo_to_csr( legacy::GraphCOOView const& graph, - rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()); + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource_ref()); /** * @brief Broadcast using handle communicator diff --git a/cpp/include/cugraph/legacy/graph.hpp b/cpp/include/cugraph/legacy/graph.hpp index f0cec8410b3..c6a9c243119 100644 --- a/cpp/include/cugraph/legacy/graph.hpp +++ b/cpp/include/cugraph/legacy/graph.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2020-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -358,7 +358,7 @@ class GraphCOO { edge_t number_of_edges, bool has_data = false, cudaStream_t stream = nullptr, - rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()) + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource_ref()) : number_of_vertices_p(number_of_vertices), number_of_edges_p(number_of_edges), src_indices_p(sizeof(vertex_t) * number_of_edges, stream, mr), @@ -369,7 +369,7 @@ class GraphCOO { GraphCOO(GraphCOOView const& graph, cudaStream_t stream = nullptr, - rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()) + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource_ref()) : number_of_vertices_p(graph.number_of_vertices), number_of_edges_p(graph.number_of_edges), src_indices_p(graph.src_indices, graph.number_of_edges * sizeof(vertex_t), stream, mr), @@ -540,7 +540,7 @@ class GraphCSR : public GraphCompressedSparseBase { edge_t number_of_edges_, bool has_data_ = false, cudaStream_t stream = nullptr, - rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource()) + rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource_ref()) : GraphCompressedSparseBase( number_of_vertices_, number_of_edges_, has_data_, stream, mr) { diff --git a/cpp/include/cugraph/mtmg/resource_manager.hpp b/cpp/include/cugraph/mtmg/resource_manager.hpp index f07abb3a4a7..20890c95bfd 100644 --- a/cpp/include/cugraph/mtmg/resource_manager.hpp +++ b/cpp/include/cugraph/mtmg/resource_manager.hpp @@ -13,9 +13,10 @@ #include #include -#include #include +#include + #include #include @@ -94,20 +95,24 @@ class resource_manager_t { // Ultimately there should be some RMM parameters passed into this function // (or the constructor of the object) to configure this behavior #if 0 - auto per_device_it = per_device_rmm_resources_.insert( - std::pair{global_rank, std::make_shared()}); + per_device_rmm_resources_.insert( + std::pair{global_rank, + cuda::mr::any_resource( + rmm::mr::cuda_memory_resource())}); #else auto const [free, total] = rmm::available_device_memory(); auto const min_alloc = rmm::align_down(std::min(free, total / 6), rmm::CUDA_ALLOCATION_ALIGNMENT); - auto per_device_it = per_device_rmm_resources_.insert( + auto upstream = rmm::mr::cuda_memory_resource(); + per_device_rmm_resources_.insert( std::pair{global_rank, - rmm::mr::make_owning_wrapper( - std::make_shared(), min_alloc)}); + cuda::mr::any_resource( + rmm::mr::pool_memory_resource(upstream, min_alloc))}); #endif - rmm::mr::set_per_device_resource_ref(local_device_id, per_device_it.first->second.get()); + rmm::mr::set_per_device_resource_ref(local_device_id, + per_device_rmm_resources_.find(global_rank)->second); } /** @@ -181,10 +186,8 @@ class resource_manager_t { rmm::cuda_set_device_raii local_set_device(pos->second); nccl_comms.push_back(std::make_unique()); - handles.push_back( - std::make_unique(rmm::cuda_stream_per_thread, - std::make_shared(n_streams), - per_device_rmm_resources_.find(rank)->second)); + handles.push_back(std::make_unique( + rmm::cuda_stream_per_thread, std::make_shared(n_streams))); device_ids.push_back(pos->second); RAFT_NCCL_TRY( @@ -243,7 +246,7 @@ class resource_manager_t { mutable std::mutex lock_{}; std::map local_rank_map_{}; std::set remote_rank_set_{}; - std::map> per_device_rmm_resources_{}; + std::map> per_device_rmm_resources_{}; }; } // namespace mtmg diff --git a/cpp/tests/mtmg/multi_node_threaded_test.cpp b/cpp/tests/mtmg/multi_node_threaded_test.cpp index 2dd39ad4b11..7a048be2655 100644 --- a/cpp/tests/mtmg/multi_node_threaded_test.cpp +++ b/cpp/tests/mtmg/multi_node_threaded_test.cpp @@ -473,7 +473,7 @@ int main(int argc, char** argv) auto const cmd_opts = parse_test_options(argc, argv); auto const rmm_mode = cmd_opts["rmm_mode"].as(); auto resource = cugraph::test::create_memory_resource(rmm_mode); - rmm::mr::set_current_device_resource(resource.get()); + rmm::mr::set_current_device_resource_ref(resource); cugraph::test::g_perf = cmd_opts["perf"].as(); cugraph::test::g_rmat_scale = (cmd_opts.count("rmat_scale") > 0) ? std::make_optional(cmd_opts["rmat_scale"].as()) diff --git a/cpp/tests/traversal/mg_graph500_bfs_test.cu b/cpp/tests/traversal/mg_graph500_bfs_test.cu index 9638e01582e..890c88506bf 100644 --- a/cpp/tests/traversal/mg_graph500_bfs_test.cu +++ b/cpp/tests/traversal/mg_graph500_bfs_test.cu @@ -75,13 +75,13 @@ class Tests_GRAPH500_MGBFS // than pool_size to avoid false dependency among different streams handle_ = cugraph::test::initialize_mg_handle(pool_size); - pinned_mr_ = std::make_shared(); + pinned_mr_ = rmm::mr::pinned_host_memory_resource(); cugraph::large_buffer_manager::init( *handle_, - cugraph::large_buffer_manager::create_memory_buffer_resource(pinned_mr_), + cugraph::large_buffer_manager::create_memory_buffer_resource(*pinned_mr_), std::nullopt); - cugraph::host_staging_buffer_manager::init(*handle_, pinned_mr_); + cugraph::host_staging_buffer_manager::init(*handle_, *pinned_mr_); } static void TearDownTestCase() @@ -989,14 +989,14 @@ class Tests_GRAPH500_MGBFS private: static std::unique_ptr handle_; - static std::shared_ptr pinned_mr_; + static std::optional pinned_mr_; }; template std::unique_ptr Tests_GRAPH500_MGBFS::handle_ = nullptr; template -std::shared_ptr - Tests_GRAPH500_MGBFS::pinned_mr_ = nullptr; +std::optional + Tests_GRAPH500_MGBFS::pinned_mr_ = std::nullopt; using Tests_GRAPH500_MGBFS_Rmat = Tests_GRAPH500_MGBFS; diff --git a/cpp/tests/traversal/mg_graph500_sssp_test.cu b/cpp/tests/traversal/mg_graph500_sssp_test.cu index 6281f7cbfc7..854ba1da988 100644 --- a/cpp/tests/traversal/mg_graph500_sssp_test.cu +++ b/cpp/tests/traversal/mg_graph500_sssp_test.cu @@ -39,7 +39,7 @@ #include #include -#include +#include #include #include @@ -76,11 +76,11 @@ class Tests_GRAPH500_MGSSSP 12; // note that CUDA_DEVICE_MAX_CONNECTIONS (default: 8) should be set to a value larger // than pool_size to avoid false dependency among different streams handle_ = cugraph::test::initialize_mg_handle(pool_size); - pinned_mr_ = std::make_shared(); + pinned_mr_ = rmm::mr::pinned_host_memory_resource(); cugraph::large_buffer_manager::init( *handle_, - cugraph::large_buffer_manager::create_memory_buffer_resource(pinned_mr_), + cugraph::large_buffer_manager::create_memory_buffer_resource(*pinned_mr_), std::nullopt); } @@ -1091,14 +1091,14 @@ class Tests_GRAPH500_MGSSSP private: static std::unique_ptr handle_; - static std::shared_ptr pinned_mr_; + static std::optional pinned_mr_; }; template std::unique_ptr Tests_GRAPH500_MGSSSP::handle_ = nullptr; template -std::shared_ptr - Tests_GRAPH500_MGSSSP::pinned_mr_ = nullptr; +std::optional + Tests_GRAPH500_MGSSSP::pinned_mr_ = std::nullopt; using Tests_GRAPH500_MGSSSP_Rmat = Tests_GRAPH500_MGSSSP; diff --git a/cpp/tests/utilities/base_fixture.hpp b/cpp/tests/utilities/base_fixture.hpp index adbb91a1f43..60a3b4b4949 100644 --- a/cpp/tests/utilities/base_fixture.hpp +++ b/cpp/tests/utilities/base_fixture.hpp @@ -15,11 +15,12 @@ #include #include #include -#include #include #include #include +#include + #include #include @@ -42,7 +43,7 @@ namespace test { * ``` **/ class BaseFixture : public ::testing::Test { - rmm::device_async_resource_ref _mr{rmm::mr::get_current_device_resource()}; + rmm::device_async_resource_ref _mr{rmm::mr::get_current_device_resource_ref()}; public: /** @@ -53,9 +54,9 @@ class BaseFixture : public ::testing::Test { }; /// MR factory functions -inline auto make_cuda() { return std::make_shared(); } +inline auto make_cuda() { return rmm::mr::cuda_memory_resource(); } -inline auto make_managed() { return std::make_shared(); } +inline auto make_managed() { return rmm::mr::managed_memory_resource(); } // use_max set to true will use half of available GPU memory for RMM, otherwise // otherwise we'll use 1/10. @@ -69,7 +70,8 @@ inline auto make_pool(bool use_max = false) auto const min_alloc = use_max ? rmm::align_down(std::min(free, total / 2), rmm::CUDA_ALLOCATION_ALIGNMENT) : rmm::align_down(std::min(free, total / 10), rmm::CUDA_ALLOCATION_ALIGNMENT); - return rmm::mr::make_owning_wrapper(make_cuda(), min_alloc); + auto upstream = make_cuda(); + return rmm::mr::pool_memory_resource(upstream, min_alloc); } inline auto make_binning() @@ -77,8 +79,7 @@ inline auto make_binning() auto pool = make_pool(); // Add a fixed_size_memory_resource for bins of size 256, 512, 1024, 2048 and 4096KiB // Larger allocations will use the pool resource - auto mr = rmm::mr::make_owning_wrapper(pool, 18, 22); - return mr; + return rmm::mr::binning_memory_resource(pool, 18, 22); } /** @@ -96,7 +97,7 @@ inline auto make_binning() * "maxpool" only. * @return Memory resource instance */ -inline std::shared_ptr create_memory_resource( +inline cuda::mr::any_resource create_memory_resource( std::string const& allocation_mode) { if (allocation_mode == "binning") return make_binning(); @@ -200,7 +201,7 @@ inline auto parse_test_options(int argc, char** argv) auto const cmd_opts = parse_test_options(argc, argv); \ auto const rmm_mode = cmd_opts["rmm_mode"].as(); \ auto resource = cugraph::test::create_memory_resource(rmm_mode); \ - rmm::mr::set_current_device_resource_ref(resource.get()); \ + rmm::mr::set_current_device_resource_ref(resource); \ cugraph::test::g_perf = cmd_opts["perf"].as(); \ cugraph::test::g_rmat_scale = \ (cmd_opts.count("rmat_scale") > 0) \ @@ -231,7 +232,7 @@ inline auto parse_test_options(int argc, char** argv) auto const cmd_opts = parse_test_options(argc, argv); \ auto const rmm_mode = cmd_opts["rmm_mode"].as(); \ auto resource = cugraph::test::create_memory_resource(rmm_mode); \ - rmm::mr::set_current_device_resource_ref(resource.get()); \ + rmm::mr::set_current_device_resource_ref(resource); \ cugraph::test::g_perf = cmd_opts["perf"].as(); \ cugraph::test::g_rmat_scale = \ (cmd_opts.count("rmat_scale") > 0) \ From e8e30a37512d6f86eb98e006b8e86359dbdbc680 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Wed, 15 Apr 2026 11:42:08 -0500 Subject: [PATCH 02/15] Inline upstream memory resource variable in test fixture MR composition --- cpp/tests/utilities/base_fixture.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cpp/tests/utilities/base_fixture.hpp b/cpp/tests/utilities/base_fixture.hpp index 60a3b4b4949..10de4f9e0d0 100644 --- a/cpp/tests/utilities/base_fixture.hpp +++ b/cpp/tests/utilities/base_fixture.hpp @@ -70,8 +70,7 @@ inline auto make_pool(bool use_max = false) auto const min_alloc = use_max ? rmm::align_down(std::min(free, total / 2), rmm::CUDA_ALLOCATION_ALIGNMENT) : rmm::align_down(std::min(free, total / 10), rmm::CUDA_ALLOCATION_ALIGNMENT); - auto upstream = make_cuda(); - return rmm::mr::pool_memory_resource(upstream, min_alloc); + return rmm::mr::pool_memory_resource(make_cuda(), min_alloc); } inline auto make_binning() From c0332eca2c60a9b0f8daf5e8f67c0595f07c5635 Mon Sep 17 00:00:00 2001 From: Charles Hastings Date: Thu, 16 Apr 2026 12:56:23 -0700 Subject: [PATCH 03/15] Some cmake changes to try and resolve latest JIT issue --- cpp/CMakeLists.txt | 6 +++++- cpp/tests/CMakeLists.txt | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 6836f47fa4a..d5801bff537 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -471,6 +471,9 @@ SECTIONS } ]=]) +set_property(TARGET cugraph PROPERTY NO_CUDART_DEP ON) +set_property(TARGET cugraph_mg PROPERTY NO_CUDART_DEP ON) + set(cugraph_suffixes "" "_mg") foreach(suffix IN LISTS cugraph_suffixes) set_target_properties(cugraph${suffix} @@ -511,13 +514,14 @@ foreach(suffix IN LISTS cugraph_suffixes) # - link libraries ------------------------------------------------------------- target_link_libraries(cugraph${suffix} PUBLIC - rmm::rmm raft::raft $ PRIVATE ${COMPILED_RAFT_LIB} $,cuvs::cuvs_static,cuvs::cuvs> # cuco::cuco + rmm::rmm + INTERFACE $ ) ################################################################################ diff --git a/cpp/tests/CMakeLists.txt b/cpp/tests/CMakeLists.txt index 6e9ec49f3e7..333a212ba0b 100644 --- a/cpp/tests/CMakeLists.txt +++ b/cpp/tests/CMakeLists.txt @@ -47,6 +47,7 @@ target_compile_options(cugraphtestutil ) set_property(TARGET cugraphtestutil PROPERTY POSITION_INDEPENDENT_CODE ON) +set_property(TARGET cugraphtestutil PROPERTY NO_CUDART_DEP ON) target_include_directories(cugraphtestutil PUBLIC @@ -83,6 +84,7 @@ target_include_directories(cugraph_c_testutil ) set_property(TARGET cugraph_c_testutil PROPERTY POSITION_INDEPENDENT_CODE ON) +set_property(TARGET cugraph_c_testutil PROPERTY NO_CUDART_DEP ON) target_link_libraries(cugraph_c_testutil PUBLIC @@ -114,6 +116,7 @@ if(BUILD_CUGRAPH_MG_TESTS) ) set_property(TARGET cugraphmgtestutil PROPERTY POSITION_INDEPENDENT_CODE ON) + set_property(TARGET cugraphmgtestutil PROPERTY NO_CUDART_DEP ON) target_compile_options(cugraphmgtestutil PUBLIC "$<$:${CUGRAPH_CXX_FLAGS}>" From 9a3ba99721dda49cbeed46b8bd6cf4a5f2ca0810 Mon Sep 17 00:00:00 2001 From: Charles Hastings Date: Thu, 16 Apr 2026 13:29:23 -0700 Subject: [PATCH 04/15] add host dependency on cuda-nvrtc --- conda/environments/all_cuda-129_arch-aarch64.yaml | 1 + conda/environments/all_cuda-129_arch-x86_64.yaml | 1 + conda/environments/all_cuda-131_arch-aarch64.yaml | 1 + conda/environments/all_cuda-131_arch-x86_64.yaml | 1 + conda/recipes/libcugraph/recipe.yaml | 2 ++ dependencies.yaml | 5 +++-- python/libcugraph/pyproject.toml | 2 +- 7 files changed, 10 insertions(+), 3 deletions(-) diff --git a/conda/environments/all_cuda-129_arch-aarch64.yaml b/conda/environments/all_cuda-129_arch-aarch64.yaml index 48bdb46bb48..02b6ba3c826 100644 --- a/conda/environments/all_cuda-129_arch-aarch64.yaml +++ b/conda/environments/all_cuda-129_arch-aarch64.yaml @@ -11,6 +11,7 @@ dependencies: - certifi - cmake>=3.30.4 - cuda-nvcc +- cuda-nvrtc-dev - cuda-nvtx-dev - cuda-profiler-api - cuda-python>=12.9.2,<13.0 diff --git a/conda/environments/all_cuda-129_arch-x86_64.yaml b/conda/environments/all_cuda-129_arch-x86_64.yaml index 318f625f522..8259a6b0922 100644 --- a/conda/environments/all_cuda-129_arch-x86_64.yaml +++ b/conda/environments/all_cuda-129_arch-x86_64.yaml @@ -11,6 +11,7 @@ dependencies: - certifi - cmake>=3.30.4 - cuda-nvcc +- cuda-nvrtc-dev - cuda-nvtx-dev - cuda-profiler-api - cuda-python>=12.9.2,<13.0 diff --git a/conda/environments/all_cuda-131_arch-aarch64.yaml b/conda/environments/all_cuda-131_arch-aarch64.yaml index 8b35674a6a3..8fdc36ae59e 100644 --- a/conda/environments/all_cuda-131_arch-aarch64.yaml +++ b/conda/environments/all_cuda-131_arch-aarch64.yaml @@ -11,6 +11,7 @@ dependencies: - certifi - cmake>=3.30.4 - cuda-nvcc +- cuda-nvrtc-dev - cuda-nvtx-dev - cuda-profiler-api - cuda-python>=13.0.1,<14.0 diff --git a/conda/environments/all_cuda-131_arch-x86_64.yaml b/conda/environments/all_cuda-131_arch-x86_64.yaml index 3a3c9b626a4..e453bf42040 100644 --- a/conda/environments/all_cuda-131_arch-x86_64.yaml +++ b/conda/environments/all_cuda-131_arch-x86_64.yaml @@ -11,6 +11,7 @@ dependencies: - certifi - cmake>=3.30.4 - cuda-nvcc +- cuda-nvrtc-dev - cuda-nvtx-dev - cuda-profiler-api - cuda-python>=13.0.1,<14.0 diff --git a/conda/recipes/libcugraph/recipe.yaml b/conda/recipes/libcugraph/recipe.yaml index 279a01d2924..e5764e2805f 100644 --- a/conda/recipes/libcugraph/recipe.yaml +++ b/conda/recipes/libcugraph/recipe.yaml @@ -79,6 +79,8 @@ cache: - nccl ${{ nccl_version }} - openmpi <5.0.3 # Required for building cpp-mgtests (multi-GPU tests) - rapids-build-backend >=0.4.0,<0.5.0 + - cuda-cudart-dev + - cuda-nvrtc-dev - cuda-nvtx-dev - cuda-profiler-api - libcublas-dev diff --git a/dependencies.yaml b/dependencies.yaml index 8b3aeba94a3..5091ea09a53 100755 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -299,6 +299,7 @@ dependencies: common: - output_types: [conda] packages: + - cuda-nvrtc-dev - cuda-nvtx-dev - cuda-profiler-api - libcublas-dev @@ -328,13 +329,13 @@ dependencies: cuda: "12.9" use_cuda_wheels: "true" packages: - - cuda-toolkit[cublas,curand,cusolver,cusparse]==12.* + - cuda-toolkit[cublas,curand,cusolver,cusparse,nvrtc]==12.* - nvidia-nvjitlink-cu12>=12.9,<13 - matrix: cuda: "13.*" use_cuda_wheels: "true" packages: - - &ctk_cu13 cuda-toolkit[cublas,curand,cusolver,cusparse]==13.* + - &ctk_cu13 cuda-toolkit[cublas,curand,cusolver,cusparse,nvrtc]==13.* - &nvjitlink_cu13 nvidia-nvjitlink>=13.0,<14 # if no matching matrix selectors passed, list the CUDA 13 requirement # (just as a source of documentation, as this populates pyproject.toml in source control) diff --git a/python/libcugraph/pyproject.toml b/python/libcugraph/pyproject.toml index 902621d1afe..0a978b37b3e 100644 --- a/python/libcugraph/pyproject.toml +++ b/python/libcugraph/pyproject.toml @@ -26,7 +26,7 @@ classifiers = [ "Environment :: GPU :: NVIDIA CUDA", ] dependencies = [ - "cuda-toolkit[cublas,curand,cusolver,cusparse]==13.*", + "cuda-toolkit[cublas,curand,cusolver,cusparse,nvrtc]==13.*", "libraft==26.6.*,>=0.0.0a0", "librmm==26.6.*,>=0.0.0a0", "nvidia-nvjitlink>=13.0,<14", From dd809dd4dbc1a339308e5a38aa582bb976fca083 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Thu, 16 Apr 2026 11:01:01 -0500 Subject: [PATCH 05/15] Replace deprecated set_current_device_resource_ref with set_current_device_resource --- cpp/examples/developers/graph_operations/graph_operations.cu | 2 +- .../vertex_and_edge_partition/vertex_and_edge_partition.cu | 2 +- .../users/multi_gpu_application/mg_graph_algorithms.cpp | 2 +- .../users/single_gpu_application/sg_graph_algorithms.cpp | 2 +- cpp/tests/mtmg/multi_node_threaded_test.cpp | 2 +- cpp/tests/utilities/base_fixture.hpp | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cpp/examples/developers/graph_operations/graph_operations.cu b/cpp/examples/developers/graph_operations/graph_operations.cu index db73853f6e3..72fa0e88966 100644 --- a/cpp/examples/developers/graph_operations/graph_operations.cu +++ b/cpp/examples/developers/graph_operations/graph_operations.cu @@ -41,7 +41,7 @@ std::unique_ptr initialize_mg_handle() RAFT_MPI_TRY(MPI_Comm_rank(MPI_COMM_WORLD, &comm_rank)); auto resource = rmm::mr::cuda_memory_resource(); - rmm::mr::set_current_device_resource_ref(resource); + rmm::mr::set_current_device_resource(resource); std::unique_ptr handle = std::make_unique(rmm::cuda_stream_per_thread); diff --git a/cpp/examples/developers/vertex_and_edge_partition/vertex_and_edge_partition.cu b/cpp/examples/developers/vertex_and_edge_partition/vertex_and_edge_partition.cu index 0984e2c2176..66afd41cc9e 100644 --- a/cpp/examples/developers/vertex_and_edge_partition/vertex_and_edge_partition.cu +++ b/cpp/examples/developers/vertex_and_edge_partition/vertex_and_edge_partition.cu @@ -38,7 +38,7 @@ std::unique_ptr initialize_mg_handle() RAFT_MPI_TRY(MPI_Comm_rank(MPI_COMM_WORLD, &comm_rank)); auto resource = rmm::mr::cuda_memory_resource(); - rmm::mr::set_current_device_resource_ref(resource); + rmm::mr::set_current_device_resource(resource); std::unique_ptr handle = std::make_unique(rmm::cuda_stream_per_thread); diff --git a/cpp/examples/users/multi_gpu_application/mg_graph_algorithms.cpp b/cpp/examples/users/multi_gpu_application/mg_graph_algorithms.cpp index 9a003e3ffab..b54189348e8 100644 --- a/cpp/examples/users/multi_gpu_application/mg_graph_algorithms.cpp +++ b/cpp/examples/users/multi_gpu_application/mg_graph_algorithms.cpp @@ -33,7 +33,7 @@ std::unique_ptr initialize_mg_handle() RAFT_MPI_TRY(MPI_Comm_rank(MPI_COMM_WORLD, &comm_rank)); auto resource = rmm::mr::cuda_memory_resource(); - rmm::mr::set_current_device_resource_ref(resource); + rmm::mr::set_current_device_resource(resource); std::unique_ptr handle = std::make_unique(rmm::cuda_stream_per_thread); diff --git a/cpp/examples/users/single_gpu_application/sg_graph_algorithms.cpp b/cpp/examples/users/single_gpu_application/sg_graph_algorithms.cpp index 2c56d6449b5..14e6ac2a7f0 100644 --- a/cpp/examples/users/single_gpu_application/sg_graph_algorithms.cpp +++ b/cpp/examples/users/single_gpu_application/sg_graph_algorithms.cpp @@ -16,7 +16,7 @@ std::unique_ptr initialize_sg_handle() { RAFT_CUDA_TRY(cudaSetDevice(0)); auto resource = rmm::mr::cuda_memory_resource(); - rmm::mr::set_current_device_resource_ref(resource); + rmm::mr::set_current_device_resource(resource); std::unique_ptr handle = std::make_unique(); return std::move(handle); diff --git a/cpp/tests/mtmg/multi_node_threaded_test.cpp b/cpp/tests/mtmg/multi_node_threaded_test.cpp index 7a048be2655..f97b1a2f8d3 100644 --- a/cpp/tests/mtmg/multi_node_threaded_test.cpp +++ b/cpp/tests/mtmg/multi_node_threaded_test.cpp @@ -473,7 +473,7 @@ int main(int argc, char** argv) auto const cmd_opts = parse_test_options(argc, argv); auto const rmm_mode = cmd_opts["rmm_mode"].as(); auto resource = cugraph::test::create_memory_resource(rmm_mode); - rmm::mr::set_current_device_resource_ref(resource); + rmm::mr::set_current_device_resource(resource); cugraph::test::g_perf = cmd_opts["perf"].as(); cugraph::test::g_rmat_scale = (cmd_opts.count("rmat_scale") > 0) ? std::make_optional(cmd_opts["rmat_scale"].as()) diff --git a/cpp/tests/utilities/base_fixture.hpp b/cpp/tests/utilities/base_fixture.hpp index 10de4f9e0d0..0766e2f363d 100644 --- a/cpp/tests/utilities/base_fixture.hpp +++ b/cpp/tests/utilities/base_fixture.hpp @@ -200,7 +200,7 @@ inline auto parse_test_options(int argc, char** argv) auto const cmd_opts = parse_test_options(argc, argv); \ auto const rmm_mode = cmd_opts["rmm_mode"].as(); \ auto resource = cugraph::test::create_memory_resource(rmm_mode); \ - rmm::mr::set_current_device_resource_ref(resource); \ + rmm::mr::set_current_device_resource(resource); \ cugraph::test::g_perf = cmd_opts["perf"].as(); \ cugraph::test::g_rmat_scale = \ (cmd_opts.count("rmat_scale") > 0) \ @@ -231,7 +231,7 @@ inline auto parse_test_options(int argc, char** argv) auto const cmd_opts = parse_test_options(argc, argv); \ auto const rmm_mode = cmd_opts["rmm_mode"].as(); \ auto resource = cugraph::test::create_memory_resource(rmm_mode); \ - rmm::mr::set_current_device_resource_ref(resource); \ + rmm::mr::set_current_device_resource(resource); \ cugraph::test::g_perf = cmd_opts["perf"].as(); \ cugraph::test::g_rmat_scale = \ (cmd_opts.count("rmat_scale") > 0) \ From f586a14a2163162e844038131bb2ab022d948b01 Mon Sep 17 00:00:00 2001 From: Charles Hastings Date: Fri, 17 Apr 2026 07:46:32 -0700 Subject: [PATCH 06/15] add cudart to run recipe also --- conda/recipes/libcugraph/recipe.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/conda/recipes/libcugraph/recipe.yaml b/conda/recipes/libcugraph/recipe.yaml index e5764e2805f..aaf388b171d 100644 --- a/conda/recipes/libcugraph/recipe.yaml +++ b/conda/recipes/libcugraph/recipe.yaml @@ -113,6 +113,7 @@ outputs: - cuda-version =${{ cuda_version }} - librmm =${{ minor_version }} - rapids-logger =0.2 + - cuda-cudart-dev - libcublas-dev - libcurand-dev - libcusolver-dev From 5e24d0dab098095d0340451778ca3dd550e6479c Mon Sep 17 00:00:00 2001 From: Charles Hastings Date: Fri, 17 Apr 2026 08:20:01 -0700 Subject: [PATCH 07/15] ignore cudart in exports --- conda/recipes/libcugraph/recipe.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/conda/recipes/libcugraph/recipe.yaml b/conda/recipes/libcugraph/recipe.yaml index aaf388b171d..f6cd4b8771b 100644 --- a/conda/recipes/libcugraph/recipe.yaml +++ b/conda/recipes/libcugraph/recipe.yaml @@ -130,6 +130,7 @@ outputs: - libcusparse ignore_run_exports: by_name: + - cuda-cudart - cuda-nvtx - cuda-version - libcublas From 73564ef8a0e7b6646a4b2b33ce50e7ec9820fc57 Mon Sep 17 00:00:00 2001 From: Charles Hastings Date: Fri, 17 Apr 2026 10:25:32 -0700 Subject: [PATCH 08/15] try tweaking the recipe a bit more --- conda/recipes/libcugraph/recipe.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conda/recipes/libcugraph/recipe.yaml b/conda/recipes/libcugraph/recipe.yaml index f6cd4b8771b..3b416d28b21 100644 --- a/conda/recipes/libcugraph/recipe.yaml +++ b/conda/recipes/libcugraph/recipe.yaml @@ -123,6 +123,7 @@ outputs: - libraft =${{ minor_version }} - librmm =${{ minor_version }} - nccl ${{ nccl_version }} + - cuda-cudart - cuda-profiler-api - libcublas - libcurand @@ -213,6 +214,7 @@ outputs: host: - ${{ pin_subpackage("libcugraph", exact=True) }} - cuda-version =${{ cuda_version }} + - cuda-cudart-dev - nccl ${{ nccl_version }} - openmpi <5.0.3 # Required for building cpp-mgtests (multi-GPU tests) - rapids-logger =0.2 @@ -220,8 +222,10 @@ outputs: - ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }} - ${{ pin_subpackage("libcugraph", exact=True) }} - ${{ pin_subpackage("libcugraph_etl", exact=True) }} + - cuda-cudart ignore_run_exports: by_name: + - cuda-cudart - cuda-nvtx - cuda-version - libcublas From 1085cf2f8e75030635efe050383fce80b0a2909d Mon Sep 17 00:00:00 2001 From: Charles Hastings Date: Fri, 17 Apr 2026 11:02:36 -0700 Subject: [PATCH 09/15] try tweaking the recipe a bit more --- conda/recipes/libcugraph/recipe.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/conda/recipes/libcugraph/recipe.yaml b/conda/recipes/libcugraph/recipe.yaml index 3b416d28b21..6f3b65e15e2 100644 --- a/conda/recipes/libcugraph/recipe.yaml +++ b/conda/recipes/libcugraph/recipe.yaml @@ -171,13 +171,16 @@ outputs: - cuda-version =${{ cuda_version }} - libcudf =${{ minor_version }} - librmm =${{ minor_version }} + - cuda-cudart-dev run: - ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }} - ${{ pin_subpackage("libcugraph", exact=True) }} - libcudf =${{ minor_version }} - librmm =${{ minor_version }} + - cuda-cudart ignore_run_exports: by_name: + - cuda-cudart - cuda-nvtx - cuda-version - libcublas From 9793fdf330be284981e7ceeab537f26c0bda5624 Mon Sep 17 00:00:00 2001 From: Charles Hastings Date: Fri, 17 Apr 2026 12:16:28 -0700 Subject: [PATCH 10/15] try tweaking the recipe a bit more --- conda/recipes/libcugraph/recipe.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/conda/recipes/libcugraph/recipe.yaml b/conda/recipes/libcugraph/recipe.yaml index 6f3b65e15e2..f7dc450334c 100644 --- a/conda/recipes/libcugraph/recipe.yaml +++ b/conda/recipes/libcugraph/recipe.yaml @@ -114,6 +114,7 @@ outputs: - librmm =${{ minor_version }} - rapids-logger =0.2 - cuda-cudart-dev + - cuda-nvrtc-dev - libcublas-dev - libcurand-dev - libcusolver-dev @@ -124,6 +125,7 @@ outputs: - librmm =${{ minor_version }} - nccl ${{ nccl_version }} - cuda-cudart + - cuda-nvrtc - cuda-profiler-api - libcublas - libcurand @@ -132,6 +134,7 @@ outputs: ignore_run_exports: by_name: - cuda-cudart + - cuda-nvrtc - cuda-nvtx - cuda-version - libcublas @@ -172,15 +175,18 @@ outputs: - libcudf =${{ minor_version }} - librmm =${{ minor_version }} - cuda-cudart-dev + - cuda-nvrtc-dev run: - ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }} - ${{ pin_subpackage("libcugraph", exact=True) }} - libcudf =${{ minor_version }} - librmm =${{ minor_version }} - cuda-cudart + - cuda-nvrtc ignore_run_exports: by_name: - cuda-cudart + - cuda-nvrtc - cuda-nvtx - cuda-version - libcublas @@ -218,6 +224,7 @@ outputs: - ${{ pin_subpackage("libcugraph", exact=True) }} - cuda-version =${{ cuda_version }} - cuda-cudart-dev + - cuda-nvrtc-dev - nccl ${{ nccl_version }} - openmpi <5.0.3 # Required for building cpp-mgtests (multi-GPU tests) - rapids-logger =0.2 @@ -226,9 +233,11 @@ outputs: - ${{ pin_subpackage("libcugraph", exact=True) }} - ${{ pin_subpackage("libcugraph_etl", exact=True) }} - cuda-cudart + - cuda-nvrtc ignore_run_exports: by_name: - cuda-cudart + - cuda-nvrtc - cuda-nvtx - cuda-version - libcublas From 04d9ab16a9f659b0b4db0a69eaed46af39d4ced0 Mon Sep 17 00:00:00 2001 From: Charles Hastings Date: Mon, 20 Apr 2026 08:47:42 -0700 Subject: [PATCH 11/15] revert cmake changes to see if the recipe fixes without cmake will work better --- cpp/CMakeLists.txt | 3 --- cpp/tests/CMakeLists.txt | 3 --- 2 files changed, 6 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index d5801bff537..3f58fbe848d 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -471,9 +471,6 @@ SECTIONS } ]=]) -set_property(TARGET cugraph PROPERTY NO_CUDART_DEP ON) -set_property(TARGET cugraph_mg PROPERTY NO_CUDART_DEP ON) - set(cugraph_suffixes "" "_mg") foreach(suffix IN LISTS cugraph_suffixes) set_target_properties(cugraph${suffix} diff --git a/cpp/tests/CMakeLists.txt b/cpp/tests/CMakeLists.txt index 333a212ba0b..6e9ec49f3e7 100644 --- a/cpp/tests/CMakeLists.txt +++ b/cpp/tests/CMakeLists.txt @@ -47,7 +47,6 @@ target_compile_options(cugraphtestutil ) set_property(TARGET cugraphtestutil PROPERTY POSITION_INDEPENDENT_CODE ON) -set_property(TARGET cugraphtestutil PROPERTY NO_CUDART_DEP ON) target_include_directories(cugraphtestutil PUBLIC @@ -84,7 +83,6 @@ target_include_directories(cugraph_c_testutil ) set_property(TARGET cugraph_c_testutil PROPERTY POSITION_INDEPENDENT_CODE ON) -set_property(TARGET cugraph_c_testutil PROPERTY NO_CUDART_DEP ON) target_link_libraries(cugraph_c_testutil PUBLIC @@ -116,7 +114,6 @@ if(BUILD_CUGRAPH_MG_TESTS) ) set_property(TARGET cugraphmgtestutil PROPERTY POSITION_INDEPENDENT_CODE ON) - set_property(TARGET cugraphmgtestutil PROPERTY NO_CUDART_DEP ON) target_compile_options(cugraphmgtestutil PUBLIC "$<$:${CUGRAPH_CXX_FLAGS}>" From c04ffca5ee4a9441c2dfb201845994fafcce3f77 Mon Sep 17 00:00:00 2001 From: Charles Hastings Date: Mon, 20 Apr 2026 11:50:23 -0700 Subject: [PATCH 12/15] Add back the properties, removing them introduced the original error again --- cpp/CMakeLists.txt | 3 +++ cpp/tests/CMakeLists.txt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 3f58fbe848d..d5801bff537 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -471,6 +471,9 @@ SECTIONS } ]=]) +set_property(TARGET cugraph PROPERTY NO_CUDART_DEP ON) +set_property(TARGET cugraph_mg PROPERTY NO_CUDART_DEP ON) + set(cugraph_suffixes "" "_mg") foreach(suffix IN LISTS cugraph_suffixes) set_target_properties(cugraph${suffix} diff --git a/cpp/tests/CMakeLists.txt b/cpp/tests/CMakeLists.txt index 6e9ec49f3e7..333a212ba0b 100644 --- a/cpp/tests/CMakeLists.txt +++ b/cpp/tests/CMakeLists.txt @@ -47,6 +47,7 @@ target_compile_options(cugraphtestutil ) set_property(TARGET cugraphtestutil PROPERTY POSITION_INDEPENDENT_CODE ON) +set_property(TARGET cugraphtestutil PROPERTY NO_CUDART_DEP ON) target_include_directories(cugraphtestutil PUBLIC @@ -83,6 +84,7 @@ target_include_directories(cugraph_c_testutil ) set_property(TARGET cugraph_c_testutil PROPERTY POSITION_INDEPENDENT_CODE ON) +set_property(TARGET cugraph_c_testutil PROPERTY NO_CUDART_DEP ON) target_link_libraries(cugraph_c_testutil PUBLIC @@ -114,6 +116,7 @@ if(BUILD_CUGRAPH_MG_TESTS) ) set_property(TARGET cugraphmgtestutil PROPERTY POSITION_INDEPENDENT_CODE ON) + set_property(TARGET cugraphmgtestutil PROPERTY NO_CUDART_DEP ON) target_compile_options(cugraphmgtestutil PUBLIC "$<$:${CUGRAPH_CXX_FLAGS}>" From 9488ae42e98e33c9387efd8a258f80c2c69985dc Mon Sep 17 00:00:00 2001 From: Charles Hastings Date: Wed, 22 Apr 2026 13:54:51 -0700 Subject: [PATCH 13/15] Missed a spot where we were statically linking cudart. --- cpp/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index d5801bff537..ca9cc6544df 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -60,7 +60,7 @@ message(VERBOSE "CUGRAPH: CUGRAPH_USE_CUVS_STATIC=${CUGRAPH_USE_CUVS_STATIC}") set(CMAKE_CXX_SCAN_FOR_MODULES OFF) # CUDA runtime -rapids_cuda_init_runtime(USE_STATIC ON) +rapids_cuda_init_runtime(USE_STATIC OFF) rapids_find_package(CUDAToolkit REQUIRED BUILD_EXPORT_SET cugraph-exports From d87d36f23065239966093890c778c9fcce84b4e3 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Wed, 22 Apr 2026 22:03:53 -0500 Subject: [PATCH 14/15] Address PR review feedback on RMM CCCL migration - resource_manager.hpp: inline pool upstream, drop explicit any_resource cast, use non-deprecated set_per_device_resource, restore per_device_it from insert, and pass workspace_resource to raft::handle_t. - large_buffer_manager.hpp: std::move pinned_host_memory_resource in constructor and create_memory_buffer_resource. - mg_graph500_{bfs,sssp}_test.cu: prefer std::optional::value() over operator*. - examples: pass workspace_resource to raft::handle_t as the third positional argument. --- .../graph_operations/graph_operations.cu | 2 +- .../vertex_and_edge_partition.cu | 2 +- .../mg_graph_algorithms.cpp | 2 +- .../sg_graph_algorithms.cpp | 3 ++- cpp/include/cugraph/large_buffer_manager.hpp | 4 ++-- cpp/include/cugraph/mtmg/resource_manager.hpp | 22 ++++++++----------- cpp/tests/traversal/mg_graph500_bfs_test.cu | 4 ++-- cpp/tests/traversal/mg_graph500_sssp_test.cu | 2 +- 8 files changed, 19 insertions(+), 22 deletions(-) diff --git a/cpp/examples/developers/graph_operations/graph_operations.cu b/cpp/examples/developers/graph_operations/graph_operations.cu index 72fa0e88966..9ed8d4bcdcf 100644 --- a/cpp/examples/developers/graph_operations/graph_operations.cu +++ b/cpp/examples/developers/graph_operations/graph_operations.cu @@ -44,7 +44,7 @@ std::unique_ptr initialize_mg_handle() rmm::mr::set_current_device_resource(resource); std::unique_ptr handle = - std::make_unique(rmm::cuda_stream_per_thread); + std::make_unique(rmm::cuda_stream_per_thread, nullptr, resource); raft::comms::initialize_mpi_comms(handle.get(), MPI_COMM_WORLD); auto& comm = handle->get_comms(); diff --git a/cpp/examples/developers/vertex_and_edge_partition/vertex_and_edge_partition.cu b/cpp/examples/developers/vertex_and_edge_partition/vertex_and_edge_partition.cu index 66afd41cc9e..5d47daa6e01 100644 --- a/cpp/examples/developers/vertex_and_edge_partition/vertex_and_edge_partition.cu +++ b/cpp/examples/developers/vertex_and_edge_partition/vertex_and_edge_partition.cu @@ -41,7 +41,7 @@ std::unique_ptr initialize_mg_handle() rmm::mr::set_current_device_resource(resource); std::unique_ptr handle = - std::make_unique(rmm::cuda_stream_per_thread); + std::make_unique(rmm::cuda_stream_per_thread, nullptr, resource); raft::comms::initialize_mpi_comms(handle.get(), MPI_COMM_WORLD); auto& comm = handle->get_comms(); diff --git a/cpp/examples/users/multi_gpu_application/mg_graph_algorithms.cpp b/cpp/examples/users/multi_gpu_application/mg_graph_algorithms.cpp index b54189348e8..91bc0749600 100644 --- a/cpp/examples/users/multi_gpu_application/mg_graph_algorithms.cpp +++ b/cpp/examples/users/multi_gpu_application/mg_graph_algorithms.cpp @@ -36,7 +36,7 @@ std::unique_ptr initialize_mg_handle() rmm::mr::set_current_device_resource(resource); std::unique_ptr handle = - std::make_unique(rmm::cuda_stream_per_thread); + std::make_unique(rmm::cuda_stream_per_thread, nullptr, resource); raft::comms::initialize_mpi_comms(handle.get(), MPI_COMM_WORLD); auto& comm = handle->get_comms(); diff --git a/cpp/examples/users/single_gpu_application/sg_graph_algorithms.cpp b/cpp/examples/users/single_gpu_application/sg_graph_algorithms.cpp index 14e6ac2a7f0..77fac221546 100644 --- a/cpp/examples/users/single_gpu_application/sg_graph_algorithms.cpp +++ b/cpp/examples/users/single_gpu_application/sg_graph_algorithms.cpp @@ -18,7 +18,8 @@ std::unique_ptr initialize_sg_handle() auto resource = rmm::mr::cuda_memory_resource(); rmm::mr::set_current_device_resource(resource); - std::unique_ptr handle = std::make_unique(); + std::unique_ptr handle = + std::make_unique(rmm::cuda_stream_per_thread, nullptr, resource); return std::move(handle); } diff --git a/cpp/include/cugraph/large_buffer_manager.hpp b/cpp/include/cugraph/large_buffer_manager.hpp index 3413b699678..5b64f5eeb72 100644 --- a/cpp/include/cugraph/large_buffer_manager.hpp +++ b/cpp/include/cugraph/large_buffer_manager.hpp @@ -23,7 +23,7 @@ namespace detail { class large_memory_buffer_resource_t { public: large_memory_buffer_resource_t() = delete; - large_memory_buffer_resource_t(rmm::mr::pinned_host_memory_resource mr) : mr_(mr) {} + large_memory_buffer_resource_t(rmm::mr::pinned_host_memory_resource mr) : mr_(std::move(mr)) {} rmm::device_async_resource_ref get() { return mr_; } @@ -91,7 +91,7 @@ class large_buffer_manager { static detail::large_memory_buffer_resource_t create_memory_buffer_resource( rmm::mr::pinned_host_memory_resource mr) { - return detail::large_memory_buffer_resource_t(mr); + return detail::large_memory_buffer_resource_t(std::move(mr)); } static detail::large_storage_buffer_resource_t create_storage_buffer_resource() diff --git a/cpp/include/cugraph/mtmg/resource_manager.hpp b/cpp/include/cugraph/mtmg/resource_manager.hpp index 20890c95bfd..035d0dea0e0 100644 --- a/cpp/include/cugraph/mtmg/resource_manager.hpp +++ b/cpp/include/cugraph/mtmg/resource_manager.hpp @@ -95,24 +95,18 @@ class resource_manager_t { // Ultimately there should be some RMM parameters passed into this function // (or the constructor of the object) to configure this behavior #if 0 - per_device_rmm_resources_.insert( - std::pair{global_rank, - cuda::mr::any_resource( - rmm::mr::cuda_memory_resource())}); + auto per_device_it = per_device_rmm_resources_.insert( + std::pair{global_rank, rmm::mr::cuda_memory_resource()}); #else auto const [free, total] = rmm::available_device_memory(); auto const min_alloc = rmm::align_down(std::min(free, total / 6), rmm::CUDA_ALLOCATION_ALIGNMENT); - auto upstream = rmm::mr::cuda_memory_resource(); - per_device_rmm_resources_.insert( - std::pair{global_rank, - cuda::mr::any_resource( - rmm::mr::pool_memory_resource(upstream, min_alloc))}); + auto per_device_it = per_device_rmm_resources_.insert(std::pair{ + global_rank, rmm::mr::pool_memory_resource(rmm::mr::cuda_memory_resource(), min_alloc)}); #endif - rmm::mr::set_per_device_resource_ref(local_device_id, - per_device_rmm_resources_.find(global_rank)->second); + rmm::mr::set_per_device_resource(local_device_id, per_device_it.first->second); } /** @@ -186,8 +180,10 @@ class resource_manager_t { rmm::cuda_set_device_raii local_set_device(pos->second); nccl_comms.push_back(std::make_unique()); - handles.push_back(std::make_unique( - rmm::cuda_stream_per_thread, std::make_shared(n_streams))); + handles.push_back( + std::make_unique(rmm::cuda_stream_per_thread, + std::make_shared(n_streams), + per_device_rmm_resources_.find(rank)->second)); device_ids.push_back(pos->second); RAFT_NCCL_TRY( diff --git a/cpp/tests/traversal/mg_graph500_bfs_test.cu b/cpp/tests/traversal/mg_graph500_bfs_test.cu index a9e5ae7ea54..b6dfa424b95 100644 --- a/cpp/tests/traversal/mg_graph500_bfs_test.cu +++ b/cpp/tests/traversal/mg_graph500_bfs_test.cu @@ -79,9 +79,9 @@ class Tests_GRAPH500_MGBFS cugraph::large_buffer_manager::init( *handle_, - cugraph::large_buffer_manager::create_memory_buffer_resource(*pinned_mr_), + cugraph::large_buffer_manager::create_memory_buffer_resource(pinned_mr_.value()), std::nullopt); - cugraph::host_staging_buffer_manager::init(*handle_, *pinned_mr_); + cugraph::host_staging_buffer_manager::init(*handle_, pinned_mr_.value()); } static void TearDownTestCase() diff --git a/cpp/tests/traversal/mg_graph500_sssp_test.cu b/cpp/tests/traversal/mg_graph500_sssp_test.cu index 57b670c8554..dd32d53b33b 100644 --- a/cpp/tests/traversal/mg_graph500_sssp_test.cu +++ b/cpp/tests/traversal/mg_graph500_sssp_test.cu @@ -80,7 +80,7 @@ class Tests_GRAPH500_MGSSSP cugraph::large_buffer_manager::init( *handle_, - cugraph::large_buffer_manager::create_memory_buffer_resource(*pinned_mr_), + cugraph::large_buffer_manager::create_memory_buffer_resource(pinned_mr_.value()), std::nullopt); } From 401ac45b4f20f29cdcffcf915d6b93439660de3c Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Wed, 22 Apr 2026 23:44:25 -0500 Subject: [PATCH 15/15] Skip CUDA <12.9 test matrix entries libcugraph now requires a CUDA >= 12.8 cudart at runtime (via cuVS's use of cudaLibraryGetKernel), so the 12.2.2 conda/wheel test jobs fail with: undefined symbol: cudaLibraryGetKernel, version libcudart.so.12 Filter the test matrices in pr.yaml and test.yaml to CUDA >= 12.9 until a solution is implemented. Tracked in #5498. --- .github/workflows/pr.yaml | 12 ++++++++++++ .github/workflows/test.yaml | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index d9a008a14b5..578c4ed202d 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -235,6 +235,9 @@ jobs: with: build_type: pull-request script: ci/test_cpp.sh + # TODO(#5498): Drop this filter once libcugraph no longer requires a CUDA >= 12.8 + # cudart at runtime (ideally by statically linking libcudart again). + matrix_filter: map(select(.CUDA_VER | split(".") | map(tonumber) >= [12, 9])) conda-cpp-checks: needs: conda-cpp-build secrets: inherit @@ -259,6 +262,9 @@ jobs: with: build_type: pull-request script: ci/test_python.sh + # TODO(#5498): Drop this filter once libcugraph no longer requires a CUDA >= 12.8 + # cudart at runtime (ideally by statically linking libcudart again). + matrix_filter: map(select(.CUDA_VER | split(".") | map(tonumber) >= [12, 9])) conda-notebook-tests: needs: [conda-python-build, changed-files] secrets: inherit @@ -313,6 +319,9 @@ jobs: with: build_type: pull-request script: ci/test_wheel_pylibcugraph.sh + # TODO(#5498): Drop this filter once libcugraph no longer requires a CUDA >= 12.8 + # cudart at runtime (ideally by statically linking libcudart again). + matrix_filter: map(select(.CUDA_VER | split(".") | map(tonumber) >= [12, 9])) wheel-build-cugraph: needs: wheel-build-pylibcugraph secrets: inherit @@ -333,6 +342,9 @@ jobs: with: build_type: pull-request script: ci/test_wheel_cugraph.sh + # TODO(#5498): Drop this filter once libcugraph no longer requires a CUDA >= 12.8 + # cudart at runtime (ideally by statically linking libcudart again). + matrix_filter: map(select(.CUDA_VER | split(".") | map(tonumber) >= [12, 9])) devcontainer: secrets: inherit needs: telemetry-setup diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e1eb222af4b..d655ae3aa59 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -41,6 +41,9 @@ jobs: date: ${{ inputs.date }} script: ci/test_cpp.sh sha: ${{ inputs.sha }} + # TODO(#5498): Drop this filter once libcugraph no longer requires a CUDA >= 12.8 + # cudart at runtime (ideally by statically linking libcudart again). + matrix_filter: map(select(.CUDA_VER | split(".") | map(tonumber) >= [12, 9])) conda-python-tests: secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@main @@ -50,6 +53,9 @@ jobs: date: ${{ inputs.date }} script: ci/test_python.sh sha: ${{ inputs.sha }} + # TODO(#5498): Drop this filter once libcugraph no longer requires a CUDA >= 12.8 + # cudart at runtime (ideally by statically linking libcudart again). + matrix_filter: map(select(.CUDA_VER | split(".") | map(tonumber) >= [12, 9])) wheel-tests-pylibcugraph: secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@main @@ -59,6 +65,9 @@ jobs: date: ${{ inputs.date }} sha: ${{ inputs.sha }} script: ci/test_wheel_pylibcugraph.sh + # TODO(#5498): Drop this filter once libcugraph no longer requires a CUDA >= 12.8 + # cudart at runtime (ideally by statically linking libcudart again). + matrix_filter: map(select(.CUDA_VER | split(".") | map(tonumber) >= [12, 9])) wheel-tests-cugraph: secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@main @@ -68,3 +77,6 @@ jobs: date: ${{ inputs.date }} sha: ${{ inputs.sha }} script: ci/test_wheel_cugraph.sh + # TODO(#5498): Drop this filter once libcugraph no longer requires a CUDA >= 12.8 + # cudart at runtime (ideally by statically linking libcudart again). + matrix_filter: map(select(.CUDA_VER | split(".") | map(tonumber) >= [12, 9]))