Skip to content

Commit

Permalink
Skipped optional gpu-info memory.bandwidth_gib property.
Browse files Browse the repository at this point in the history
  • Loading branch information
pwalski committed Mar 22, 2024
1 parent eaf2d1d commit cdf3ad5
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
27 changes: 23 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions gpu-info/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,14 @@ fn clocks(dev: &Device) -> anyhow::Result<Clocks> {
fn memory(dev: &Device) -> anyhow::Result<Memory> {
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<u32> {
let memory_bus_width = dev.memory_bus_width()?;
let supported_memory_clocks = dev.supported_memory_clocks()?;
Expand Down
3 changes: 2 additions & 1 deletion gpu-info/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u32>,
#[serde(rename(serialize = "total.gib"))]
pub total_gib: f32,
}

0 comments on commit cdf3ad5

Please sign in to comment.