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

amdgpu-sysfs

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

40 releases

0.14.0 Jan 21, 2024
0.12.10 Jan 12, 2024
0.12.8 Dec 30, 2023
0.12.4 Nov 21, 2023
0.3.0 Jun 21, 2021

#189 in Unix APIs

Download history 574/week @ 2023-12-18 374/week @ 2023-12-25 281/week @ 2024-01-01 346/week @ 2024-01-08 623/week @ 2024-01-15 1114/week @ 2024-01-22 411/week @ 2024-01-29 450/week @ 2024-02-05 301/week @ 2024-02-12 649/week @ 2024-02-19 1301/week @ 2024-02-26 1334/week @ 2024-03-04 715/week @ 2024-03-11 575/week @ 2024-03-18 369/week @ 2024-03-25 570/week @ 2024-04-01

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

GPL-3.0 license

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

~185KB