#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)

47 releases

new 0.17.3 Nov 13, 2024
0.17.0 Sep 6, 2024
0.15.0 Jun 15, 2024
0.14.0 Jan 21, 2024
0.3.0 Jun 21, 2021

#119 in Hardware support

Download history 1075/week @ 2024-07-24 654/week @ 2024-07-31 489/week @ 2024-08-07 869/week @ 2024-08-14 503/week @ 2024-08-21 465/week @ 2024-08-28 770/week @ 2024-09-04 563/week @ 2024-09-11 1970/week @ 2024-09-18 1456/week @ 2024-09-25 824/week @ 2024-10-02 614/week @ 2024-10-09 861/week @ 2024-10-16 709/week @ 2024-10-23 628/week @ 2024-10-30 1344/week @ 2024-11-06

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

GPL-3.0 license

120KB
2.5K 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