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

Structs

Enums

Functions

Type Definitions