summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock8
-rw-r--r--Cargo.toml2
-rw-r--r--src/app/data_harvester/memory/general/heim.rs2
-rw-r--r--src/app/data_harvester/nvidia.rs1
4 files changed, 8 insertions, 5 deletions
diff --git a/Cargo.lock b/Cargo.lock
index db07f0c9..78e4a41e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1232,9 +1232,9 @@ dependencies = [
[[package]]
name = "nvml-wrapper"
-version = "0.8.0"
+version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "288bd66a5a56d8c97b178412b328419b3fdec261c0cbc4628ddc49cc16db8fc6"
+checksum = "7cd21b9f5a1cce3c3515c9ffa85f5c7443e07162dae0ccf4339bb7ca38ad3454"
dependencies = [
"bitflags",
"libloading",
@@ -1246,9 +1246,9 @@ dependencies = [
[[package]]
name = "nvml-wrapper-sys"
-version = "0.6.0"
+version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3d606d4edf766969f16828ec047ca9aa96652a17bd353dc0613bfaca49b61d6"
+checksum = "c961a2ea9e91c59a69b78e69090f6f5b867bb46c0c56de9482da232437c4987e"
dependencies = [
"libloading",
]
diff --git a/Cargo.toml b/Cargo.toml
index b8fb599b..3e9bd1e5 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -90,7 +90,7 @@ indexmap = "1.9.2"
itertools = "0.10.5"
kstring = { version = "2.0.0", features = ["arc"] }
log = { version = "0.4.17", optional = true }
-nvml-wrapper = { version = "0.8.0", optional = true }
+nvml-wrapper = { version = "0.9.0", optional = true }
once_cell = "1.5.2"
regex = "1.7.1"
serde = { version = "1.0.152", features = ["derive"] }
diff --git a/src/app/data_harvester/memory/general/heim.rs b/src/app/data_harvester/memory/general/heim.rs
index bb63d2b5..27221420 100644
--- a/src/app/data_harvester/memory/general/heim.rs
+++ b/src/app/data_harvester/memory/general/heim.rs
@@ -257,9 +257,11 @@ pub async fn get_arc_data() -> crate::utils::error::Result<Option<MemHarvest>> {
}))
}
+// FIXME: Can unify this with the sysinfo impl
#[cfg(feature = "nvidia")]
pub async fn get_gpu_data() -> crate::utils::error::Result<Option<Vec<(String, MemHarvest)>>> {
use crate::data_harvester::nvidia::NVML_DATA;
+
if let Ok(nvml) = &*NVML_DATA {
if let Ok(ngpu) = nvml.device_count() {
let mut results = Vec::with_capacity(ngpu as usize);
diff --git a/src/app/data_harvester/nvidia.rs b/src/app/data_harvester/nvidia.rs
index 2cb4b622..9619da64 100644
--- a/src/app/data_harvester/nvidia.rs
+++ b/src/app/data_harvester/nvidia.rs
@@ -1,3 +1,4 @@
use nvml_wrapper::{error::NvmlError, Nvml};
use once_cell::sync::Lazy;
+
pub static NVML_DATA: Lazy<Result<Nvml, NvmlError>> = Lazy::new(Nvml::init);