GPU stats
Represents a snapshot of GPU utilization, memory usage, temperature, power consumption, clock speeds, and fan speed on native macOS
API source
The information are retrievable using the graphics card createStatsSession() method
The example below requires at least one entry in hardware.graphicCards. Check that the list is not empty before using
first()
val graphicCards = hardware.graphicCards
val graphicsCard: MacOsGraphicsCard = graphicCards.first()
val stats: GpuStats = checkNotNull(graphicsCard.createStatsSession())
The public return type is nullable. The native implementation returns a snapshot or throws an IllegalStateException
when accelerator enumeration fails or no matching accelerator is available
Note
The properties retain their sampled values. Call createStatsSession() again to retrieve updated information.
Missing native statistics return zero, so a zero value does not confirm that a metric was measured
Properties
gpuTicks
The GPU tick counters. The native implementation currently returns zero for both counters because these measurements are unavailable
gpuUtilization
The GPU core utilization as a percentage
vramUsed
The amount of dedicated video memory in use, in bytes, when reported by the accelerator
sharedMemoryUsed
The amount of shared system memory used by the GPU, in bytes, when reported by the accelerator
temperature
The GPU temperature in degrees Celsius
powerDraw
The GPU power consumption in watts
coreClockMhz
The GPU core clock speed in megahertz
memoryClockMhz
The GPU memory clock speed in megahertz
fanSpeedPercent
The GPU fan speed as a percentage of its maximum