amdgpu_fan 0.8.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad0c6af3e3dea6b56a0526203a603591583ea8184bd8e49f7efcdd2c3dab492b
4
- data.tar.gz: 9ccb672107d73c822b31bd52d7c0048f0d79d175f02bca1c3b8a7df351f1b9b9
3
+ metadata.gz: f91bde13a5fa46012eeca0470abe839f2b2275bc6d924d86595e9b43784258b5
4
+ data.tar.gz: 35ca1f531e796adb13b220c647861eee51c5b9f93d5543fa88baa0d9d013a0f6
5
5
  SHA512:
6
- metadata.gz: 34230d04f43087f2c81517bccb6e74a0f976b8909b67c287011143f016a06e54a7c7a02b32e33cc21221305473b30ab23d2af699d658410573fa702452dd05ff
7
- data.tar.gz: 7162d533859e691610b73ac969ea4a87946bdfc5803b83f391e38f9070e2077fe1eefe415baa7a553f82ab39d21da9f4e59cf107dbcbd8085a0ddcb34970443e
6
+ metadata.gz: 9d6b499c6cc55def6814f5937050d2f98fbd485397db6adda6768c3ff50d111c83c4469c8863f914209b287c26070bd36aca7f7214808d962ed92aa249604595
7
+ data.tar.gz: '0049a81776183dbe23c0db27aadfb168010028528f0043c79ffe681e0a9af3d1ac8b0b9e2a66f594c9d403a5ee4e6fb22cb1d24ee15878eeee214fdef43800ed'
data/README.md CHANGED
@@ -1,35 +1,44 @@
1
1
  # amdgpu_fan
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/amdgpu_fan.svg)](https://badge.fury.io/rb/amdgpu_fan)
4
- [![Build Status](https://travis-ci.org/HarlemSquirrel/amdgpu-fan-rb.svg?branch=master)](https://travis-ci.org/HarlemSquirrel/amdgpu-fan-rb) [![Maintainability](https://api.codeclimate.com/v1/badges/27233cee17ef6a2c14fd/maintainability)](https://codeclimate.com/github/HarlemSquirrel/amdgpu-fan-rb/maintainability)
4
+ [![Verify](https://github.com/HarlemSquirrel/amdgpu-fan-rb/actions/workflows/verify.yml/badge.svg)](https://github.com/HarlemSquirrel/amdgpu-fan-rb/actions/workflows/verify.yml)
5
+ [![Maintainability](https://api.codeclimate.com/v1/badges/27233cee17ef6a2c14fd/maintainability)](https://codeclimate.com/github/HarlemSquirrel/amdgpu-fan-rb/maintainability)
5
6
 
6
7
  A Ruby CLI to read and set fan speed, power profiles, and more for AMD Radeon graphics cards running on the AMDGPU Linux driver.
7
8
 
8
9
  **amdgpu_fan** aims to provide a more user friendly interface on top of [sysfs](https://en.wikipedia.org/wiki/Sysfs) for displaying statistics and interacting with AMD Radeon graphics hardware running on the [AMDgpu](https://dri.freedesktop.org/docs/drm/gpu/amdgpu.html) driver.
9
10
 
10
11
  #### Further reading
11
-
12
+ e
12
13
  - https://wiki.archlinux.org/index.php/AMDGPU#Overclocking
13
14
  - https://wiki.archlinux.org/index.php/Fan_speed_control#AMDGPU_sysfs_fan_control
14
15
  - https://phoronix.com/scan.php?page=news_item&px=AMDGPU-Quick-WattMan-Cap-Test
15
16
 
16
17
  ## Installation
17
18
 
18
- The `amdgpu_fan` CLI command can be installed from [RubyGems](https://rubygems.org/gems/amdgpu_fan) or easily run from the source code.
19
+ The `amdgpu_fan` CLI command can be installed in [Arch Linux from the AUR](https://aur.archlinux.org/packages/ruby-amdgpu_fan), from [RubyGems](https://rubygems.org/gems/amdgpu_fan), or run from the source code.
19
20
 
20
- ### From RubyGems
21
+ ### Arch User Repository
22
+
23
+ Use your favorite tool such as [`paru`](https://aur.archlinux.org/packages/paru) to install [`ruby-amdgrpu_fan`](https://aur.archlinux.org/packages/ruby-amdgpu_fan) from the AUR.
21
24
 
25
+ ```sh
26
+ paru -S ruby-amdgpu_fan
22
27
  ```
28
+
29
+ ### From RubyGems
30
+
31
+ ```sh
23
32
  gem install amdgpu_fan
24
33
  ```
25
34
 
26
35
  ### From Source
27
36
 
28
- ```
29
- git clone https://github.com/HarlemSquirrel/amdgpu-fan-rb.git
30
- cd amdgpu-fan-rb
31
- bundle install
32
- bin/amdgpu_fan
37
+ ```sh
38
+ git clone https://github.com/HarlemSquirrel/amdgpu-fan-rb.git
39
+ cd amdgpu-fan-rb
40
+ bundle install
41
+ bin/amdgpu_fan
33
42
  ```
34
43
 
35
44
  ## Usage
@@ -41,52 +50,64 @@ Commands:
41
50
  amdgpu_fan fan # View fan details.
42
51
  amdgpu_fan fan_set PERCENTAGE/AUTO # Set fan speed to percentage or automatic mode. (requires sudo)
43
52
  amdgpu_fan help [COMMAND] # Describe available commands or one specific command
53
+ amdgpu_fan power_mode_auto # Set the power profile to automatic mode.
54
+ amdgpu_fan power_mode_high # Set the performance level to low to force the clocks to the highest power state.
55
+ amdgpu_fan power_mode_low # Set the performance level to low to force the clocks to the lowest power state.
44
56
  amdgpu_fan profile # View power profile details.
45
- amdgpu_fan profile_auto # Set the power profile to automatic mode.
46
- amdgpu_fan profile_force PROFILE_NUM # Manually set a power profile. (requires sudo)
57
+ amdgpu_fan profile_force PROFILE_NUM # Set performance mode to manual and set a power profile. (requires sudo)
47
58
  amdgpu_fan status [--logo] # View device info, current fan speed, and temperature.
59
+ amdgpu_fan version # Print the application version.
48
60
  amdgpu_fan watch [SECONDS] # Watch fan speed, load, power, and temperature refreshed every n seconds.
61
+ amdgpu_fan watch_avg # Watch min, max, average, and current stats.
49
62
  amdgpu_fan watch_csv [SECONDS] # Watch stats in CSV format refreshed every n seconds defaulting to 1 second.
50
63
 
51
64
  ➤ bin/amdgpu_fan status
52
- 📺 GPU: Advanced Micro Devices, Inc. [AMD/ATI] Radeon R9 FURY X / NANO
53
- 📄 vBIOS: 113-C8800100-102
54
- Clocks: 724Mhz Core, 500Mhz Memory
55
- 💾 Memory: 4096 MiB
56
- 🌀 Fan: auto mode running at 1809 rpm (48%)
57
- 🌞 Temp: 21.0°C
58
- Power: 3D_FULL_SCREEN profile in performance mode using 16.2 / 300.0 Watts (5%)
59
- ⚖ Load: [ ]0%
65
+ 👾 GPU: Advanced Micro Devices, Inc. [AMD/ATI] NITRO+ RX 7900 XTX Vapor-X
66
+ 📄 vBIOS: 113-4E4710U-T4Y
67
+ 📺 Displays: G321CQP E2
68
+ Clocks: 67 Core, 456 Memory
69
+ 💾 Memory: 24560 MiB
70
+ 🌀 Fan: auto mode running at 0 rpm (0%)
71
+ 🧯 Temp: 46.0°C
72
+ ⚡ Power: 3D_FULL_SCREEN profile in auto mode using 35.0 / 339.0 Watts (10%)
73
+ 🚚 Load: 00% [ ]
60
74
 
61
75
  ➤ bin/amdgpu_fan watch 3
62
- Watching Advanced Micro Devices, Inc. [AMD/ATI] Radeon R9 FURY X / NANO every 3 second(s)...
76
+ Watching Advanced Micro Devices, Inc. [AMD/ATI] NITRO+ RX 7900 XTX Vapor-X every 3 second(s)...
63
77
  <Press Ctrl-C to exit>
64
- 2019-05-28 20:57:41 | Core: 724Mhz | Memory: 500Mhz | Fan: 948 rpm [* ]14% | Load: [** ]24% | Power: 16.07 W [* ]6% | Temp: 34.0°C
65
- 2019-05-28 20:57:45 | Core: 512Mhz | Memory: 500Mhz | Fan: 948 rpm [* ]14% | Load: [ ]0% | Power: 16.13 W [* ]7% | Temp: 34.0°C
66
- 2019-05-28 20:57:49 | Core: 892Mhz | Memory: 500Mhz | Fan: 948 rpm [* ]14% | Load: [ ]0% | Power: 25.22 W [* ]5% | Temp: 33.0°C
67
- 2019-05-28 20:57:53 | Core: 300Mhz | Memory: 500Mhz | Fan: 948 rpm [* ]14% | Load: [ ]0% | Power: 19.1 W [* ]6% | Temp: 33.0°C
68
- 2019-05-28 20:57:57 | Core: 1050Mhz | Memory: 500Mhz | Fan: 948 rpm [* ]14% | Load: [********* ]94% | Power: 103.04 W [*** ]31% | Temp: 36.0°C
69
- 2019-05-28 20:58:01 | Core: 1050Mhz | Memory: 500Mhz | Fan: 954 rpm [** ]15% | Load: [********* ]91% | Power: 158.07 W [***** ]53% | Temp: 38.0°C
70
- 2019-05-28 20:58:05 | Core: 1050Mhz | Memory: 500Mhz | Fan: 977 rpm [** ]16% | Load: [**********]100% | Power: 218.01 W [******* ]73% | Temp: 40.0°C
71
- 2019-05-28 20:58:09 | Core: 1050Mhz | Memory: 500Mhz | Fan: 1005 rpm [** ]16% | Load: [**********]100% | Power: 216.24 W [******* ]71% | Temp: 40.0°C
72
- 2019-05-28 20:58:13 | Core: 1050Mhz | Memory: 500Mhz | Fan: 1033 rpm [** ]17% | Load: [**********]97% | Power: 109.25 W [**** ]39% | Temp: 38.0°C
73
- 2019-05-28 20:58:17 | Core: 724Mhz | Memory: 500Mhz | Fan: 1058 rpm [** ]17% | Load: [ ]0% | Power: 17.17 W [* ]6% | Temp: 35.0°C
78
+ 2025-05-31 15:02:48 | Core: 41 | Memory: 456 | Fan: 0 rpm 00% [ ] | Load: 00% [ ] | Power: 34.00 W 10% [▎ ] | Temp: 45.0°C
79
+ 2025-05-31 15:02:51 | Core: 3 | Memory: 96 | Fan: 0 rpm 00% [ ] | Load: 00% [ ] | Power: 22.00 W 06% [▏ ] | Temp: 45.0°C
80
+ 2025-05-31 15:02:54 | Core: 2 | Memory: 96 | Fan: 0 rpm 00% [ ] | Load: 00% [ ] | Power: 11.00 W 03% [▏ ] | Temp: 45.0°C
81
+ 2025-05-31 15:02:57 | Core: 55 | Memory: 456 | Fan: 0 rpm 00% [ ] | Load: 04% [] | Power: 38.00 W 11% [] | Temp: 45.0°C
82
+ 2025-05-31 15:03:00 | Core: 63 | Memory: 456 | Fan: 0 rpm 00% [ ] | Load: 04% [▏ ] | Power: 33.00 W 10% [] | Temp: 45.0°C
83
+ 2025-05-31 15:03:03 | Core: 51 | Memory: 96 | Fan: 0 rpm 00% [ ] | Load: 03% [▏ ] | Power: 32.00 W 09% [] | Temp: 45.0°C
84
+ 2025-05-31 15:03:06 | Core: 63 | Memory: 456 | Fan: 0 rpm 00% [ ] | Load: 04% [] | Power: 33.00 W 10% [] | Temp: 45.0°C
85
+ 2025-05-31 15:03:09 | Core: 79 | Memory: 456 | Fan: 0 rpm 00% [ ] | Load: 05% [] | Power: 34.00 W 10% [] | Temp: 45.0°C
86
+ 2025-05-31 15:03:12 | Core: 96 | Memory: 456 | Fan: 0 rpm 00% [ ] | Load: 06% [] | Power: 35.00 W 10% [] | Temp: 45.0°C
87
+ 2025-05-31 15:03:15 | Core: 94 | Memory: 456 | Fan: 0 rpm 00% [ ] | Load: 05% [] | Power: 34.00 W 10% [▎ ] | Temp: 46.0°C
88
+ 2025-05-31 15:03:18 | Core: 95 | Memory: 456 | Fan: 0 rpm 00% [ ] | Load: 05% [▏ ] | Power: 34.00 W 10% [▎ ] | Temp: 46.0°C
89
+ 2025-05-31 15:03:21 | Core: 60 | Memory: 456 | Fan: 0 rpm 00% [ ] | Load: 03% [▏ ] | Power: 33.00 W 10% [▎ ] | Temp: 45.0°C
90
+ 2025-05-31 15:03:24 | Core: 71 | Memory: 96 | Fan: 0 rpm 00% [ ] | Load: 04% [▏ ] | Power: 31.00 W 09% [▎ ] | Temp: 45.0°C
91
+ 2025-05-31 15:03:27 | Core: 68 | Memory: 456 | Fan: 0 rpm 00% [ ] | Load: 03% [▏ ] | Power: 33.00 W 10% [▎ ] | Temp: 46.0°C
92
+ 2025-05-31 15:03:30 | Core: 219 | Memory: 456 | Fan: 0 rpm 00% [ ] | Load: 15% [▌ ] | Power: 36.00 W 11% [▍ ] | Temp: 46.0°C
93
+ 2025-05-31 15:03:33 | Core: 1328 | Memory: 772 | Fan: 0 rpm 00% [ ] | Load: 21% [▋ ] | Power: 43.00 W 12% [▍ ] | Temp: 46.0°C
94
+ 2025-05-31 15:03:36 | Core: 1241 | Memory: 772 | Fan: 0 rpm 00% [ ] | Load: 32% [█ ] | Power: 55.00 W 16% [▌ ] | Temp: 46.0°C
95
+ 2025-05-31 15:03:39 | Core: 216 | Memory: 456 | Fan: 0 rpm 00% [ ] | Load: 15% [▌ ] | Power: 38.00 W 11% [▍ ] | Temp: 46.0°C
74
96
  ^C
75
97
  And now the watch is ended.
76
98
  ```
77
99
 
78
100
  ```
79
101
  ➤ bin/amdgpu_fan watch_avg
80
- Watching Sapphire Technology Limited Vega 10 XL/XT [Radeon RX Vega 56/64] min, max and averges since
81
- 2020-06-02 23:05:20 -0400...
82
- <Press Ctrl-C to exit>
83
- Core clock min: 852 MHz avg: 887.0 MHz max: 1200 MHz now: 852 MHz
84
- 💾 Memory clk min: 167 MHz avg: 227.1 MHz max: 945 MHz now: 167 MHz
85
- 🌀 Fan speed min: 1231 RPM avg: 1231.0 RPM max: 1231 RPM now: 1231 RPM
86
- Power usage min: 6.0 W avg: 21.8 W max: 141.0 W now: 6.0 W
87
- 🌡 Temperature min: 30 °C avg: 31.3 °C max: 35 °C now: 32 °C
102
+ Watching Advanced Micro Devices, Inc. [AMD/ATI] NITRO+ RX 7900 XTX Vapor-X min, max and averges since 2025-05-31 15:04:22 -0400...
103
+ 🚚 Load min: 0 % avg: 5.9 % max: 27 % now: 3 %
104
+ ⏰ Core clock min: 2 MHz avg: 202.4 MHz max: 1337 MHz now: 51 MHz
105
+ 💾 Memory clk min: 456 MHz avg: 501.2 MHz max: 772 MHz now: 456 MHz
106
+ 🌀 Fan speed min: 0 RPM avg: 0.0 RPM max: 0 RPM now: 0 RPM
107
+ Power usage min: 30.0 W avg: 35.4 W max: 51.0 W now: 33.0 W
108
+ 🧯 Temperature min: 46.0 °C avg: 46.0 °C max: 47.0 °C now: 46.0 °C
88
109
  ^C
89
- And now the watch is ended.
110
+ And now the watch is ended
90
111
  ```
91
112
 
92
113
  ## Dependencies
@@ -9,7 +9,7 @@ module AmdgpuFan
9
9
  class Cli < Thor
10
10
  include CliOutputFormat
11
11
 
12
- ICONS = YAML.safe_load(File.read(File.join(__dir__, '../../config/icons.yml')))
12
+ ICONS = YAML.safe_load_file(File.join(__dir__, '../../config/icons.yml'))
13
13
  .transform_keys(&:to_sym).freeze
14
14
  WATCH_FIELD_SEPARATOR = ' | '
15
15
 
@@ -25,18 +25,33 @@ module AmdgpuFan
25
25
  end
26
26
  end
27
27
 
28
- desc 'profile', 'View power profile details.'
29
- def profile
30
- puts amdgpu_service.profile_summary
28
+ desc 'power_mode_auto', 'Set the power profile to automatic mode.'
29
+ def power_mode_auto
30
+ amdgpu_service.set_performance_level('auto')
31
+ puts oneline_power_mode
31
32
  end
32
33
 
33
- desc 'profile_auto', 'Set the power profile to automatic mode.'
34
- def profile_auto
35
- amdgpu_service.profile_auto
34
+ desc 'power_mode_low',
35
+ 'Set the performance level to low to force the clocks to the lowest power state.'
36
+ def power_mode_low
37
+ amdgpu_service.set_performance_level('low')
38
+ puts oneline_power_mode
39
+ end
40
+
41
+ desc 'power_mode_high',
42
+ 'Set the performance level to low to force the clocks to the highest power state.'
43
+ def power_mode_high
44
+ amdgpu_service.set_performance_level('high')
45
+ puts oneline_power_mode
46
+ end
47
+
48
+ desc 'profile', 'View power profile details.'
49
+ def profile
36
50
  puts amdgpu_service.profile_summary
37
51
  end
38
52
 
39
- desc 'profile_force PROFILE_NUM', 'Manually set a power profile. (requires sudo)'
53
+ desc 'profile_force PROFILE_NUM',
54
+ 'Set performance mode to manual and set a power profile. (requires sudo)'
40
55
  def profile_force(state)
41
56
  amdgpu_service.profile_force = state
42
57
  puts amdgpu_service.profile_summary
@@ -71,8 +86,8 @@ module AmdgpuFan
71
86
  puts ICONS[:temp] + ' Temp:'.ljust(11) + "#{amdgpu_service.temperature}°C"
72
87
  puts ICONS[:power] + ' Power:'.ljust(11) +
73
88
  "#{amdgpu_service.profile_mode} profile in " \
74
- "#{amdgpu_service.power_dpm_state} mode using " \
75
- "#{amdgpu_service.power_draw} / #{amdgpu_service.power_max} Watts "\
89
+ "#{amdgpu_service.performance_level} mode using " \
90
+ "#{amdgpu_service.power_draw} / #{amdgpu_service.power_max} Watts " \
76
91
  "(#{amdgpu_service.power_draw_percent}%)"
77
92
  puts ICONS[:load] + ' Load:'.ljust(11) + percent_meter(amdgpu_service.busy_percent, 12)
78
93
  end
@@ -125,9 +140,10 @@ module AmdgpuFan
125
140
 
126
141
  loop do
127
142
  watcher.measure
128
- 5.times { print "\033[K\033[A" } # move up a line and clear to end of line
143
+ 6.times { print "\033[K\033[A" } # move up a line and clear to end of line
129
144
 
130
- puts "#{ICONS[:clock]} Core clock #{watcher.core_clock}",
145
+ puts "#{ICONS[:load]} Load #{watcher.busy_percent}",
146
+ "#{ICONS[:clock]} Core clock #{watcher.core_clock}",
131
147
  "#{ICONS[:memory]} Memory clk #{watcher.memory_clock}",
132
148
  "#{ICONS[:fan]} Fan speed #{watcher.fan_speed_rpm}",
133
149
  "#{ICONS[:power]} Power usage #{watcher.power_draw}",
@@ -141,7 +157,7 @@ module AmdgpuFan
141
157
  def watch_csv(seconds = 1)
142
158
  return puts 'Seconds must be from 1 to 600' unless (1..600).cover?(seconds.to_i)
143
159
 
144
- puts 'Timestamp,Core Clock (Mhz),Memory Clock (Mhz),Fan speed (rpm),'\
160
+ puts 'Timestamp,Core Clock (Mhz),Memory Clock (Mhz),Fan speed (rpm),' \
145
161
  'Load (%),Power (Watts),Temp (°C)'
146
162
 
147
163
  trap 'SIGINT' do
@@ -169,6 +185,7 @@ module AmdgpuFan
169
185
  private
170
186
 
171
187
  def amdgpu_service
188
+ # Right now we're only looking at the first card.
172
189
  @amdgpu_service ||= AmdgpuFan::Service.new
173
190
  end
174
191
 
@@ -189,8 +206,14 @@ module AmdgpuFan
189
206
  format('%<num>0.2f', num: amdgpu_service.power_max)
190
207
  end
191
208
 
209
+ def oneline_power_mode
210
+ "--> #{ICONS[:power]} #{amdgpu_service.performance_level} mode using " \
211
+ "#{amdgpu_service.power_draw} / #{amdgpu_service.power_max} Watts " \
212
+ "(#{amdgpu_service.power_draw_percent}%)"
213
+ end
214
+
192
215
  def summary_clock
193
- "Core: #{amdgpu_service.core_clock.to_s.rjust(7)}#{WATCH_FIELD_SEPARATOR}"\
216
+ "Core: #{amdgpu_service.core_clock.to_s.rjust(7)}#{WATCH_FIELD_SEPARATOR}" \
194
217
  "Memory: #{amdgpu_service.memory_clock.to_s.rjust(7)}"
195
218
  end
196
219
 
@@ -204,8 +227,8 @@ module AmdgpuFan
204
227
  end
205
228
 
206
229
  def summary_power
207
- "Power: #{format('%<num>0.02f', num: amdgpu_service.power_draw).rjust(power_max.length)} W" \
208
- " #{percent_meter amdgpu_service.power_draw_percent}"
230
+ "Power: #{format('%<num>0.02f', num: amdgpu_service.power_draw).rjust(power_max.length)} W " \
231
+ "#{percent_meter amdgpu_service.power_draw_percent}"
209
232
  end
210
233
 
211
234
  def summary_temp
@@ -36,7 +36,7 @@ module AmdgpuFan
36
36
  end
37
37
 
38
38
  def valid_fan_percent_speed?(percent)
39
- (1..(100.to_i)).cover?(percent.to_i)
39
+ (1..(100)).cover?(percent.to_i)
40
40
  end
41
41
  end
42
42
  end
@@ -22,12 +22,16 @@ module AmdgpuFan
22
22
 
23
23
  class Error < StandardError; end
24
24
 
25
- def initialize(card_num: 0)
26
- @card_num = card_num
25
+ def self.card_numbers
26
+ Dir["#{BASE_FOLDER}/card*"].filter_map { |path| path.split('/').last.slice(/(?<=card)\d+\Z/) }
27
+ end
28
+
29
+ def initialize(card_num: nil)
30
+ @card_num = card_num || self.class.card_numbers.first
27
31
  end
28
32
 
29
33
  def busy_percent
30
- File.read("#{base_card_dir}/gpu_busy_percent").strip
34
+ File.read("#{base_card_dir}/gpu_busy_percent").strip.to_i
31
35
  end
32
36
 
33
37
  def connectors
@@ -107,6 +111,9 @@ module AmdgpuFan
107
111
  .join(' ')
108
112
  end
109
113
 
114
+ ##
115
+ # For older GPUs
116
+ # https://dri.freedesktop.org/docs/drm/gpu/amdgpu.html#power-dpm-state
110
117
  def power_dpm_state
111
118
  File.read("#{base_card_dir}/power_dpm_state").strip
112
119
  end
@@ -123,8 +130,13 @@ module AmdgpuFan
123
130
  @power_max ||= power_raw_to_watts File.read("#{base_hwmon_dir}/power1_cap")
124
131
  end
125
132
 
126
- def profile_auto
127
- sudo_write "#{base_card_dir}/power_dpm_force_performance_level", 'auto'
133
+ # https://dri.freedesktop.org/docs/drm/gpu/amdgpu.html#power-dpm-force-performance-level
134
+ def performance_level
135
+ File.read("#{base_card_dir}/power_dpm_force_performance_level").strip
136
+ end
137
+
138
+ def set_performance_level(profile_name = 'auto')
139
+ sudo_write "#{base_card_dir}/power_dpm_force_performance_level", profile_name
128
140
  end
129
141
 
130
142
  def profile_force=(state)
@@ -2,5 +2,5 @@
2
2
 
3
3
  module AmdgpuFan
4
4
  # Current version of RSpec Core, in semantic versioning format.
5
- VERSION = '0.8.1'
5
+ VERSION = '1.0.0'
6
6
  end
@@ -7,8 +7,8 @@ require_relative 'stat_set'
7
7
  module AmdgpuFan
8
8
  # Keep track of stats over time.
9
9
  class Watcher
10
- attr_reader :core_clock, :fan_speed_rpm, :num_measurements, :memory_clock, :power_draw,
11
- :temperature
10
+ attr_reader :core_clock, :fan_speed_rpm, :busy_percent, :num_measurements, :memory_clock,
11
+ :power_draw, :temperature
12
12
 
13
13
  def initialize(amdgpu_service)
14
14
  @amdgpu_service = amdgpu_service
@@ -17,6 +17,7 @@ module AmdgpuFan
17
17
  @core_clock = StatSet.new 'MHz'
18
18
  @memory_clock = StatSet.new 'MHz'
19
19
  @fan_speed_rpm = StatSet.new 'RPM'
20
+ @busy_percent = StatSet.new '%'
20
21
  @power_draw = StatSet.new 'W'
21
22
  @temperature = StatSet.new '°C'
22
23
  end
@@ -28,7 +29,7 @@ module AmdgpuFan
28
29
  @num_measurements += 1
29
30
 
30
31
  Async do |task|
31
- %i[core_clock fan_speed_rpm memory_clock power_draw temperature].each do |stat|
32
+ %i[busy_percent core_clock fan_speed_rpm memory_clock power_draw temperature].each do |stat|
32
33
  task.async do
33
34
  send(stat).now = amdgpu_service.send(stat)
34
35
  calculate_stats(send(stat))
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amdgpu_fan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin McCormack
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2022-06-07 00:00:00.000000000 Z
10
+ date: 2025-06-25 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: async
@@ -38,62 +37,6 @@ dependencies:
38
37
  - - "~>"
39
38
  - !ruby/object:Gem::Version
40
39
  version: '1.2'
41
- - !ruby/object:Gem::Dependency
42
- name: pry
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '0.14'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '0.14'
55
- - !ruby/object:Gem::Dependency
56
- name: rspec
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '3.10'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '3.10'
69
- - !ruby/object:Gem::Dependency
70
- name: rubocop
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '1.24'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '1.24'
83
- - !ruby/object:Gem::Dependency
84
- name: rubocop-rspec
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '2.7'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '2.7'
97
40
  description: A CLI for interacting with the amdgpu Linux driver
98
41
  email: harlemsquirrel@gmail.com
99
42
  executables:
@@ -121,7 +64,6 @@ licenses:
121
64
  - MIT
122
65
  metadata:
123
66
  rubygems_mfa_required: 'true'
124
- post_install_message:
125
67
  rdoc_options: []
126
68
  require_paths:
127
69
  - lib
@@ -129,15 +71,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
129
71
  requirements:
130
72
  - - ">="
131
73
  - !ruby/object:Gem::Version
132
- version: 3.1.0
74
+ version: 3.2.0
133
75
  required_rubygems_version: !ruby/object:Gem::Requirement
134
76
  requirements:
135
77
  - - ">="
136
78
  - !ruby/object:Gem::Version
137
79
  version: '0'
138
80
  requirements: []
139
- rubygems_version: 3.3.7
140
- signing_key:
81
+ rubygems_version: 3.6.2
141
82
  specification_version: 4
142
83
  summary: A CLI to view and set fan speeds for AMD graphics cards running on the open
143
84
  source amdgpu Linux driver