| Crates.io | hw_dcmi_wrapper |
| lib.rs | hw_dcmi_wrapper |
| version | 0.0.6 |
| created_at | 2025-02-06 09:00:05.447149+00 |
| updated_at | 2025-08-16 20:48:26.350259+00 |
| description | A safe and ergonomic Rust wrapper for the Huawei DCMI API. |
| homepage | |
| repository | https://github.com/ZhuLegend/hw_dcmi_wrapper |
| max_upload_size | |
| id | 1545249 |
| size | 110,342 |
The HW_DCMI_WRAPPER project provides a set of third-party FFI (Foreign Function Interface) bindings for interacting with Huawei DCMI. This repository contains two main packages:
Important: This library only supports Linux platforms.
The Huawei DCMI API is only available on Linux systems. Attempting to compile this crate on other platforms will result in a build error.
By default, the library searches for DCMI components in the /usr/local/dcmi directory.
You can override this path by setting the HW_DCMI_PATH environment variable.
If you want to regenerate bindings, you can set HW_DCMI_BINDING_BUILD to true and
enable feature bindgen to regenerate bindings, the generated bindings will be saved in:
hw_dcmi_wrapper_sys/src/bindings.rshw_dcmi_wrapper_sys/src/bindings_dyn.rsDcmi::initCard: Query_cards returned a Vec<Card>.Card::new_uncheckto create a Card instance.Please refer to the document for details( https://docs.rs/hw_dcmi_wrapper )
use hw_dcmi_wrapper::dcmi;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let dcmi = DCMI::init().unwrap();
let dcmi_version = dcmi.get_dcmi_version().unwrap();
println!("DCMI version: {}", dcmi_version);
let cards = Card::query_cards(&dcmi).unwrap();
println!("Card list: {:?}", cards);
}
This project follows the semantic version Standardization
The version number format for this project is <major>< minor>.<patch>, The rule for increasing version numbers is as
follows:
When the project is in version '0.0.z', any change in version number may result in incompatible API changes.
When the project is in version '0.y.z', only increasing 'y' will result in incompatible API changes.
Currently `Hw_dcmi_wrapper is under development, please refer to the API mapping table below for details.
Due to the instability of the DCMI API, this project will always be in version 0. y. z to adapt to possible changes in the DCMI API.
| hw_dcmi_wrapper | DCMI API |
|---|---|
dcmi_init |
DCMI::new |
dcmi_get_dcmi_version |
DCMI::get_dcmi_version |
dcmi_get_driver_version |
DCMI::get_driver_version |
dcmi_get_card_list |
Card::query_cards |
dcmi_get_device_num_in_card |
Card::get_chip_num |
dcmi_get_device_id_in_card |
Card::get_chips |
dcmi_get_device_type |
Chip::get_type |
dcmi_get_device_chip_info |
Chip::get_info |
dcmi_get_device_pcie_info |
Chip::get_pcie_info |
dcmi_get_device_pcie_info_v2 |
Chip::get_domain_pcie_info |
dcmi_get_device_board_info |
Chip::get_board_info |
dcmi_get_device_elabel_info |
Chip::get_elabel_info |
dcmi_get_device_power_info |
Chip::get_power_info |
dcmi_get_device_die_v2 |
Chip::get_die_info |
dcmi_get_device_health |
Chip::get_health |
dcmi_get_driver_health |
DCMI::get_driver_health |
dcmi_get_device_errorcode_v2 |
Chip::get_error_code |
dcmi_get_driver_errorcode |
DCMI::get_driver_error_code |
dcmi_get_device_errorcode_string |
Chip::get_error_code_string |
dcmi_get_device_flash_count |
Chip::get_flash_count |
dcmi_get_device_flash_info_v2 |
Chip::get_flash_info |
dcmi_get_device_aicore_info |
Chip::get_ai_core_info |
dcmi_get_device_aicpu_info |
Chip::get_ai_cpu_info |
dcmi_get_device_system_time |
Chip::get_system_time |
dcmi_get_device_temperature |
Chip::get_temperature |
dcmi_get_device_voltage |
Chip::get_voltage |
dcmi_get_device_pcie_error_cnt |
Chip::get_pcie_error_cnt |
dcmi_get_device_ecc_info |
Chip::get_ecc_info |
dcmi_get_device_frequency |
Chip::get_frequency |
dcmi_get_device_hbm_info |
Chip::get_hbm_info |
dcmi_get_device_memory_info_v3 |
Chip::get_memory_info |
dcmi_get_device_utilization_rate |
Chip::get_utilization_rate |
dcmi_get_device_sensor_info |
Chip::get_sensor_info |
dcmi_set_container_service_enable |
DCMI::set_container_service_enable |
dcmi_get_device_board_id |
Chip::get_board_id |
dcmi_get_device_component_count |
Chip::get_component_count |
dcmi_get_device_component_list |
Chip::get_component_list |
dcmi_get_device_component_static_version |
Chip::get_component_static_version |
dcmi_get_device_cgroup_info |
Chip::get_cgroup_info |
dcmi_get_device_llc_perf_para |
Chip::get_llc_perf |
| hw_dcmi_wrapper | DCMI API |
|---|---|
dcmi_set_vdevice_mode |
VChip::set_compute_power_splitting_mode |
dcmi_get_vdevice_mode |
VChip::get_compute_power_splitting_mode |
dcmi_create_vdevice |
VChip::create |
dcmi_set_vnpu_config_recover_mode |
VChip::set_recovery_mode |
dcmi_get_vnpu_config_recover_mode |
VChip::get_recovery_mode |
dcmi_set_destroy_vdevice |
VChip::destroy 与 VChip::destory_all |
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.