Skip to content

Update view mode to display AI library versions using unified lib_name/lib_version fields #68

Description

@inureyes

Overview

Currently, the view (TUI) mode displays driver and CUDA version information for NVIDIA GPUs. With the implementation of issue #66 which added unified `lib_name` and `lib_version` fields, we should update the view mode to:

  1. Use the new unified fields instead of platform-specific lookups
  2. Extend this display to all platforms (AMD, Apple Silicon, Jetson) for consistency

Current State

The view mode currently shows driver/library information for NVIDIA GPUs only, using platform-specific detail HashMap lookups like:

  • "Driver Version"
  • "CUDA Version"

Other platforms (AMD, Apple Silicon, Jetson) don't consistently display their AI library versions in the view mode.

Proposed Solution

Update the view mode rendering to use the newly added unified fields from issue #66:

  • `lib_name`: "CUDA", "ROCm", "Metal", etc.
  • `lib_version`: The version string
  • `driver_version`: Platform driver version (already exists for NVIDIA/AMD)

This will provide consistent display across all platforms:

  • NVIDIA: Driver 580.82.07, CUDA 13.0
  • AMD: Driver 30.10.1, ROCm 7.0.2
  • Jetson: Driver X.X.X, CUDA Y.Y
  • Apple Silicon: Metal X.X.X (no separate driver version)

Implementation Tasks

1. Find Current Display Logic

File: `src/main.rs` (or relevant UI module)

  • Locate where NVIDIA driver/CUDA version is currently displayed
  • Identify the rendering function and data flow
  • Document current implementation approach

2. Update to Use Unified Fields

File: `src/main.rs` (TUI rendering code)

  • Replace platform-specific lookups with unified field access:
    ```rust
    // Old approach (NVIDIA-specific):
    detail.get("Driver Version")
    detail.get("CUDA Version")

    // New approach (unified):
    detail.get("Driver Version") // Still platform-specific, kept
    detail.get("lib_name") // New unified field
    detail.get("lib_version") // New unified version
    ```

  • Create helper function to format library info:
    ```rust
    fn format_library_info(detail: &HashMap<String, String>) -> String {
    let driver = detail.get("Driver Version").map(|s| s.as_str()).unwrap_or("N/A");
    let lib_name = detail.get("lib_name").map(|s| s.as_str()).unwrap_or("N/A");
    let lib_version = detail.get("lib_version").map(|s| s.as_str()).unwrap_or("N/A");

    if lib_name != "N/A" && lib_version != "N/A" {
        format!("Driver: {}, {}: {}", driver, lib_name, lib_version)
    } else {
        format!("Driver: {}", driver)
    }
    

    }
    ```

3. Extend to All Platforms

  • Ensure AMD GPUs show "Driver: 30.10.1, ROCm: 7.0.2"
  • Ensure NVIDIA GPUs show "Driver: 580.82.07, CUDA: 13.0"
  • Ensure Jetson shows "Driver: X.X.X, CUDA: Y.Y"
  • Ensure Apple Silicon shows "Metal: X.X.X" (no driver version)

4. UI Layout Considerations

  • Ensure text fits in available space
  • Handle cases where lib_name/lib_version might be missing (legacy data)
  • Maintain consistent formatting across platforms
  • Consider abbreviations if space is limited (e.g., "Drv:", "Lib:")

5. Testing

  • Test with NVIDIA GPU (mock and real if available)
  • Test with AMD GPU (mock)
  • Test with Jetson (mock)
  • Test with Apple Silicon (mock and real if available)
  • Verify legacy data without lib_name/lib_version still displays
  • Test in remote view mode with multiple platforms

Expected Output Examples

Local View Mode

```
┌─ GPU 0: NVIDIA H100 80GB ─────────────────────────┐
│ Driver: 580.82.07, CUDA: 13.0 │
│ Util: 45.2% Mem: 32.1/80.0 GB Temp: 56°C │
└───────────────────────────────────────────────────┘

┌─ GPU 0: AMD Instinct MI300X ──────────────────────┐
│ Driver: 30.10.1, ROCm: 7.0.2 │
│ Util: 67.8% Mem: 128.5/192.0 GB Temp: 72°C │
└───────────────────────────────────────────────────┘
```

Remote View Mode (All Tab)

```
Host: gpu-node-01 | Driver: 580.82.07, CUDA: 13.0
GPU 0: NVIDIA H100 | 45.2% | 32.1/80.0 GB
GPU 1: NVIDIA H100 | 52.8% | 41.2/80.0 GB

Host: gpu-node-02 | Driver: 30.10.1, ROCm: 7.0.2
GPU 0: AMD MI300X | 67.8% | 128.5/192.0 GB
GPU 1: AMD MI300X | 71.2% | 145.3/192.0 GB
```

Dependencies

Acceptance Criteria

  • View mode displays AI library name and version for all platforms
  • Uses unified lib_name and lib_version fields
  • Maintains backward compatibility with legacy data
  • Consistent formatting across NVIDIA, AMD, Jetson, and Apple Silicon
  • Works in both local and remote view modes
  • All platforms tested (at minimum with mock servers)
  • Documentation updated if needed

Related Issues

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions