Skip to content

Commit

Permalink
v0.1.5: make nvidia gpu optional
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisheib committed Apr 13, 2023
1 parent 3f02c06 commit 20cbd6f
Show file tree
Hide file tree
Showing 2 changed files with 289 additions and 278 deletions.
10 changes: 8 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ fn main() -> Result<(), eframe::Error> {
let thread_update_available = update_available.clone();
thread::spawn(move || check_update_thread(thread_update_available));

let nvid_info = if let Ok(n) = Nvml::init() {
Some(n)
} else {
None
};

let mut appstate = MyApp {
system_status: System::new_all(),
ping_buffer,
Expand All @@ -94,9 +100,9 @@ fn main() -> Result<(), eframe::Error> {
cpu_maxtemp_buffer: CircleVec::new(),
cpu_power_buffer: CircleVec::new(),
ram_buffer: CircleVec::new(),
nvid_info: Nvml::init().unwrap(),
ohw_info,
rt,
nvid_info,
gpu: None,
timing: CircleVec::new(),
current_frame_start: Instant::now(),
Expand Down Expand Up @@ -268,7 +274,7 @@ pub struct MyApp {
pub windows_performance_query_handle: isize,
pub disk_time_value_handle_map: Vec<(String, isize, f64)>,
pub core_time_value_handle_map: Vec<(usize, isize, f64)>,
pub nvid_info: Nvml,
pub nvid_info: Option<Nvml>,
pub ohw_info: Arc<Mutex<Option<OHWNode>>>,
pub rt: Runtime,
pub gpu: Option<GpuData>,
Expand Down
Loading

0 comments on commit 20cbd6f

Please sign in to comment.