Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 27, 2025

Current GPU reporting only shows manufacturer, model, and PCI ID. Extended to detect all GPUs using lspci and enrich with detailed information from lshw, including logical names, bus info, clock speeds, capabilities, configuration, and resource allocations.

Changes

  • Two-step GPU detection:
    • Primary detection: LspciGPUScriptName runs lspci -nv | grep -iE 'vga|3d|display' to identify all GPUs (VGA controllers, 3D controllers, display controllers)
    • Detail enrichment: LshwGPUScriptName runs lshw -class display -numeric to retrieve detailed GPU information
    • Merging strategy: GPUs are matched by bus address and details are merged; GPUs found only in lspci show PCI ID and bus address with empty detail fields
  • Extended GPU struct: Added 8 fields (LogicalName, BusInfo, Version, Width, Clock, Capabilities, Configuration, Resources)
  • Refactored parsing: Rewrote gpuInfoFromOutput() to parse lspci output first for complete GPU list, then merge lshw details by matching bus addresses
  • Updated table: GPU table now displays all 11 fields with names matching lshw output (Vendor, Product, etc.)
  • Removed unused code: Deleted gpu_defs.go which is no longer needed
  • Field names: Use lshw field names exactly (e.g., "Vendor" instead of "Manufacturer", "Product" instead of "Model")

Key Benefits

  • Complete GPU detection: Finds all GPUs using lspci, not just display GPUs
  • Rich details when available: Enriches with lshw information when present
  • Graceful degradation: Shows basic info (PCI ID, bus address) for GPUs not in lshw
  • Flexible: Works with various GPU types (VGA, 3D controllers, display controllers)

Example Output

lspci detects GPU:

00:08.0 0300: 1414:5353 (prog-if 00 [VGA controller])

lshw provides details:

*-display
   product: Hyper-V virtual VGA [1414:5353]
   vendor: Microsoft Corporation [1414]
   bus info: pci@0000:00:08.0
   width: 32 bits
   clock: 33MHz
   configuration: driver=hyperv_drm latency=0
   resources: irq:11 memory:f8000000-fbffffff

Extracts to table with PCI ID 1414:5353, vendor Microsoft Corporation, bus info pci@0000:00:08.0, and all additional fields. GPUs found only in lspci will show PCI ID and bus address with other fields empty.

Original prompt

This section details on the original issue you should resolve

<issue_title>include more GPU details in configuration report</issue_title>
<issue_description>Current GPU details are sparce - manufacturer, model, and PCI ID.

Additional details like logical name, configuration, clock, version, etc. are useful in some cases.

</issue_description>

<agent_instructions>Information required can be retrieved with 'lshw -class display'. Show the fields from lshw in the PerfSpect GPU table. The current approach used by PerfSpect can be removed if not used. </agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits October 27, 2025 19:23
- Added new LshwGPUScriptName script for lshw -class display
- Updated GPU struct with additional fields: LogicalName, BusInfo, Version, Width, Clock, Capabilities, Configuration, Resources
- Modified gpuInfoFromOutput to parse detailed lshw output
- Updated gpuTableValues to display all new GPU fields
- Changed GPU table to use new lshw gpu script instead of generic lshw

Co-authored-by: harp-intel <78619061+harp-intel@users.noreply.github.com>
- Changed lshw script to use -numeric flag to get vendor/device IDs
- Updated parsing logic to extract PCI ID from product field (e.g., [1414:5353])
- Fixed vendor name extraction to remove brackets with vendor ID
- PCI ID now correctly stored in vendor:device format (e.g., 1414:5353)

Co-authored-by: harp-intel <78619061+harp-intel@users.noreply.github.com>
- Added extractPCIIDFromBrackets helper function
- Added removeBracketedSuffix helper function
- Simplified product and vendor parsing logic
- Improved code readability and maintainability

Co-authored-by: harp-intel <78619061+harp-intel@users.noreply.github.com>
- Search for closing bracket after opening bracket
- Correctly calculate slice indices to avoid errors
- Handle edge cases like backwards brackets and multiple brackets

Co-authored-by: harp-intel <78619061+harp-intel@users.noreply.github.com>
@harp-intel
Copy link
Contributor

@copilot remove gpu_defs.go if it is no longer in use.

@harp-intel
Copy link
Contributor

@copilot use field names from lshw, e.g., instead of "Manufacturer", use "Vendor" and instead of "Model" use "Product".

Copilot AI changed the title [WIP] Add more GPU details to configuration report Add comprehensive GPU details from lshw to configuration report Oct 27, 2025
Copilot AI requested a review from harp-intel October 27, 2025 19:37
Copilot finished work on behalf of harp-intel October 27, 2025 19:37
- Removed gpu_defs.go as it's no longer used
- Renamed GPU struct fields: Manufacturer -> Vendor, Model -> Product
- Updated table field names to match lshw output exactly
- Updated parsing logic to use new field names

Co-authored-by: harp-intel <78619061+harp-intel@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 27, 2025

@copilot remove gpu_defs.go if it is no longer in use.

Removed gpu_defs.go in commit c38b635. The file was no longer used after switching to lshw-based GPU detection.

@copilot use field names from lshw, e.g., instead of "Manufacturer", use "Vendor" and instead of "Model" use "Product".

Updated field names to match lshw exactly in commit c38b635. Changed "Manufacturer" to "Vendor" and "Model" to "Product" throughout the GPU struct, table fields, and parsing logic.

Copilot finished work on behalf of harp-intel October 27, 2025 19:43
@harp-intel
Copy link
Contributor

@copilot Not all GPUs will be found using lshw -class display. Identify GPUs using lspci then fill in the details using lshw. If no details found, then leave the fields empty.

lspci | grep -iE 'vga|3d|display'

The goal is to find all GPUs, not only the GPUs used for display.

- Added LspciGPUScriptName to identify all GPUs (VGA/3D/display)
- Modified gpuInfoFromOutput to parse lspci first for complete GPU list
- Merge lshw details when available by matching bus address
- GPUs not in lshw still appear with PCI ID and Bus Info
- Ensures all GPUs are found, not just display GPUs

Co-authored-by: harp-intel <78619061+harp-intel@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 27, 2025

@copilot Not all GPUs will be found using lshw -class display. Identify GPUs using lspci then fill in the details using lshw. If no details found, then leave the fields empty.

lspci | grep -iE 'vg...

Implemented two-step GPU detection in commit a2e3fd5:

  1. lspci (lspci -nv | grep -iE 'vga|3d|display') identifies all GPUs - VGA, 3D controllers, and display controllers
  2. lshw provides detailed information when available
  3. GPUs are matched by bus address, and details merged
  4. GPUs not found in lshw still appear with PCI ID and bus address (other fields empty)

This ensures all GPUs are found, not just those used for display.

Copilot AI changed the title Add comprehensive GPU details from lshw to configuration report Add comprehensive GPU details using lspci and lshw to configuration report Oct 27, 2025
Copilot finished work on behalf of harp-intel October 27, 2025 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

include more GPU details in configuration report

2 participants