Skip to content

Commit

Permalink
example
Browse files Browse the repository at this point in the history
  • Loading branch information
Umio-Yasuno committed Dec 29, 2023
1 parent 3c966a9 commit 141a431
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions examples/link-speed.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
use amdgpu_sysfs::gpu_handle::GpuHandle;
use std::path::PathBuf;

fn main() {
let sysfs_path = PathBuf::from("/sys/class/drm/card0/device");
let gpu_handle = GpuHandle::new_from_path(sysfs_path).unwrap();

println!("Cur: {}x{}",
gpu_handle.get_current_link_speed().unwrap(),
gpu_handle.get_current_link_width().unwrap(),
);
println!("Max: {}x{}",
gpu_handle.get_max_link_speed().unwrap(),
gpu_handle.get_max_link_width().unwrap(),
);
}

0 comments on commit 141a431

Please sign in to comment.