#amd-gpu #libdrm #linux-kernel

sys no-std libdrm_amdgpu_sys

libdrm_amdgpu bindings for Rust, and some methods ported from Mesa3D

16 releases (6 breaking)

0.7.1 Apr 11, 2024
0.7.0 Mar 29, 2024
0.6.0 Mar 13, 2024
0.4.0 Dec 13, 2023
0.1.0 May 28, 2022

#208 in Graphics APIs

Download history 346/week @ 2024-01-03 328/week @ 2024-01-10 1328/week @ 2024-01-17 684/week @ 2024-01-24 485/week @ 2024-01-31 409/week @ 2024-02-07 339/week @ 2024-02-14 613/week @ 2024-02-21 2009/week @ 2024-02-28 888/week @ 2024-03-06 856/week @ 2024-03-13 570/week @ 2024-03-20 551/week @ 2024-03-27 510/week @ 2024-04-03 519/week @ 2024-04-10 783/week @ 2024-04-17

2,412 downloads per month
Used in 5 crates (via libamdgpu_top)

MIT license

7MB
218K SLoC

libdrm-amdgpu-sys-rs

libdrm_amdgpu bindings for Rust, and some methods ported from Mesa3D (mainly ac_gpu_info.c).

Reference

License

  • MIT License

Documentation

Examples

let (amdgpu_dev, drm_major, drm_minor) = {
    use std::fs::OpenOptions;
    use std::os::fd::IntoRawFd;

    let fd = OpenOptions::new().read(true).write(true).open("/dev/dri/renderD128").unwrap();

    AMDGPU::DeviceHandle::init(fd.into_raw_fd()).unwrap()
};
let mark_name = amdgpu_dev.get_marketing_name().unwrap();
let device_info = amdgpu_dev.device_info().unwrap();

amdgpu_info

cargo run --example amdgpu_info

vbios_dump

cargo run --example vbios_dump

gpu_metrics

cargo run --example gpu_metrics

Build

To generate a new bindings/drm.rs .

cargo build --features=buildtime_bindgen

Dependencies