Method: ComputeUnit::AmdGpu#voltage_table

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

#voltage_tableArray

Returns - array of hashes of voltages :sclk=>300, :volt=>750.

Returns:

  • (Array)
    • array of hashes of voltages :sclk=>300, :volt=>750



165
166
167
168
169
170
171
172
173
174
# File 'lib/compute_unit/gpus/amd_gpu.rb', line 165

def voltage_table
  data = read_kernel_setting('pp_od_clk_voltage', nil)
  return [] if data.nil?

  _, sclk, = data.split(/OD_[S,M]CLK:\s?\n/)
  sclk.split("\n").map do |line|
    pstate, clk, volt, = line.gsub(/:|Mhz|mV/, '').split(/\s{2,}/).map(&:to_i)
    { pstate: pstate, clk: clk, volt: volt, type: :sclk }
  end
end