#linux-kernel #amd-gpu #interface #driver #sysfs #targeted #sys-fs

amdgpu-sysfs

Library for interacting with the Linux Kernel SysFS interface for GPUs (mainly targeted at the AMDGPU driver)

52 releases (17 breaking)

new 0.18.1 Mar 20, 2025
0.17.6 Mar 15, 2025
0.17.5 Dec 19, 2024
0.17.3 Nov 13, 2024
0.3.0 Jun 21, 2021

#128 in Hardware support

Download history 726/week @ 2024-11-29 649/week @ 2024-12-06 768/week @ 2024-12-13 1094/week @ 2024-12-20 593/week @ 2024-12-27 713/week @ 2025-01-03 2576/week @ 2025-01-10 2102/week @ 2025-01-17 1059/week @ 2025-01-24 876/week @ 2025-01-31 406/week @ 2025-02-07 203/week @ 2025-02-14 410/week @ 2025-02-21 982/week @ 2025-02-28 647/week @ 2025-03-07 1469/week @ 2025-03-14

3,526 downloads per month
Used in gpu-usage-waybar

GPL-3.0 license

125KB
3K SLoC

amdgpu-syfs-rs

Crates.io Docs.rs

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.

Dependencies