pub trait NvidiaDriverInfo {
fn numa_node(&self) -> Result<u16>;
fn is_numa_mem_online(&self) -> Result<bool>;
fn numa_mem_size(&self) -> Result<usize>;
fn numa_memory_affinity(&self) -> Result<u16>;
}
Expand description
Extends Rustacuda’s Device with hardware information obtained from the Nvidia device driver
Specifically, NvidiaDriverInfo
maps the GPU device to the NUMA node on
IBM POWER systems with NVLink.
Required methods
Returns the NUMA node associated with this GPU device
Example
use rustacuda::device::Device;
let device = Device::get_device(0)?;
if let Ok(numa_node) = device.numa_node() {
println!("NUMA node: {}", numa_node);
}
else {
println!("GPU isn't a NUMA node");
}
fn is_numa_mem_online(&self) -> Result<bool>
fn is_numa_mem_online(&self) -> Result<bool>
Returns if the GPU memory is online as a NUMA node
Example
use rustacuda::device::Device;
let device = Device::get_device(0)?;
if let Ok(is_numa_mem_online) = device.is_numa_mem_online() {
println!("Is memory online: {}", is_numa_mem_online);
}
else {
println!("GPU isn't a NUMA node");
}
fn numa_mem_size(&self) -> Result<usize>
fn numa_mem_size(&self) -> Result<usize>
Returns the NUMA memory size in bytes as seen by the Linux driver
Example
use rustacuda::device::Device;
let device = Device::get_device(0)?;
if let Ok(numa_mem_size) = device.numa_mem_size() {
println!("Memory size: {}", numa_mem_size);
}
else {
println!("GPU isn't a NUMA node");
}
fn numa_memory_affinity(&self) -> Result<u16>
fn numa_memory_affinity(&self) -> Result<u16>
Returns the NUMA node of the CPU socket associated with the GPU
Example
use rustacuda::device::Device;
let device = Device::get_device(0)?;
if let Ok(numa_memory_affinity) = device.numa_memory_affinity() {
println!("NUMA node: {}", numa_memory_affinity);
}
else {
println!("NUMA memory affinity is unknown");
}