Repository navigation
Fix Linux graphics cards all reporting the same VRAM - #3555
Conversation
📝 WalkthroughWalkthroughLinux graphics-card discovery now uses extended ChangesLinux graphics parsing
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant lspci
participant LinuxGraphicsCard
participant findDrmInfo
lspci->>LinuxGraphicsCard: provide extended machine-readable records
LinuxGraphicsCard->>LinuxGraphicsCard: classify display controller and capture PCI slot
LinuxGraphicsCard->>findDrmInfo: request DRM data for PCI slot
findDrmInfo-->>LinuxGraphicsCard: return matching or empty metadata
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3555 +/- ##
============================================
- Coverage 79.34% 79.33% -0.01%
+ Complexity 4019 4018 -1
============================================
Files 706 706
Lines 24256 24264 +8
Branches 4053 4057 +4
============================================
+ Hits 19245 19251 +6
- Misses 2822 2824 +2
Partials 2189 2189
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@oshi-common/src/main/java/oshi/hardware/common/platform/linux/LinuxGraphicsCard.java`:
- Line 202: Update the parser-input Javadoc associated with
getGraphicsCardsFromLspci to document lspci -vnnmm instead of lspci -vnnm,
matching the command passed by ExecutingCommand.runNative.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 15cd9f9b-c4cd-4fbf-861d-45313d971d18
📒 Files selected for processing (3)
CHANGELOG.mdoshi-common/src/main/java/oshi/hardware/common/platform/linux/LinuxGraphicsCard.javaoshi-common/src/test/java/oshi/hardware/common/platform/linux/LinuxGraphicsCardTest.java
📜 Review details
⏰ Context from checks skipped due to timeout. (7)
- GitHub Check: Test JDK 25, macos-latest (+ JNA==FFM)
- GitHub Check: Test JDK 25, windows-latest (+ JNA==FFM)
- GitHub Check: Test JDK 26, ubuntu-latest
- GitHub Check: Test JDK 25, ubuntu-latest (+ JNA==FFM)
- GitHub Check: Lint (Spotless, Checkstyle, ForbiddenAPIs, Javadoc)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Analyze (java)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2026-04-12T19:22:09.716Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3149
File: oshi-common/src/main/java/oshi/hardware/common/platform/mac/MacCentralProcessor.java:159-163
Timestamp: 2026-04-12T19:22:09.716Z
Learning: When reviewing OSHI hardware platform code that uses or implements `CentralProcessor`/`PhysicalProcessor.getEfficiency()`, remember the API’s counterintuitive semantics: a *higher* efficiency-class value indicates *greater performance* (lower efficiency). P-cores/“performance cores” should therefore have higher values (e.g., 1) than E-cores/“efficiency cores” (e.g., 0), as documented in the `CentralProcessor` Javadoc. Do not flag code as incorrect solely because ARM_P_CORES or Intel P-cores are assigned higher efficiency values.
Applied to files:
oshi-common/src/main/java/oshi/hardware/common/platform/linux/LinuxGraphicsCard.java
📚 Learning: 2026-07-06T19:25:59.225Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3432
File: oshi-common/src/main/java/oshi/util/ExceptionUtil.java:26-56
Timestamp: 2026-07-06T19:25:59.225Z
Learning: In this repo’s SLF4J 1.x-compatible logging code, do not flag cases where a logger call uses SLF4J 1.6+ implicit-cause handling—e.g., `log.error("...{}", value, t)` (or similar with a single `{}` placeholder) where `t` is passed as the final/trailing argument. SLF4J will attach `t` as the log event’s cause with the full stack trace; this is equivalent to SLF4J 2.x’s fluent `atLevel(...).setCause(t).log(...)` and is intentionally used to preserve SLF4J 1.x runtime compatibility.
Applied to files:
oshi-common/src/main/java/oshi/hardware/common/platform/linux/LinuxGraphicsCard.java
📚 Learning: 2026-07-30T00:35:22.638Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3547
File: oshi-common/src/main/java/oshi/hardware/common/platform/unix/BsdFirmware.java:82-82
Timestamp: 2026-07-30T00:35:22.638Z
Learning: In OSHI, treat changes as “API-breaking” only when they affect classes (or relevant API surface) annotated with `PublicAPI`. Public classes/members that are not annotated with `PublicAPI` should be reviewed as internal implementation details, even if they are public (e.g., classes like `oshi.hardware.common.platform.unix.BsdFirmware`). Also, respect intentional visibility decisions used for tests—e.g., methods like `BsdFirmware.parseDmesg(List<String>)` may be intentionally package-private to support tests within the same package; avoid widening visibility or altering signatures unless the related `PublicAPI` contract requires it.
Applied to files:
oshi-common/src/main/java/oshi/hardware/common/platform/linux/LinuxGraphicsCard.java
🔇 Additional comments (3)
oshi-common/src/main/java/oshi/hardware/common/platform/linux/LinuxGraphicsCard.java (1)
224-239: LGTM!Also applies to: 270-273, 370-387
oshi-common/src/test/java/oshi/hardware/common/platform/linux/LinuxGraphicsCardTest.java (1)
15-15: LGTM!Also applies to: 247-316
CHANGELOG.md (1)
11-11: LGTM!
There was a problem hiding this comment.
Pull request overview
Updates the Linux graphics-card discovery path to correctly correlate each GPU with its own PCI slot, ensuring per-card VRAM, DRM device, driver, and metrics are reported accurately on multi-GPU systems.
Changes:
- Switch
lspciinvocation to the stable machine-readable format that includes theSlot:field. - Preserve and propagate the per-record PCI slot through VRAM and DRM lookups, avoiding cross-GPU mixing.
- Tighten GPU detection by identifying display controllers via PCI base class
0x03instead of substring-matching"VGA".
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| oshi-common/src/main/java/oshi/hardware/common/platform/linux/LinuxGraphicsCard.java | Fixes slot parsing/propagation, updates lspci flags, and adds PCI-class-based display detection. |
| oshi-common/src/test/java/oshi/hardware/common/platform/linux/LinuxGraphicsCardTest.java | Adds regression tests covering slot correlation, non-display filtering, and display-class detection. |
| CHANGELOG.md | Adds an entry describing the Linux multi-GPU VRAM/metrics fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dbwiddis
left a comment
There was a problem hiding this comment.
Thanks for finding this bug and the detailed PR! A few suggestions inline.
In addition, this also surfaces a latent bug in findDrmInfo (LinuxGraphicsCard.java:435-436). (I can't comment there because it's out-of-diff.)
It was already broken; with the slot fix it's now broken differently. Happy to have this as a follow-up PR if you want to keep this one scoped, but should be a quick fix.
Before your fix, pciSlot was always null on the lspci path, so only the first card was reachable; that's the "all cards report the same DRM device, driver and metrics" symptom in your description.
Now that slots are correct, the matching return at line 432 is the common case.
But the final fallback if the slot doesn't match (line 436) may return some other result giving the same "same info for every card" result.
That's reachable for a GPU bound to vfio-pci for VM passthrough (class 0300 in lspci, no /sys/class/drm/cardN), or any display device with no driver bound.
Suggest gating the fallback on having had nothing to match on:
if (pciSlot != null) {
// We had a slot to match on and no DRM card claimed it, so this card has no DRM node (e.g. a GPU bound to
// vfio-pci). Returning another card's path would attribute that card's driver and metrics to this one.
return new Triplet<>("", "", "");
}
// No slot to match on: fall back to the first card with a driver symlink
return firstWithDriver != null ? firstWithDriver : new Triplet<>("", "", "");An empty triplet is well-handled downstream: LinuxGpuStats checks drmDevicePath.isEmpty() and resolveHwmonPath returns "", so every metric reports -1 (unavailable) rather than a different card's reading, and findNvmlDevice still falls back to nvmlFindDeviceByName when pciBusId is empty. It also matches the cards == null early return just above.
This does mean testFindDrmInfoFallsBackToFirstDriver needs splitting: it passes "99:00.0" against a tree holding only 0000:01:00.0 and asserts amdgpu, which is asserting the old behavior. testFindDrmInfoNullPciSlotFallback already covers row 1 and can stay as-is.
| List<String> mixed = Arrays.asList("Slot:\t00:11.0", "Class:\tSignal processing controller [1180]", | ||
| "Vendor:\tIntel Corporation [8086]", "Device:\tIntegrated Sensor Hub [a135]", "Rev:\t31", "", | ||
| "Slot:\t01:00.0", "Class:\tVGA compatible controller [0300]", "Vendor:\tNVIDIA Corporation [10de]", | ||
| "Device:\tGP107GL [Quadro P400] [1cb3]", "Rev:\ta1", ""); | ||
|
|
||
| List<String> drmSlots = new ArrayList<>(); | ||
| List<GraphicsCard> cards = LinuxGraphicsCard.getGraphicsCardsFromLspci(mixed, STUB_FACTORY, NO_VRAM, slot -> { | ||
| drmSlots.add(slot); | ||
| return new Triplet<>("", "", ""); | ||
| }); | ||
|
|
||
| assertThat(cards.size(), is(1)); | ||
| assertThat(cards.get(0).getDeviceId(), is("0x1cb3")); | ||
| assertThat(drmSlots, is(Collections.singletonList("01:00.0"))); | ||
| } |
There was a problem hiding this comment.
This and testGetGraphicsCardsFromLspciIgnoresNonVgaUnclassifiedDevice (line 305) differ only in the non-display record's class — 1180 vs 0000 — and in whether they assert on the DRM slots list. The 0000 case is already covered directly by testIsDisplayClass.
Suggest one fixture carrying both non-display records, which also asserts neither reaches the DRM lookup. If you take this, delete testGetGraphicsCardsFromLspciIgnoresNonVgaUnclassifiedDevice (lines 303-316, including its preceding @Test).
| List<String> mixed = Arrays.asList("Slot:\t00:11.0", "Class:\tSignal processing controller [1180]", | |
| "Vendor:\tIntel Corporation [8086]", "Device:\tIntegrated Sensor Hub [a135]", "Rev:\t31", "", | |
| "Slot:\t01:00.0", "Class:\tVGA compatible controller [0300]", "Vendor:\tNVIDIA Corporation [10de]", | |
| "Device:\tGP107GL [Quadro P400] [1cb3]", "Rev:\ta1", ""); | |
| List<String> drmSlots = new ArrayList<>(); | |
| List<GraphicsCard> cards = LinuxGraphicsCard.getGraphicsCardsFromLspci(mixed, STUB_FACTORY, NO_VRAM, slot -> { | |
| drmSlots.add(slot); | |
| return new Triplet<>("", "", ""); | |
| }); | |
| assertThat(cards.size(), is(1)); | |
| assertThat(cards.get(0).getDeviceId(), is("0x1cb3")); | |
| assertThat(drmSlots, is(Collections.singletonList("01:00.0"))); | |
| } | |
| // PCI class 0x0000 renders as "Non-VGA unclassified device", which contains "VGA"; 0x1180 is a signal | |
| // processing controller. Neither is a graphics card and neither may reach the DRM lookup. | |
| List<String> mixed = Arrays.asList("Slot:\t00:13.0", "Class:\tNon-VGA unclassified device [0000]", | |
| "Vendor:\tIntel Corporation [8086]", | |
| "Device:\t100 Series/C230 Series Chipset Family Integrated Sensor Hub [a135]", "Rev:\t31", "", | |
| "Slot:\t00:11.0", "Class:\tSignal processing controller [1180]", "Vendor:\tIntel Corporation [8086]", | |
| "Device:\tIntegrated Sensor Hub [a135]", "Rev:\t31", "", "Slot:\t01:00.0", | |
| "Class:\tVGA compatible controller [0300]", "Vendor:\tNVIDIA Corporation [10de]", | |
| "Device:\tGP107GL [Quadro P400] [1cb3]", "Rev:\ta1", ""); | |
| List<String> drmSlots = new ArrayList<>(); | |
| List<GraphicsCard> cards = LinuxGraphicsCard.getGraphicsCardsFromLspci(mixed, STUB_FACTORY, NO_VRAM, slot -> { | |
| drmSlots.add(slot); | |
| return new Triplet<>("", "", ""); | |
| }); | |
| assertThat(cards.size(), is(1)); | |
| assertThat(cards.get(0).getDeviceId(), is("0x1cb3")); | |
| assertThat(drmSlots, is(Collections.singletonList("01:00.0"))); | |
| } | |
| assertThat(LinuxGraphicsCard.isDisplayClass("VGA compatible controller [0300]"), is(true)); | ||
| assertThat(LinuxGraphicsCard.isDisplayClass("3D controller [0302]"), is(true)); | ||
| assertThat(LinuxGraphicsCard.isDisplayClass("Display controller [0380]"), is(true)); | ||
| // Contains "VGA" but is PCI class 0x0000, not a graphics card | ||
| assertThat(LinuxGraphicsCard.isDisplayClass("Non-VGA unclassified device [0000]"), is(false)); | ||
| assertThat(LinuxGraphicsCard.isDisplayClass("Signal processing controller [1180]"), is(false)); | ||
| assertThat(LinuxGraphicsCard.isDisplayClass("Host bridge [0600]"), is(false)); | ||
| // Without numeric class codes, fall back to the class name | ||
| assertThat(LinuxGraphicsCard.isDisplayClass("VGA compatible controller"), is(true)); | ||
| assertThat(LinuxGraphicsCard.isDisplayClass("Non-VGA unclassified device"), is(false)); |
There was a problem hiding this comment.
Codecov flags 4 partials on this PR; two are the untested branches of pair != null && pair.getB().length() >= 2 at LinuxGraphicsCard.java:382. A few more cases close them, and 0301 documents the newly-included XGA subclass:
| assertThat(LinuxGraphicsCard.isDisplayClass("VGA compatible controller [0300]"), is(true)); | |
| assertThat(LinuxGraphicsCard.isDisplayClass("3D controller [0302]"), is(true)); | |
| assertThat(LinuxGraphicsCard.isDisplayClass("Display controller [0380]"), is(true)); | |
| // Contains "VGA" but is PCI class 0x0000, not a graphics card | |
| assertThat(LinuxGraphicsCard.isDisplayClass("Non-VGA unclassified device [0000]"), is(false)); | |
| assertThat(LinuxGraphicsCard.isDisplayClass("Signal processing controller [1180]"), is(false)); | |
| assertThat(LinuxGraphicsCard.isDisplayClass("Host bridge [0600]"), is(false)); | |
| // Without numeric class codes, fall back to the class name | |
| assertThat(LinuxGraphicsCard.isDisplayClass("VGA compatible controller"), is(true)); | |
| assertThat(LinuxGraphicsCard.isDisplayClass("Non-VGA unclassified device"), is(false)); | |
| assertThat(LinuxGraphicsCard.isDisplayClass("VGA compatible controller [0300]"), is(true)); | |
| assertThat(LinuxGraphicsCard.isDisplayClass("XGA compatible controller [0301]"), is(true)); | |
| assertThat(LinuxGraphicsCard.isDisplayClass("3D controller [0302]"), is(true)); | |
| assertThat(LinuxGraphicsCard.isDisplayClass("Display controller [0380]"), is(true)); | |
| // Contains "VGA" but is PCI class 0x0000, not a graphics card | |
| assertThat(LinuxGraphicsCard.isDisplayClass("Non-VGA unclassified device [0000]"), is(false)); | |
| assertThat(LinuxGraphicsCard.isDisplayClass("Signal processing controller [1180]"), is(false)); | |
| assertThat(LinuxGraphicsCard.isDisplayClass("Host bridge [0600]"), is(false)); | |
| // Without numeric class codes, fall back to the class name | |
| assertThat(LinuxGraphicsCard.isDisplayClass("VGA compatible controller"), is(true)); | |
| assertThat(LinuxGraphicsCard.isDisplayClass("3D controller"), is(true)); | |
| assertThat(LinuxGraphicsCard.isDisplayClass("Non-VGA unclassified device"), is(false)); | |
| // A bracket group too short to hold a base class falls through to the name check | |
| assertThat(LinuxGraphicsCard.isDisplayClass("Bogus controller [3]"), is(false)); |
| if (split.length < 2) { | ||
| // Record boundary; the next record must supply its own Slot line | ||
| slot = null; | ||
| } |
There was a problem hiding this comment.
See comment on the test: given the first line of the new record is guaranteed to be Slot this doesn't actually change behavior. Harmless but useless.
Co-authored-by: Daniel Widdis <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (1)
oshi-common/src/main/java/oshi/hardware/common/platform/linux/LinuxGraphicsCard.java:202
- The Javadoc still says the input is from
lspci -vnnm, but this method is now fedlspci -vnnmmoutput. This mismatch can confuse future changes/debugging (and theSlot:field behavior differs between formats).
return getGraphicsCardsFromLspci(ExecutingCommand.runNative("lspci -vnnmm"), factory,
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@oshi-common/src/main/java/oshi/hardware/common/platform/linux/LinuxGraphicsCard.java`:
- Around line 431-436: Update the findDrmInfo Javadoc to reflect that an
unmatched non-null pciSlot returns empty DRM metadata rather than falling back
to the first card; document the first-card fallback only for the pciSlot == null
case.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 66952c2a-dcdc-49d8-a34a-1584e16c6a57
📒 Files selected for processing (2)
oshi-common/src/main/java/oshi/hardware/common/platform/linux/LinuxGraphicsCard.javaoshi-common/src/test/java/oshi/hardware/common/platform/linux/LinuxGraphicsCardTest.java
📜 Review details
⏰ Context from checks skipped due to timeout. (8)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Test JDK 25, ubuntu-latest (+ JNA==FFM)
- GitHub Check: Analyze (java)
- GitHub Check: Test JDK 26, ubuntu-latest
- GitHub Check: Test JDK 21, ubuntu-latest
- GitHub Check: Test JDK 25, windows-latest (+ JNA==FFM)
- GitHub Check: Test JDK 25, macos-latest (+ JNA==FFM)
- GitHub Check: Lint (Spotless, Checkstyle, ForbiddenAPIs, Javadoc)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2026-04-12T19:22:09.716Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3149
File: oshi-common/src/main/java/oshi/hardware/common/platform/mac/MacCentralProcessor.java:159-163
Timestamp: 2026-04-12T19:22:09.716Z
Learning: When reviewing OSHI hardware platform code that uses or implements `CentralProcessor`/`PhysicalProcessor.getEfficiency()`, remember the API’s counterintuitive semantics: a *higher* efficiency-class value indicates *greater performance* (lower efficiency). P-cores/“performance cores” should therefore have higher values (e.g., 1) than E-cores/“efficiency cores” (e.g., 0), as documented in the `CentralProcessor` Javadoc. Do not flag code as incorrect solely because ARM_P_CORES or Intel P-cores are assigned higher efficiency values.
Applied to files:
oshi-common/src/main/java/oshi/hardware/common/platform/linux/LinuxGraphicsCard.java
📚 Learning: 2026-07-06T19:25:59.225Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3432
File: oshi-common/src/main/java/oshi/util/ExceptionUtil.java:26-56
Timestamp: 2026-07-06T19:25:59.225Z
Learning: In this repo’s SLF4J 1.x-compatible logging code, do not flag cases where a logger call uses SLF4J 1.6+ implicit-cause handling—e.g., `log.error("...{}", value, t)` (or similar with a single `{}` placeholder) where `t` is passed as the final/trailing argument. SLF4J will attach `t` as the log event’s cause with the full stack trace; this is equivalent to SLF4J 2.x’s fluent `atLevel(...).setCause(t).log(...)` and is intentionally used to preserve SLF4J 1.x runtime compatibility.
Applied to files:
oshi-common/src/main/java/oshi/hardware/common/platform/linux/LinuxGraphicsCard.java
📚 Learning: 2026-07-30T00:35:22.638Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3547
File: oshi-common/src/main/java/oshi/hardware/common/platform/unix/BsdFirmware.java:82-82
Timestamp: 2026-07-30T00:35:22.638Z
Learning: In OSHI, treat changes as “API-breaking” only when they affect classes (or relevant API surface) annotated with `PublicAPI`. Public classes/members that are not annotated with `PublicAPI` should be reviewed as internal implementation details, even if they are public (e.g., classes like `oshi.hardware.common.platform.unix.BsdFirmware`). Also, respect intentional visibility decisions used for tests—e.g., methods like `BsdFirmware.parseDmesg(List<String>)` may be intentionally package-private to support tests within the same package; avoid widening visibility or altering signatures unless the related `PublicAPI` contract requires it.
Applied to files:
oshi-common/src/main/java/oshi/hardware/common/platform/linux/LinuxGraphicsCard.java
🔇 Additional comments (2)
oshi-common/src/main/java/oshi/hardware/common/platform/linux/LinuxGraphicsCard.java (1)
202-280: LGTM!Also applies to: 366-383
oshi-common/src/test/java/oshi/hardware/common/platform/linux/LinuxGraphicsCardTest.java (1)
36-44: LGTM!Also applies to: 58-58, 72-72, 107-116, 180-180, 195-225, 228-344, 353-355, 364-364, 377-377, 388-388, 402-410, 435-435
On a Linux host with more than one graphics card, every card reports the same VRAM, DRM device path, driver and GPU metrics, and getVRam() is always 0. There are bugs inside
LinuxGraphicsCard#getGraphicsCardsFromLspcithat are causing this behavior:1. The wrong lspci output format is requested
getGraphicsCardsFromLspcirunslspci -vnnm. The -vm selects lspci's obsolete machine-readable format, which is discouraged from being used by the documentation. While the code was most certainly written against output of the new format -vmm. The old format labels the slot: field Device: to stay backwards compatible. Meaning "Device:" will appear twice in the output. However the code looks for ":Slot"Sample output:
Bad -vm
Good -vmm
2. The slot is discarded even when present.
"Slot:" precedes "Class:" within a record, and the "Class:" branch resets
lookupDevice = null,wiping the value parsed one line earlier.lookupDeviceremains null, which skips the VRAM lookup later down in the method.3. The class filter substring-matches VGA
However on my server, I have a device with the value "Class: Non-VGA unclassified device [0000]". And this gets added to the mix. That's why I introduced the isDisplayClass method, which first sees if the PCI device base class is 0x03. There is a "The PCI Code and ID Assignment Specification" document that specifies these.
I verified my changes by including a local build of OSHI into my project and ran it on my server.
GraphQL output before
{ "data": { "system": { "gpus": [ { "id": "0xa135", "name": "100 Series/C230 Series Chipset Family Integrated Sensor Hub", "vendor": "Intel Corporation (0x8086)", "versionInfo": "Rev:\t31", "vRamBytes": "0", "metrics": { "id": "0xa135", "name": "100 Series/C230 Series Chipset Family Integrated Sensor Hub", "coreLoad": 0, "vramUsedBytes": "60817408", "vramTotalBytes": "0", "temperature": 45, "fanPercent": 37, "powerDraw": -1, "coreClockMhz": "139", "memoryClockMhz": "405" } }, { "id": "0x1cb3", "name": "GP107GL [Quadro P400]", "vendor": "NVIDIA Corporation (0x10de)", "versionInfo": "Rev:\ta1", "vRamBytes": "0", "metrics": { "id": "0x1cb3", "name": "GP107GL [Quadro P400]", "coreLoad": 0, "vramUsedBytes": "60817408", "vramTotalBytes": "0", "temperature": 45, "fanPercent": 37, "powerDraw": -1, "coreClockMhz": "139", "memoryClockMhz": "405" } }, { "id": "0x2000", "name": "ASPEED Graphics Family", "vendor": "ASPEED Technology, Inc. (0x1a03)", "versionInfo": "Rev:\t30", "vRamBytes": "0", "metrics": { "id": "0x2000", "name": "ASPEED Graphics Family", "coreLoad": 0, "vramUsedBytes": "60817408", "vramTotalBytes": "0", "temperature": 45, "fanPercent": 37, "powerDraw": -1, "coreClockMhz": "139", "memoryClockMhz": "405" } } ] } } }GraphQL output after
{ "data": { "system": { "gpus": [ { "id": "0x1cb3", "name": "GP107GL [Quadro P400]", "vendor": "NVIDIA Corporation (0x10de)", "versionInfo": "Rev:\ta1", "vRamBytes": "301989888", "metrics": { "id": "0x1cb3", "name": "GP107GL [Quadro P400]", "coreLoad": 0, "vramUsedBytes": "60817408", "vramTotalBytes": "301989888", "temperature": 43, "fanPercent": 34, "powerDraw": -1, "coreClockMhz": "139", "memoryClockMhz": "405" } }, { "id": "0x2000", "name": "ASPEED Graphics Family", "vendor": "ASPEED Technology, Inc. (0x1a03)", "versionInfo": "Rev:\t30", "vRamBytes": "0", "metrics": { "id": "0x2000", "name": "ASPEED Graphics Family", "coreLoad": 0, "vramUsedBytes": "-1", "vramTotalBytes": "0", "temperature": -1, "fanPercent": -1, "powerDraw": -1, "coreClockMhz": "-1", "memoryClockMhz": "-1" } } ] } } }I can also add that the WindowsGraphicsCard seem to behave correctly.
Summary by CodeRabbit
Bug Fixes