Class NvmlUtilFFM
java.lang.Object
oshi.util.gpu.NvmlUtilFFM
FFM-based optional runtime binding to the NVIDIA Management Library (NVML). All methods return sentinel values
(
-1 or -1L) when NVML is unavailable or a specific query fails.-
Method Summary
Modifier and TypeMethodDescriptionstatic StringfindDevice(String pciBusId) Finds the stable PCI bus ID string for the NVML device whose bus ID contains the given fragment.static StringfindDeviceByName(String gpuName) Finds the stable PCI bus ID string for the NVML device whose name matches the given GPU name.static longgetCoreClockMhz(String deviceId) Returns GPU core clock speed in MHz, or -1 if unavailable.static doublegetFanSpeedPercent(String deviceId) Returns GPU fan speed as a percentage (0–100), or -1 if unavailable.static doublegetGpuUtilization(String deviceId) Returns GPU core utilization percentage (0–100), or -1 if unavailable.static longgetMemoryClockMhz(String deviceId) Returns GPU memory clock speed in MHz, or -1 if unavailable.static doublegetPowerDraw(String deviceId) Returns GPU power draw in watts, or -1 if unavailable.static doublegetTemperature(String deviceId) Returns GPU temperature in degrees Celsius, or -1 if unavailable.static longgetVramUsed(String deviceId) Returns VRAM used in bytes, or -1 if unavailable.static booleanReturns whether the NVML native library was successfully loaded.
-
Method Details
-
isAvailable
public static boolean isAvailable()Returns whether the NVML native library was successfully loaded.- Returns:
- true if the NVML library is available
-
findDevice
-
findDeviceByName
-
getGpuUtilization
Returns GPU core utilization percentage (0–100), or -1 if unavailable.- Parameters:
deviceId- stable device identifier- Returns:
- utilization percentage or -1
-
getVramUsed
Returns VRAM used in bytes, or -1 if unavailable.- Parameters:
deviceId- stable device identifier- Returns:
- bytes used or -1
-
getTemperature
Returns GPU temperature in degrees Celsius, or -1 if unavailable.- Parameters:
deviceId- stable device identifier- Returns:
- temperature in °C or -1
-
getPowerDraw
Returns GPU power draw in watts, or -1 if unavailable.- Parameters:
deviceId- stable device identifier- Returns:
- power in watts or -1
-
getCoreClockMhz
Returns GPU core clock speed in MHz, or -1 if unavailable.- Parameters:
deviceId- stable device identifier- Returns:
- core clock in MHz or -1
-
getMemoryClockMhz
Returns GPU memory clock speed in MHz, or -1 if unavailable.- Parameters:
deviceId- stable device identifier- Returns:
- memory clock in MHz or -1
-
getFanSpeedPercent
Returns GPU fan speed as a percentage (0–100), or -1 if unavailable.- Parameters:
deviceId- stable device identifier- Returns:
- fan speed percentage or -1
-