43 个版本 (15 个重大更新)
新版本 0.16.1 | 2024 年 8 月 20 日 |
---|---|
0.15.0 | 2024 年 6 月 15 日 |
0.14.0 | 2024 年 1 月 21 日 |
0.12.8 | 2023 年 12 月 30 日 |
0.3.0 | 2021 年 6 月 21 日 |
#144 in Unix APIs
2,995 个月下载量
在 gpu-usage-waybar 中使用
110KB
2.5K SLoC
amdgpu-syfs-rs
此库允许您与 Linux 内核 SysFS 接口进行交互,用于 GPU(主要针对 AMDGPU 驱动程序)。
基本用法
use amdgpu_sysfs::gpu_handle::GpuHandle;
# use std::path::PathBuf;
let sysfs_path = PathBuf::from("/sys/class/drm/card0/device");
let gpu_handle = GpuHandle::new_from_path(sysfs_path).unwrap();
let gpu_usage = gpu_handle.get_busy_percent().unwrap();
let total_vram = gpu_handle.get_total_vram().unwrap();
有关更多信息,请参阅文档。
依赖关系
~185KB