Crates.io | libdrm_amdgpu_sys |
lib.rs | libdrm_amdgpu_sys |
version | 0.7.3 |
source | src |
created_at | 2022-05-28 23:20:42.36693 |
updated_at | 2024-05-29 04:20:32.139278 |
description | libdrm_amdgpu bindings for Rust, and some methods ported from Mesa3D. |
homepage | |
repository | https://github.com/Umio-Yasuno/libdrm-amdgpu-sys-rs |
max_upload_size | |
id | 596084 |
size | 7,918,588 |
libdrm_amdgpu bindings for Rust, and some methods ported from Mesa3D (mainly ac_gpu_info.c).
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
sudo apt install libdrm-dev
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();
cargo run --example amdgpu_info
cargo run --example vbios_dump
cargo run --example gpu_metrics
To generate a new bindings/drm.rs
.
cargo build --features=buildtime_bindgen