#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

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

#113 in Hardware support

Download history 418/week @ 2024-08-23 471/week @ 2024-08-30 784/week @ 2024-09-06 532/week @ 2024-09-13 2400/week @ 2024-09-20 1167/week @ 2024-09-27 752/week @ 2024-10-04 734/week @ 2024-10-11 729/week @ 2024-10-18 667/week @ 2024-10-25 965/week @ 2024-11-01 1878/week @ 2024-11-08 3020/week @ 2024-11-15 1015/week @ 2024-11-22 726/week @ 2024-11-29 522/week @ 2024-12-06

5,992 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