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_device_files.
list_devicesenumerates 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_device_fileswith your device configuration described by aDeviceConfig.find_device_fileswill return a list ofDeviceFiles if there are matched devices.
use furiosa_device::{find_device_files, DeviceConfig};
// Find two Warboy devices, fused.
let config = DeviceConfig::warboy().fused().count(2);
let dev_files = find_device_files(&config).await?;- In case you have prior knowledge on the system and want to pick out a
device with specific name, use
get_device_file.
let device_file = furiosa_device::get_device_file("npu0pe0").await?;Modules§
- blocking
blocking - A set of synchronous APIs. This requires the optional blocking feature to be enabled.
- hwmon
- perf_
regs - proc
Structs§
- Clock
Frequency - Device
- Abstraction for a single Furiosa NPU device.
- Device
Config - Describes a required set of devices for
find_device_files. - Device
Config Builder - A builder struct for
DeviceConfig. - Device
File - An abstraction for a device file and its mode.
- EnvBuilder
- A struct for building
DeviceConfigfrom an environment variable. - NotDetermined
Enums§
- Arch
- Enum for the NPU architecture.
- Core
Range - Core
Status - Enum for NPU core status.
- Device
Error - An error that occurred during parsing or retrieving devices.
- Device
Mode - Enum for NPU’s operating mode.
- Numa
Node - Non Uniform Memory Access (NUMA) node
Functions§
- find_
device_ files - Find a set of devices with specific configuration.
- get_
device - Return a specific Furiosa NPU device in the system.
- get_
device_ file - Return a specific device if it exists.
- list_
devices - List all Furiosa NPU devices in the system.
Type Aliases§
- Device
Result - Type alias for
Result<T, DeviceError>.