Crate furiosa_device
source ·Expand description
A set of APIs to list and retrieve information of FuriosaAI’s NPU devices. To learn more about FuriosaAI’s NPU, please visit https://furiosa.ai.
Before you start
This crate requires FuriosaAI’s NPU device and its kernel driver. Currently, FuriosaAI offers NPU devices for only users who register Early Access Program (EAP). Please contact contact@furiosa.ai to learn how to start the EAP. You can also refer to Driver, Firmware, and Runtime Installation to learn the kernel driver installation.
Usage
Add this to your ‘Cargo.toml’:
[dependencies]
furiosa-device = "0.1"
Listing devices from the system
The current implementation mainly offers two APIs, namely
list_devices
and find_devices
.
list_devices
enumerates all Furiosa NPU devices in the system. One can simply call as below:
ⓘ
let devices = furiosa_device::list_devices().await?;
Struct Device
offers methods for further information of each
device.
- If you have a desired configuration, call
find_devices
with your device configuration described by aDeviceConfig
.find_devices
will return a list ofDeviceFile
s if there are matched devices.
ⓘ
use furiosa_device::{DeviceConfig, find_devices};
// Find two Warboy devices, fused.
let config = DeviceConfig::warboy().fused().count(2);
let dev_files = find_devices(&config).await?;
- In case you have prior knowledge on the system and want to pick out a
device with specific name, use
get_device
.
ⓘ
let device = furiosa_device::get_device("npu0pe0").await?;
Modules
blocking
blocking
A set of synchronous APIs. This requires the optional blocking feature to be enabled.
Structs
Abstraction for a single Furiosa NPU device.
A builder struct for
DeviceConfig
.An abstraction for a device file and its mode.
Enums
Enum for the NPU architecture.
Enum for NPU core status.
Describes a required set of devices for
find_devices
.An error that occurred during parsing or retrieving devices.
Enum for NPU’s operating mode.
Functions
Find a set of devices with specific configuration.
Return a specific device if it exists.
List all Furiosa NPU devices in the system.
Type Definitions
Type alias for
Result<T, DeviceError>
.