Method: ComputeUnit::AmdGpu#fan_limit

Defined in:
lib/compute_unit/gpus/amd_gpu.rb

#fan_limitNumeric

Note:

the OS values is between 0 - 255

Returns - current fan limit as a percentage.

Returns:

  • (Numeric)
    • current fan limit as a percentage



258
259
260
261
262
263
# File 'lib/compute_unit/gpus/amd_gpu.rb', line 258

def fan_limit
  cur = read_hwmon_data('pwm1', 0).to_i
  return cur unless cur > 0

  ((cur / 255.0) * 100).round(0)
end