Skip to main content

Crate furiosa_device

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_device_files.

  1. 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.

  1. If you have a desired configuration, call find_device_files with your device configuration described by a DeviceConfig. find_device_files will return a list of DeviceFiles 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?;
  1. 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§

blockingblocking
A set of synchronous APIs. This requires the optional blocking feature to be enabled.
hwmon
perf_regs
proc

Structs§

ClockFrequency
Device
Abstraction for a single Furiosa NPU device.
DeviceConfig
Describes a required set of devices for find_device_files.
DeviceConfigBuilder
A builder struct for DeviceConfig.
DeviceFile
An abstraction for a device file and its mode.
EnvBuilder
A struct for building DeviceConfig from an environment variable.
NotDetermined

Enums§

Arch
Enum for the NPU architecture.
CoreRange
CoreStatus
Enum for NPU core status.
DeviceError
An error that occurred during parsing or retrieving devices.
DeviceMode
Enum for NPU’s operating mode.
NumaNode
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§

DeviceResult
Type alias for Result<T, DeviceError>.