amdgpu_fan 0.9.0 → 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: c56a24ac7feceacab33c70e7a59e6126653f9a8507f468a3ea948e2372b24ec1
4
- data.tar.gz: 4c5b6634b9d805d0bcf5de22346b6865aae9d54aea515f75c25ff5476916de6b
3
+ metadata.gz: f91bde13a5fa46012eeca0470abe839f2b2275bc6d924d86595e9b43784258b5
4
+ data.tar.gz: 35ca1f531e796adb13b220c647861eee51c5b9f93d5543fa88baa0d9d013a0f6
5
5
  SHA512:
6
- metadata.gz: 5fb3898d03b55097970f1cbffb1a9fe813e463564e905fa23025161aa783e73dfd9b03e0cd6842c2b69fc1552fbbd11cebcc8318a139e33d5868cc41a30023a8
7
- data.tar.gz: 6b8417efa976498f35d2fdc5eb4c8360f38a8a645c0b5b1586a5b6f190cacbb07360c2da76be56123cf49838ae483e760eeebaefe84e38d9d44eda1ba03de5ac
6
+ metadata.gz: 9d6b499c6cc55def6814f5937050d2f98fbd485397db6adda6768c3ff50d111c83c4469c8863f914209b287c26070bd36aca7f7214808d962ed92aa249604595
7
+ data.tar.gz: '0049a81776183dbe23c0db27aadfb168010028528f0043c79ffe681e0a9af3d1ac8b0b9e2a66f594c9d403a5ee4e6fb22cb1d24ee15878eeee214fdef43800ed'
data/README.md CHANGED
@@ -9,28 +9,36 @@ A Ruby CLI to read and set fan speed, power profiles, and more for AMD Radeon gr
9
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.
10
10
 
11
11
  #### Further reading
12
-
12
+ e
13
13
  - https://wiki.archlinux.org/index.php/AMDGPU#Overclocking
14
14
  - https://wiki.archlinux.org/index.php/Fan_speed_control#AMDGPU_sysfs_fan_control
15
15
  - https://phoronix.com/scan.php?page=news_item&px=AMDGPU-Quick-WattMan-Cap-Test
16
16
 
17
17
  ## Installation
18
18
 
19
- 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.
20
20
 
21
- ### 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.
22
24
 
25
+ ```sh
26
+ paru -S ruby-amdgpu_fan
23
27
  ```
28
+
29
+ ### From RubyGems
30
+
31
+ ```sh
24
32
  gem install amdgpu_fan
25
33
  ```
26
34
 
27
35
  ### From Source
28
36
 
29
- ```
30
- git clone https://github.com/HarlemSquirrel/amdgpu-fan-rb.git
31
- cd amdgpu-fan-rb
32
- bundle install
33
- 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
34
42
  ```
35
43
 
36
44
  ## Usage
@@ -42,52 +50,64 @@ Commands:
42
50
  amdgpu_fan fan # View fan details.
43
51
  amdgpu_fan fan_set PERCENTAGE/AUTO # Set fan speed to percentage or automatic mode. (requires sudo)
44
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.
45
56
  amdgpu_fan profile # View power profile details.
46
- amdgpu_fan profile_auto # Set the power profile to automatic mode.
47
- 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)
48
58
  amdgpu_fan status [--logo] # View device info, current fan speed, and temperature.
59
+ amdgpu_fan version # Print the application version.
49
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.
50
62
  amdgpu_fan watch_csv [SECONDS] # Watch stats in CSV format refreshed every n seconds defaulting to 1 second.
51
63
 
52
64
  ➤ bin/amdgpu_fan status
53
- 📺 GPU: Advanced Micro Devices, Inc. [AMD/ATI] Radeon R9 FURY X / NANO
54
- 📄 vBIOS: 113-C8800100-102
55
- Clocks: 724Mhz Core, 500Mhz Memory
56
- 💾 Memory: 4096 MiB
57
- 🌀 Fan: auto mode running at 1809 rpm (48%)
58
- 🌞 Temp: 21.0°C
59
- Power: 3D_FULL_SCREEN profile in performance mode using 16.2 / 300.0 Watts (5%)
60
- ⚖ 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% [ ]
61
74
 
62
75
  ➤ bin/amdgpu_fan watch 3
63
- 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)...
64
77
  <Press Ctrl-C to exit>
65
- 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
66
- 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
67
- 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
68
- 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
69
- 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
70
- 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
71
- 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
72
- 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
73
- 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
74
- 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
75
96
  ^C
76
97
  And now the watch is ended.
77
98
  ```
78
99
 
79
100
  ```
80
101
  ➤ bin/amdgpu_fan watch_avg
81
- Watching Sapphire Technology Limited Vega 10 XL/XT [Radeon RX Vega 56/64] min, max and averges since
82
- 2020-06-02 23:05:20 -0400...
83
- <Press Ctrl-C to exit>
84
- Core clock min: 852 MHz avg: 887.0 MHz max: 1200 MHz now: 852 MHz
85
- 💾 Memory clk min: 167 MHz avg: 227.1 MHz max: 945 MHz now: 167 MHz
86
- 🌀 Fan speed min: 1231 RPM avg: 1231.0 RPM max: 1231 RPM now: 1231 RPM
87
- Power usage min: 6.0 W avg: 21.8 W max: 141.0 W now: 6.0 W
88
- 🌡 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
89
109
  ^C
90
- And now the watch is ended.
110
+ And now the watch is ended
91
111
  ```
92
112
 
93
113
  ## Dependencies
@@ -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,7 +86,7 @@ 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 " \
89
+ "#{amdgpu_service.performance_level} mode using " \
75
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)
@@ -191,6 +206,12 @@ module AmdgpuFan
191
206
  format('%<num>0.2f', num: amdgpu_service.power_max)
192
207
  end
193
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
+
194
215
  def summary_clock
195
216
  "Core: #{amdgpu_service.core_clock.to_s.rjust(7)}#{WATCH_FIELD_SEPARATOR}" \
196
217
  "Memory: #{amdgpu_service.memory_clock.to_s.rjust(7)}"
@@ -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
@@ -111,6 +111,9 @@ module AmdgpuFan
111
111
  .join(' ')
112
112
  end
113
113
 
114
+ ##
115
+ # For older GPUs
116
+ # https://dri.freedesktop.org/docs/drm/gpu/amdgpu.html#power-dpm-state
114
117
  def power_dpm_state
115
118
  File.read("#{base_card_dir}/power_dpm_state").strip
116
119
  end
@@ -127,8 +130,13 @@ module AmdgpuFan
127
130
  @power_max ||= power_raw_to_watts File.read("#{base_hwmon_dir}/power1_cap")
128
131
  end
129
132
 
130
- def profile_auto
131
- 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
132
140
  end
133
141
 
134
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.9.0'
5
+ VERSION = '1.0.0'
6
6
  end
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.9.0
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: 2023-11-17 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
@@ -65,7 +64,6 @@ licenses:
65
64
  - MIT
66
65
  metadata:
67
66
  rubygems_mfa_required: 'true'
68
- post_install_message:
69
67
  rdoc_options: []
70
68
  require_paths:
71
69
  - lib
@@ -73,15 +71,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
73
71
  requirements:
74
72
  - - ">="
75
73
  - !ruby/object:Gem::Version
76
- version: 3.1.0
74
+ version: 3.2.0
77
75
  required_rubygems_version: !ruby/object:Gem::Requirement
78
76
  requirements:
79
77
  - - ">="
80
78
  - !ruby/object:Gem::Version
81
79
  version: '0'
82
80
  requirements: []
83
- rubygems_version: 3.4.10
84
- signing_key:
81
+ rubygems_version: 3.6.2
85
82
  specification_version: 4
86
83
  summary: A CLI to view and set fan speeds for AMD graphics cards running on the open
87
84
  source amdgpu Linux driver