cleanup, add introductory AMDGPU clock control
This commit is contained in:
parent
1da046a92c
commit
b22c8f5d9b
2 changed files with 23 additions and 8 deletions
|
@ -2,10 +2,12 @@
|
||||||
- hosts: localhost
|
- hosts: localhost
|
||||||
become: yes
|
become: yes
|
||||||
vars:
|
vars:
|
||||||
power_max_multi: 0.90 # should not exceed 1.0, must be a float. note: driver seems to do its own rounding
|
power_max_multi: 1.0 # should not exceed 1.0, must be a float. note: driver seems to do its own rounding
|
||||||
power_max: "{{ power_max_b64['content'] | b64decode }}"
|
power_max: "{{ power_max_b64['content'] | b64decode }}"
|
||||||
power_cap_float: "{{ power_max |float * power_max_multi }}"
|
power_cap_float: "{{ power_max |float * power_max_multi }}"
|
||||||
|
power_cap_half_float: "{{ power_max |float * 0.5 }}"
|
||||||
power_cap: "{{ power_cap_float |int }}"
|
power_cap: "{{ power_cap_float |int }}"
|
||||||
|
power_cap_half: "{{ power_cap_half_float |int }}" # used to limit GPU power to 50% on 'low' perf modes
|
||||||
card: card0 # default to card0
|
card: card0 # default to card0
|
||||||
base_profiles: # standard tuned profiles available on Fedora, should dynamically discover?
|
base_profiles: # standard tuned profiles available on Fedora, should dynamically discover?
|
||||||
- balanced
|
- balanced
|
||||||
|
@ -17,12 +19,12 @@
|
||||||
- virtual-host
|
- virtual-host
|
||||||
amdgpu_profiles: # statically defined mapping of the contents in /sys/class/drm/{{ card }}/device/pp_power_profile_mode
|
amdgpu_profiles: # statically defined mapping of the contents in /sys/class/drm/{{ card }}/device/pp_power_profile_mode
|
||||||
# - { name: 'bootup_default', value: 0 }
|
# - { name: 'bootup_default', value: 0 }
|
||||||
# - { name: '3D_fullscreen', value: 1 }
|
- { name: '3D', value: 1 }
|
||||||
- { name: 'powersaving', value: 2 }
|
- { name: 'powersaving', value: 2 }
|
||||||
- { name: 'video', value: 3 }
|
- { name: 'video', value: 3 }
|
||||||
- { name: 'VR', value: 4 }
|
- { name: 'VR', value: 4 }
|
||||||
# - { name: 'compute', value: 5 }
|
# - { name: 'compute', value: 5 }
|
||||||
# - { name: 'custom', value: 6 }
|
- { name: 'custom', value: 6 }
|
||||||
handlers:
|
handlers:
|
||||||
- name: restart tuned
|
- name: restart tuned
|
||||||
ansible.builtin.service:
|
ansible.builtin.service:
|
||||||
|
|
|
@ -3,18 +3,31 @@ include={{ item.1 }}
|
||||||
summary={{ item.1 }} + TCP/RAID tweaks + AMDGPU pp_power_profile_mode = {{ item.0.value }} ({{ item.0.name }})
|
summary={{ item.1 }} + TCP/RAID tweaks + AMDGPU pp_power_profile_mode = {{ item.0.value }} ({{ item.0.name }})
|
||||||
|
|
||||||
[sysfs]
|
[sysfs]
|
||||||
/sys/class/drm/{{ card }}/device/power_dpm_force_performance_level = manual
|
|
||||||
/sys/class/drm/{{ card }}/device/pp_power_profile_mode = {{ item.0.value }}
|
/sys/class/drm/{{ card }}/device/pp_power_profile_mode = {{ item.0.value }}
|
||||||
# limit to {{ power_max_multi * 100.0 |int }}% of the max power capability
|
{% if 'VR' in item.0.name or '3D' in item.0.name or 'compute' in item.0.name or 'custom' in item.0.name %}
|
||||||
|
{# TODO: if 'custom' profile: #}
|
||||||
|
{# set 'power_dpm_force_performance_level' to manual #}
|
||||||
|
{# set individual clocks (eg: pp_dpm_mclk/pp_dpm_sclk/pp_dpm_pcie) #}
|
||||||
|
{# with user-provided values for those clocks #}
|
||||||
|
# configure GPU power/clock characteristics
|
||||||
|
# ref: https://docs.kernel.org/gpu/amdgpu/thermal.html
|
||||||
|
/sys/class/drm/{{ card }}/device/power_dpm_force_performance_level = high
|
||||||
|
# limit perf profiles to {{ power_max_multi * 100.0 |int }}% of the max power capability
|
||||||
/sys/class/drm/{{ card }}/device/hwmon/hwmon9/power1_cap = {{ power_cap }}
|
/sys/class/drm/{{ card }}/device/hwmon/hwmon9/power1_cap = {{ power_cap }}
|
||||||
|
{% else %}
|
||||||
|
# choose power saving dpm clock options
|
||||||
|
/sys/class/drm/{{ card }}/device/power_dpm_force_performance_level = low
|
||||||
|
# limit lower power modes to 50% of the max power capability
|
||||||
|
/sys/class/drm/{{ card }}/device/hwmon/hwmon9/power1_cap = {{ power_cap_half }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
[sysctl]
|
[sysctl]
|
||||||
net.core.default_qdisc=fq
|
net.core.default_qdisc=fq
|
||||||
net.ipv4.tcp_congestion_control=bbr
|
# 'bbr2' requires a [modified] supporting kernel - stock Fedora kernels do *not* support it (currently)
|
||||||
|
# eg: 'kernel-xanmode-edge' from COPR 'rmnscnce/kernel-xanmod'
|
||||||
|
net.ipv4.tcp_congestion_control=bbr2
|
||||||
net.core.rmem_max=33554432
|
net.core.rmem_max=33554432
|
||||||
net.core.wmem_max=33554432
|
net.core.wmem_max=33554432
|
||||||
{# net.core.rmem_max=4194304 #}
|
|
||||||
{# net.core.wmem_max=1048576 #}
|
|
||||||
dev.raid.speed_limit_min=600000
|
dev.raid.speed_limit_min=600000
|
||||||
dev.raid.speed_limit_max=9000000
|
dev.raid.speed_limit_max=9000000
|
||||||
# allow some games to run (eg: DayZ)
|
# allow some games to run (eg: DayZ)
|
||||||
|
|
Loading…
Reference in a new issue