Interface GraphicsCard
- All Known Implementing Classes:
AbstractGraphicsCard
Represents a graphics card (GPU) installed in the system.
Identity fields (getName(), getDeviceId(), getVendor(), getVersionInfo(),
getVRam()) are static and safe to read at any time.
Live metrics (utilization, temperature, power, clocks, fan speed, VRAM used) are accessed through a GpuStats
session obtained via createStatsSession(). For a single snapshot, use try-with-resources:
try (GpuStats stats = card.createStatsSession()) {
double temp = stats.getTemperature();
double power = stats.getPowerDraw();
}
For repeated polling, hold the session open across iterations to preserve internal delta state. See GpuStats
for a full polling example and details on which metrics require priming.
-
Method Summary
Modifier and TypeMethodDescriptionOpens a newGpuStatssession for sampling dynamic GPU metrics.Retrieves the card's Device IDgetName()Retrieves the full name of the card.Retrieves the card's manufacturer/vendorRetrieves a list of version/revision data from the card.longgetVRam()Retrieves the Video RAM (VRAM) available on the GPU
-
Method Details
-
getName
-
getDeviceId
-
getVendor
String getVendor()Retrieves the card's manufacturer/vendor- Returns:
- The vendor of the card as human-readable text if possible, or the Vendor ID (VID) otherwise
-
getVersionInfo
String getVersionInfo()Retrieves a list of version/revision data from the card. Users may need to further parse this list to identify specific GPU capabilities.- Returns:
- A comma-delimited list of version/revision data
-
getVRam
long getVRam()Retrieves the Video RAM (VRAM) available on the GPU- Returns:
- Total number of bytes.
-
createStatsSession
GpuStats createStatsSession()Opens a newGpuStatssession for sampling dynamic GPU metrics. The caller is responsible for closing the session when done, preferably via try-with-resources.Never returns null and never throws. Platforms that do not support a native session return a no-op instance whose metric methods return sentinel values.
- Returns:
- a new, open
GpuStatssession
-