#sysfs #amd-gpu #gpu #driver #path-buf #amdgpu-syfs-rs #gpu-handle

amdgpu-sysfs

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

53 releases

new 0.18.2 May 24, 2025
0.18.1 Mar 20, 2025
0.17.6 Mar 15, 2025
0.17.5 Dec 19, 2024
0.3.0 Jun 21, 2021

#148 in Hardware support

Download history 404/week @ 2025-02-04 280/week @ 2025-02-11 176/week @ 2025-02-18 873/week @ 2025-02-25 681/week @ 2025-03-04 1535/week @ 2025-03-11 906/week @ 2025-03-18 1120/week @ 2025-03-25 1195/week @ 2025-04-01 847/week @ 2025-04-08 435/week @ 2025-04-15 765/week @ 2025-04-22 451/week @ 2025-04-29 809/week @ 2025-05-06 705/week @ 2025-05-13 689/week @ 2025-05-20

2,696 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