Skip to content

HardwareHelper: Add support for mining class NVIDIA GPUs #1278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

irql-notlessorequal
Copy link

@irql-notlessorequal irql-notlessorequal commented May 24, 2025

NVIDIA released multiple crypto mining GPUs between 2017 and 2021, these are fused down and totally unable to do anything aside from compute aka crypto and surprisingly also AI workloads.

However as these GPUs lack any sort of outputs as the display engine is disabled, these GPUs are classed as "3D Controllers" in the PCI database, rendering them not detected by StabilityMatrix.

Add missing support for them on Linux in the HardwareInfo helper.

NVIDIA released a set of crypto mining GPUs in 2017, these are fused down and totally unable to do anything aside from compute aka crypto and surprisingly also AI workloads. (even if Pascal is awful for low precision and very dated)

However as these GPUs lack any sort of outputs as the display engine is disabled, NVIDIA labelled these GPUs as "3D Controllers" in the PCI database, rendering them not detected by StabilityMatrix.

Add support for them in the HardwareInfo helper.
Copy link

github-actions bot commented May 24, 2025

CLA Assistant Lite bot CLA Assistant bot All Contributors have signed the CLA.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @irql-notlessorequal, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

As gemini-code-assist, I've reviewed this pull request. The main purpose of this PR is to add support for detecting NVIDIA GPUs that were specifically designed for crypto mining. These cards often lack traditional display outputs and are identified by the system as '3D controllers' rather than the standard 'VGA compatible controllers'. The changes implemented here modify the Linux-specific hardware detection logic within the HardwareHelper to correctly identify and include these types of GPUs.

Highlights

  • Linux GPU Detection Expansion: The pull request modifies the lspci command used in the IterGpuInfoLinux method to search for devices classified as both 'VGA compatible controller' and '3D controller', ensuring that mining GPUs are included in the list of detected hardware.
  • Updated Regex Parsing: The regular expression used to parse the output of the lspci command is updated to correctly match lines starting with either 'VGA compatible controller' or '3D controller' and extract the device name from the appropriate capture group.

Changelog

  • StabilityMatrix.Core/Helper/HardwareInfo/HardwareHelper.cs
    • Modified the lspci command in IterGpuInfoLinux (around line 73) to use grep -E 'VGA|3D' to include '3D controller' devices.
    • Updated the regex pattern in IterGpuInfoLinux (around line 90) to match both 'VGA compatible controller' and '3D controller' and adjusted the capture group index (around line 93) to correctly extract the device name.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


GPU detects compute,
'3D controller' now seen,
Mining power found.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The changes in this pull request add support for NVIDIA mining-class GPUs on Linux, which are often identified as "3D Controllers" instead of "VGA compatible controllers" by lspci. The changes are clear, concise, and directly address the issue described. The modifications to the lspci command and the regular expression used for parsing its output are logical and correctly implemented to include these "3D Controllers".

Summary of Findings

  • lspci command update: The lspci command was updated from lspci | grep VGA to lspci | grep -E 'VGA|3D'. This broadens the search to include lines containing either 'VGA' or '3D', which is necessary for detecting the mining GPUs described as '3D Controllers'.
  • Regex update: The regular expression for parsing the GPU name was changed from VGA compatible controller: ([^\n]*) to (VGA compatible controller|3D controller): ([^\n]*). This captures both types of controller descriptions.
  • Regex Group Index: The group index for extracting the GPU name was updated from match.Groups[1] to match.Groups[2]. This is accurate because the new regex introduces an additional capture group for the controller type string itself, shifting the name to the second group.

Merge Readiness

The pull request appears to be in good shape. The changes are specific, correct, and address the stated goal effectively. I don't have the authority to approve PRs, but based on my review, these changes are ready for merging after any standard internal checks and approvals are completed. It would be good to add a unit test to validate the parsing of '3D controller' outputs.

@@ -87,10 +87,10 @@ private static IEnumerable<GpuInfo> IterGpuInfoLinux()
string? name = null;

// Parse output with regex
var match = Regex.Match(gpuOutput, @"VGA compatible controller: ([^\n]*)");
var match = Regex.Match(gpuOutput, @"(VGA compatible controller|3D controller): ([^\n]*)");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The regex now includes both 'VGA compatible controller' and '3D controller'. Since the second group captures the name, ensure this change doesn't inadvertently affect other parts of the application that rely on this regex. Consider adding a unit test to specifically validate the parsing of '3D controller' outputs.

if (match.Success)
{
name = match.Groups[1].Value.Trim();
name = match.Groups[2].Value.Trim();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The group index has been updated from 1 to 2 to accommodate the new regex pattern. This is correct, but it's crucial to ensure that this change doesn't break any existing logic that relies on the captured GPU name. Consider adding a comment explaining why the index was changed.

name = match.Groups[2].Value.Trim(); // Group 2 captures the GPU name after the controller type

@irql-notlessorequal
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

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.

1 participant