Unverified Commit 0da960f1 authored by Ziqi Fan's avatar Ziqi Fan Committed by GitHub
Browse files

fix: pass in device_id to KVBM PinnedAllocator instead of hard code to 0 (#6809)


Signed-off-by: default avatarZiqi Fan <ziqif@nvidia.com>
parent e4601811
...@@ -148,7 +148,8 @@ async fn perform_allocation_and_build_handler( ...@@ -148,7 +148,8 @@ async fn perform_allocation_and_build_handler(
)?); )?);
// host // host
let host_blocks = if leader_meta.num_host_blocks > 0 { let host_blocks = if leader_meta.num_host_blocks > 0 {
let host_allocator = Arc::new(PinnedAllocator::default()); let host_allocator = Arc::new(PinnedAllocator::new(device_id)?);
let host_layout = layout_builder let host_layout = layout_builder
.num_blocks(leader_meta.num_host_blocks) .num_blocks(leader_meta.num_host_blocks)
.build()? .build()?
......
...@@ -332,10 +332,13 @@ impl Default for PinnedAllocator { ...@@ -332,10 +332,13 @@ impl Default for PinnedAllocator {
} }
impl PinnedAllocator { impl PinnedAllocator {
/// Create a new pinned allocator /// Create a new pinned allocator for the specified device.
pub fn new() -> Result<Self, StorageError> { ///
/// The device_id determines which NUMA node pinned memory will be allocated
/// on when NUMA-aware allocation is enabled.
pub fn new(device_id: usize) -> Result<Self, StorageError> {
Ok(Self { Ok(Self {
ctx: Cuda::device_or_create(0)?, ctx: Cuda::device_or_create(device_id)?,
}) })
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment