Class LinuxGraphicsCard
java.lang.Object
oshi.hardware.common.AbstractGraphicsCard
oshi.hardware.common.platform.linux.LinuxGraphicsCard
- All Implemented Interfaces:
GraphicsCard
Graphics card info obtained by lshw, with dynamic metrics from sysfs DRM driver files.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classParsed graphics card attributes used to construct concrete subclass instances. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringReturns the driver name.protected StringReturns the sysfs device path.static List<GraphicsCard> Queries graphics cards from lspci/lshw and constructs instances using the provided factory.protected StringReturns the PCI bus ID.Methods inherited from class AbstractGraphicsCard
createStatsSession, getDeviceId, getName, getVendor, getVersionInfo, getVRam, toString
-
Constructor Details
-
LinuxGraphicsCard
protected LinuxGraphicsCard(String name, String deviceId, String vendor, String versionInfo, long vram, String drmDevicePath, String driverName, String pciBusId) Constructor for LinuxGraphicsCard- Parameters:
name- The namedeviceId- The device IDvendor- The vendorversionInfo- The version infovram- The VRAMdrmDevicePath- sysfs device path for this card, or empty string if unavailabledriverName- driver name (e.g. "amdgpu"), or empty string if unknownpciBusId- PCI bus ID for NVML correlation, or empty string if unknown
-
-
Method Details
-
getDrmDevicePath
-
getDriverName
-
getPciBusId
-
getGraphicsCards
public static List<GraphicsCard> getGraphicsCards(Function<LinuxGraphicsCard.Attrs, GraphicsCard> factory) Queries graphics cards from lspci/lshw and constructs instances using the provided factory.- Parameters:
factory- function that creates a concreteGraphicsCardfrom parsed attributes- Returns:
- list of graphics cards
-