Crates.io | amdgpu-sysfs |
lib.rs | amdgpu-sysfs |
version | 0.17.2 |
source | src |
created_at | 2021-06-17 07:24:52.459676 |
updated_at | 2024-11-09 22:19:38.922496 |
description | Library for interacting with the Linux Kernel SysFS interface for GPUs (mainly targeted at the AMDGPU driver). |
homepage | |
repository | https://github.com/ilya-zlobintsev/amdgpu-sysfs-rs/ |
max_upload_size | |
id | 411242 |
size | 844,776 |
This library allows you to interact with the Linux Kernel SysFS interface for GPUs (mainly targeted at the AMDGPU driver).
Basic usage:
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();
See the documentation for more info.