Class NvmlUtilFFM

java.lang.Object
oshi.util.gpu.NvmlUtilFFM

@ThreadSafe public final class NvmlUtilFFM extends Object
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 Details

    • isAvailable

      public static boolean isAvailable()
      Returns whether the NVML native library was successfully loaded.
      Returns:
      true if the NVML library is available
    • findDevice

      public static String findDevice(String pciBusId)
      Finds the stable PCI bus ID string for the NVML device whose bus ID contains the given fragment.
      Parameters:
      pciBusId - PCI bus ID fragment
      Returns:
      matched PCI bus ID string, or null if not found
    • findDeviceByName

      public static String findDeviceByName(String gpuName)
      Finds the stable PCI bus ID string for the NVML device whose name matches the given GPU name.
      Parameters:
      gpuName - GPU name string
      Returns:
      PCI bus ID string, or null if not found
    • getGpuUtilization

      public static double getGpuUtilization(String deviceId)
      Returns GPU core utilization percentage (0–100), or -1 if unavailable.
      Parameters:
      deviceId - stable device identifier
      Returns:
      utilization percentage or -1
    • getVramUsed

      public static long getVramUsed(String deviceId)
      Returns VRAM used in bytes, or -1 if unavailable.
      Parameters:
      deviceId - stable device identifier
      Returns:
      bytes used or -1
    • getTemperature

      public static double getTemperature(String deviceId)
      Returns GPU temperature in degrees Celsius, or -1 if unavailable.
      Parameters:
      deviceId - stable device identifier
      Returns:
      temperature in °C or -1
    • getPowerDraw

      public static double getPowerDraw(String deviceId)
      Returns GPU power draw in watts, or -1 if unavailable.
      Parameters:
      deviceId - stable device identifier
      Returns:
      power in watts or -1
    • getCoreClockMhz

      public static long getCoreClockMhz(String deviceId)
      Returns GPU core clock speed in MHz, or -1 if unavailable.
      Parameters:
      deviceId - stable device identifier
      Returns:
      core clock in MHz or -1
    • getMemoryClockMhz

      public static long getMemoryClockMhz(String deviceId)
      Returns GPU memory clock speed in MHz, or -1 if unavailable.
      Parameters:
      deviceId - stable device identifier
      Returns:
      memory clock in MHz or -1
    • getFanSpeedPercent

      public static double getFanSpeedPercent(String deviceId)
      Returns GPU fan speed as a percentage (0–100), or -1 if unavailable.
      Parameters:
      deviceId - stable device identifier
      Returns:
      fan speed percentage or -1