deps: bump nvml to 0.9.0 (#1032)

This commit is contained in:
Clement Tsang 2023-02-27 19:37:35 -05:00 committed by GitHub
parent 6fa72290a9
commit 44e52d6229
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 5 deletions

8
Cargo.lock generated
View file

@ -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",
]

View file

@ -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"] }

View file

@ -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);

View file

@ -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);