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

44 releases (16 breaking)

0.17.0 Sep 6, 2024
0.15.0 Jun 15, 2024
0.14.0 Jan 21, 2024
0.12.8 Dec 30, 2023
0.3.0 Jun 21, 2021

#118 in Hardware support

Download history 1493/week @ 2024-07-18 883/week @ 2024-07-25 666/week @ 2024-08-01 469/week @ 2024-08-08 937/week @ 2024-08-15 432/week @ 2024-08-22 474/week @ 2024-08-29 759/week @ 2024-09-05 561/week @ 2024-09-12 2207/week @ 2024-09-19 1297/week @ 2024-09-26 772/week @ 2024-10-03 693/week @ 2024-10-10 796/week @ 2024-10-17 670/week @ 2024-10-24 643/week @ 2024-10-31

2,888 downloads per month
Used in gpu-usage-waybar

GPL-3.0 license

115KB
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