Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
f94918b
Migrate RMM usage to CCCL MR design
bdice Apr 3, 2026
39a3296
Merge remote-tracking branch 'upstream/main' into rmm-cccl-migration
bdice Apr 15, 2026
e8e30a3
Inline upstream memory resource variable in test fixture MR composition
bdice Apr 15, 2026
c0332ec
Some cmake changes to try and resolve latest JIT issue
ChuckHastings Apr 16, 2026
9a3ba99
add host dependency on cuda-nvrtc
ChuckHastings Apr 16, 2026
dd809dd
Replace deprecated set_current_device_resource_ref with set_current_d…
bdice Apr 16, 2026
f586a14
add cudart to run recipe also
ChuckHastings Apr 17, 2026
5e24d0d
ignore cudart in exports
ChuckHastings Apr 17, 2026
73564ef
try tweaking the recipe a bit more
ChuckHastings Apr 17, 2026
1085cf2
try tweaking the recipe a bit more
ChuckHastings Apr 17, 2026
9793fdf
try tweaking the recipe a bit more
ChuckHastings Apr 17, 2026
04d9ab1
revert cmake changes to see if the recipe fixes without cmake will wo…
ChuckHastings Apr 20, 2026
c04ffca
Add back the properties, removing them introduced the original error …
ChuckHastings Apr 20, 2026
9488ae4
Missed a spot where we were statically linking cudart.
ChuckHastings Apr 22, 2026
7c10fb2
Merge branch 'cudart_issue' into rmm-cccl-migration
ChuckHastings Apr 22, 2026
d87d36f
Address PR review feedback on RMM CCCL migration
bdice Apr 23, 2026
ebdabdd
Merge branch 'rmm-cccl-migration' of https://github.com/bdice/cugraph…
bdice Apr 23, 2026
401ac45
Skip CUDA <12.9 test matrix entries
bdice Apr 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions conda/environments/all_cuda-129_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions conda/environments/all_cuda-129_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions conda/environments/all_cuda-131_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions conda/environments/all_cuda-131_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 20 additions & 0 deletions conda/recipes/libcugraph/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -111,6 +113,8 @@ outputs:
- cuda-version =${{ cuda_version }}
- librmm =${{ minor_version }}
- rapids-logger =0.2
- cuda-cudart-dev
- cuda-nvrtc-dev
- libcublas-dev
- libcurand-dev
- libcusolver-dev
Expand All @@ -120,13 +124,17 @@ outputs:
- libraft =${{ minor_version }}
- librmm =${{ minor_version }}
- nccl ${{ nccl_version }}
- cuda-cudart
- cuda-nvrtc
- cuda-profiler-api
- libcublas
- libcurand
- libcusolver
- libcusparse
ignore_run_exports:
by_name:
- cuda-cudart
- cuda-nvrtc
- cuda-nvtx
- cuda-version
- libcublas
Expand Down Expand Up @@ -166,13 +174,19 @@ outputs:
- cuda-version =${{ cuda_version }}
- 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
Expand Down Expand Up @@ -209,15 +223,21 @@ outputs:
host:
- ${{ 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
run:
- ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }}
- ${{ 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
Expand Down
8 changes: 6 additions & 2 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -511,13 +514,14 @@ foreach(suffix IN LISTS cugraph_suffixes)
# - link libraries -------------------------------------------------------------
target_link_libraries(cugraph${suffix}
PUBLIC
rmm::rmm
raft::raft
$<BUILD_LOCAL_INTERFACE:CUDA::toolkit>
PRIVATE
${COMPILED_RAFT_LIB}
$<IF:$<BOOL:${CUGRAPH_USE_CUVS_STATIC}>,cuvs::cuvs_static,cuvs::cuvs> #
cuco::cuco
rmm::rmm
INTERFACE $<COMPILE_ONLY:rmm::rmm>
)

################################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,11 @@ std::unique_ptr<raft::handle_t> initialize_mg_handle()
int comm_rank{};
RAFT_MPI_TRY(MPI_Comm_rank(MPI_COMM_WORLD, &comm_rank));

std::shared_ptr<rmm::mr::device_memory_resource> resource =
std::make_shared<rmm::mr::cuda_memory_resource>();
rmm::mr::set_current_device_resource(resource.get());
auto resource = rmm::mr::cuda_memory_resource();
rmm::mr::set_current_device_resource(resource);

std::unique_ptr<raft::handle_t> handle =
std::make_unique<raft::handle_t>(rmm::cuda_stream_per_thread, resource);
std::make_unique<raft::handle_t>(rmm::cuda_stream_per_thread, nullptr, resource);

raft::comms::initialize_mpi_comms(handle.get(), MPI_COMM_WORLD);
auto& comm = handle->get_comms();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,11 @@ std::unique_ptr<raft::handle_t> initialize_mg_handle()
int comm_rank{};
RAFT_MPI_TRY(MPI_Comm_rank(MPI_COMM_WORLD, &comm_rank));

std::shared_ptr<rmm::mr::device_memory_resource> resource =
std::make_shared<rmm::mr::cuda_memory_resource>();
rmm::mr::set_current_device_resource(resource.get());
auto resource = rmm::mr::cuda_memory_resource();
rmm::mr::set_current_device_resource(resource);

std::unique_ptr<raft::handle_t> handle =
std::make_unique<raft::handle_t>(rmm::cuda_stream_per_thread, resource);
std::make_unique<raft::handle_t>(rmm::cuda_stream_per_thread, nullptr, resource);

raft::comms::initialize_mpi_comms(handle.get(), MPI_COMM_WORLD);
auto& comm = handle->get_comms();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@ std::unique_ptr<raft::handle_t> initialize_mg_handle()
int comm_rank{};
RAFT_MPI_TRY(MPI_Comm_rank(MPI_COMM_WORLD, &comm_rank));

std::shared_ptr<rmm::mr::device_memory_resource> resource =
std::make_shared<rmm::mr::cuda_memory_resource>();
rmm::mr::set_current_device_resource(resource.get());
auto resource = rmm::mr::cuda_memory_resource();
rmm::mr::set_current_device_resource(resource);

std::unique_ptr<raft::handle_t> handle =
std::make_unique<raft::handle_t>(rmm::cuda_stream_per_thread, resource);
std::make_unique<raft::handle_t>(rmm::cuda_stream_per_thread, nullptr, resource);

raft::comms::initialize_mpi_comms(handle.get(), MPI_COMM_WORLD);
auto& comm = handle->get_comms();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
std::unique_ptr<raft::handle_t> initialize_sg_handle()
{
RAFT_CUDA_TRY(cudaSetDevice(0));
std::shared_ptr<rmm::mr::device_memory_resource> resource =
std::make_shared<rmm::mr::cuda_memory_resource>();
rmm::mr::set_current_device_resource(resource.get());
auto resource = rmm::mr::cuda_memory_resource();
rmm::mr::set_current_device_resource(resource);

std::unique_ptr<raft::handle_t> handle =
std::make_unique<raft::handle_t>(rmm::cuda_stream_per_thread, resource);
std::make_unique<raft::handle_t>(rmm::cuda_stream_per_thread, nullptr, resource);
return std::move(handle);
}

Expand Down
2 changes: 1 addition & 1 deletion cpp/include/cugraph/algorithms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ template <typename vertex_t, typename edge_t, typename weight_t>
std::unique_ptr<legacy::GraphCOO<vertex_t, edge_t, weight_t>> minimum_spanning_tree(
raft::handle_t const& handle,
legacy::GraphCSRView<vertex_t, edge_t, weight_t> 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 {
/**
Expand Down
4 changes: 2 additions & 2 deletions cpp/include/cugraph/dendrogram.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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<rmm::device_uvector<vertex_t>>(num_verts, stream_view, mr));
Expand Down
17 changes: 5 additions & 12 deletions cpp/include/cugraph/host_staging_buffer_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@

#include <rmm/cuda_stream_view.hpp>
#include <rmm/device_uvector.hpp>
#include <rmm/mr/owning_wrapper.hpp>
#include <rmm/mr/pinned_host_memory_resource.hpp>
#include <rmm/mr/pool_memory_resource.hpp>

#include <cstddef>
#include <memory>
#include <optional>

namespace cugraph {
Expand All @@ -32,14 +30,12 @@ class host_staging_buffer_manager {
return s.initialized;
}

static void init(raft::handle_t const& handle,
std::shared_ptr<rmm::mr::pinned_host_memory_resource> 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<rmm::mr::pool_memory_resource>(
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()
Expand All @@ -53,16 +49,13 @@ class host_staging_buffer_manager {
static rmm::device_uvector<T> allocate_staging_buffer(size_t size, rmm::cuda_stream_view stream)
{
auto& s = state();
return rmm::device_uvector<T>(size, stream, s.pinned_pool_mr.get());
return rmm::device_uvector<T>(size, stream, *s.pinned_pool_mr);
}

private:
struct state_t {
bool initialized = false;
std::shared_ptr<
rmm::mr::owning_wrapper<rmm::mr::pool_memory_resource<rmm::mr::pinned_host_memory_resource>,
rmm::mr::pinned_host_memory_resource>>
pinned_pool_mr{};
std::optional<rmm::mr::pool_memory_resource> pinned_pool_mr{};
};

static state_t& state()
Expand Down
14 changes: 6 additions & 8 deletions cpp/include/cugraph/large_buffer_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include <rmm/cuda_stream_view.hpp>
#include <rmm/device_uvector.hpp>
#include <rmm/mr/pinned_host_memory_resource.hpp>
#include <rmm/resource_ref.hpp>

#include <memory>
#include <optional>

namespace cugraph {
Expand All @@ -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<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::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>
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.
};

Expand Down Expand Up @@ -91,7 +89,7 @@ class large_buffer_manager {
}

static detail::large_memory_buffer_resource_t create_memory_buffer_resource(
std::shared_ptr<rmm::mr::pinned_host_memory_resource> mr)
rmm::mr::pinned_host_memory_resource mr)
{
return detail::large_memory_buffer_resource_t(std::move(mr));
}
Expand Down
4 changes: 2 additions & 2 deletions cpp/include/cugraph/legacy/functions.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -40,7 +40,7 @@ namespace cugraph {
template <typename VT, typename ET, typename WT>
std::unique_ptr<legacy::GraphCSR<VT, ET, WT>> coo_to_csr(
legacy::GraphCOOView<VT, ET, WT> 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
Expand Down
8 changes: 4 additions & 4 deletions cpp/include/cugraph/legacy/graph.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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),
Expand All @@ -369,7 +369,7 @@ class GraphCOO {

GraphCOO(GraphCOOView<vertex_t, edge_t, weight_t> 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),
Expand Down Expand Up @@ -540,7 +540,7 @@ class GraphCSR : public GraphCompressedSparseBase<vertex_t, edge_t, weight_t> {
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<vertex_t, edge_t, weight_t>(
number_of_vertices_, number_of_edges_, has_data_, stream, mr)
{
Expand Down
Loading
Loading