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 +4 -4
- data/README.md +58 -38
- data/lib/amdgpu_fan/cli.rb +29 -8
- data/lib/amdgpu_fan/mixin/fan.rb +1 -1
- data/lib/amdgpu_fan/service.rb +10 -2
- data/lib/amdgpu_fan/version.rb +1 -1
- metadata +4 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f91bde13a5fa46012eeca0470abe839f2b2275bc6d924d86595e9b43784258b5
|
4
|
+
data.tar.gz: 35ca1f531e796adb13b220c647861eee51c5b9f93d5543fa88baa0d9d013a0f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
-
###
|
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
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
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
|
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
|
-
|
54
|
-
📄 vBIOS:
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
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]
|
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
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
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
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
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
|
data/lib/amdgpu_fan/cli.rb
CHANGED
@@ -25,18 +25,33 @@ module AmdgpuFan
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
desc '
|
29
|
-
def
|
30
|
-
|
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 '
|
34
|
-
|
35
|
-
|
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',
|
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.
|
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)}"
|
data/lib/amdgpu_fan/mixin/fan.rb
CHANGED
data/lib/amdgpu_fan/service.rb
CHANGED
@@ -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
|
-
|
131
|
-
|
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)
|
data/lib/amdgpu_fan/version.rb
CHANGED
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.
|
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:
|
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.
|
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.
|
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
|