Skip to main content

Module device

Module device 

Source
Expand description

CUDA device enumeration and attribute queries.

This module provides the Device type, which wraps a CUdevice handle obtained from the CUDA driver. Devices are identified by ordinal (0, 1, 2, …) and expose a rich set of convenience methods for querying hardware capabilities such as compute capability, memory size, multiprocessor count, and various limits.

§Examples

use oxicuda_driver::device::{Device, list_devices};

oxicuda_driver::init()?;
for dev in list_devices()? {
    println!("{}: compute {}.{}",
        dev.name()?,
        dev.compute_capability()?.0,
        dev.compute_capability()?.1,
    );
}

Structs§

Device
Represents a CUDA-capable GPU device.
DeviceInfo
Comprehensive device information gathered in a single call.

Functions§

best_device
Find the device with the most total memory.
can_access_peer
Query whether peer access is possible between two devices.
driver_version
Query the CUDA driver version.
list_devices
List all available CUDA devices.