From cdf3ad5e0f30d32c065e79aa265cf8b8eb289291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Walski?= Date: Fri, 22 Mar 2024 16:28:20 +0100 Subject: [PATCH] Skipped optional gpu-info memory.bandwidth_gib property. --- .vscode/launch.json | 27 +++++++++++++++++++++++---- gpu-info/src/lib.rs | 5 +++-- gpu-info/src/model.rs | 3 ++- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 6ff8aac..4024cb3 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,13 +1,10 @@ { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "type": "lldb", "request": "launch", - "name": "offer-template", + "name": "offer-template dummy", "cargo": { "args": [ "build", @@ -26,6 +23,28 @@ ], "cwd": "${workspaceFolder}" }, + { + "type": "lldb", + "request": "launch", + "name": "offer-template automatic", + "cargo": { + "args": [ + "build", + "--bin=ya-runtime-ai", + "--package=ya-runtime-ai" + ], + "filter": { + "name": "ya-runtime-ai", + "kind": "bin" + } + }, + "args": [ + "--runtime", + "automatic", + "offer-template" + ], + "cwd": "${workspaceFolder}" + }, { "type": "lldb", "request": "launch", diff --git a/gpu-info/src/lib.rs b/gpu-info/src/lib.rs index 75c9e7b..da67a6a 100644 --- a/gpu-info/src/lib.rs +++ b/gpu-info/src/lib.rs @@ -98,13 +98,14 @@ fn clocks(dev: &Device) -> anyhow::Result { fn memory(dev: &Device) -> anyhow::Result { let total_bytes = dev.memory_info()?.total; let total_gib = bytes_to_gib(total_bytes); - let bandwidth_gib = bandwidth_gib(dev)?; Ok(Memory { - bandwidth_gib, + bandwidth_gib: None, total_gib, }) } +/// Unused because of lack of `memTransferRatemax` property. +#[allow(dead_code)] fn bandwidth_gib(dev: &Device) -> anyhow::Result { let memory_bus_width = dev.memory_bus_width()?; let supported_memory_clocks = dev.supported_memory_clocks()?; diff --git a/gpu-info/src/model.rs b/gpu-info/src/model.rs index 6713e76..0456291 100644 --- a/gpu-info/src/model.rs +++ b/gpu-info/src/model.rs @@ -34,8 +34,9 @@ pub struct Clocks { #[derive(Clone, Debug, Serialize)] #[serde(rename_all = "kebab-case")] pub struct Memory { + #[serde(skip_serializing_if = "Option::is_none")] #[serde(rename(serialize = "bandwidth.gib"))] - pub bandwidth_gib: u32, + pub bandwidth_gib: Option, #[serde(rename(serialize = "total.gib"))] pub total_gib: f32, }