Class LinuxGraphicsCard

java.lang.Object
oshi.hardware.common.AbstractGraphicsCard
oshi.hardware.common.platform.linux.LinuxGraphicsCard
All Implemented Interfaces:
GraphicsCard

@ThreadSafe public abstract class LinuxGraphicsCard extends AbstractGraphicsCard
Graphics card info obtained by lshw, with dynamic metrics from sysfs DRM driver files.
  • 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 name
      deviceId - The device ID
      vendor - The vendor
      versionInfo - The version info
      vram - The VRAM
      drmDevicePath - sysfs device path for this card, or empty string if unavailable
      driverName - driver name (e.g. "amdgpu"), or empty string if unknown
      pciBusId - PCI bus ID for NVML correlation, or empty string if unknown
  • Method Details

    • getDrmDevicePath

      protected String getDrmDevicePath()
      Returns the sysfs device path.
      Returns:
      sysfs device path
    • getDriverName

      protected String getDriverName()
      Returns the driver name.
      Returns:
      driver name
    • getPciBusId

      protected String getPciBusId()
      Returns the PCI bus ID.
      Returns:
      PCI bus ID
    • 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 concrete GraphicsCard from parsed attributes
      Returns:
      list of graphics cards