add ansible_managed comment/header
This commit is contained in:
parent
3d2a88c12b
commit
81b5c762d6
4 changed files with 6 additions and 30 deletions
|
@ -1,14 +1,6 @@
|
|||
#!/bin/bash
|
||||
# script for tuned AMDGPU clock control
|
||||
# configures GPU power/clock characteristics
|
||||
# clocks/power in 3D are dynamic based on need/usage
|
||||
#
|
||||
# for 'amdgpu-default' tuned profiles, this will reset the characteristics to default
|
||||
# for others this will apply overclocking settings -- leaving clock choices to the associated power profile (eg: VR)
|
||||
#
|
||||
# rendered by Ansible with environment-appropriate values:
|
||||
# card #, eg: card0
|
||||
# path to discovered sysfs device files (power/clock/voltage control)
|
||||
{{ ansible_managed | comment }}
|
||||
# This is the 'default' script; resetting amdgpu clock/power/voltage tunables
|
||||
#
|
||||
# AMDGPU driver/sysfs references:
|
||||
# https://01.org/linuxgraphics/gfx-docs/drm/gpu/amdgpu.html
|
||||
|
|
|
@ -1,14 +1,6 @@
|
|||
#!/bin/bash
|
||||
# script for tuned AMDGPU clock control
|
||||
# configures GPU power/clock characteristics
|
||||
# clocks/power in 3D are dynamic based on need/usage
|
||||
#
|
||||
# for 'amdgpu-default' tuned profiles, this will reset the characteristics to default
|
||||
# for others this will apply overclocking settings -- leaving clock choices to the associated power profile (eg: VR)
|
||||
#
|
||||
# rendered by Ansible with environment-appropriate values:
|
||||
# card #, eg: card0
|
||||
# path to discovered sysfs device files (power/clock/voltage control)
|
||||
{{ ansible_managed | comment }}
|
||||
# This is the 'overclock' script; applies amdgpu clock/power/voltage tunables
|
||||
#
|
||||
# AMDGPU driver/sysfs references:
|
||||
# https://01.org/linuxgraphics/gfx-docs/drm/gpu/amdgpu.html
|
||||
|
|
|
@ -1,14 +1,6 @@
|
|||
#!/bin/bash
|
||||
# script for tuned AMDGPU clock control
|
||||
# configures GPU power/clock characteristics
|
||||
# clocks/power in 3D are dynamic based on need/usage
|
||||
#
|
||||
# for 'amdgpu-default' tuned profiles, this will reset the characteristics to default
|
||||
# for others this will apply overclocking settings -- leaving clock choices to the associated power profile (eg: VR)
|
||||
#
|
||||
# rendered by Ansible with environment-appropriate values:
|
||||
# card #, eg: card0
|
||||
# path to discovered sysfs device files (power/clock/voltage control)
|
||||
{{ ansible_managed | comment }}
|
||||
# This is the 'peak' script; applies most-aggressive amdgpu clock/power/voltage tunables
|
||||
#
|
||||
# AMDGPU driver/sysfs references:
|
||||
# https://01.org/linuxgraphics/gfx-docs/drm/gpu/amdgpu.html
|
||||
|
|
35
roles/tuned_amdgpu/templates/profile-common.sh.j2
Normal file
35
roles/tuned_amdgpu/templates/profile-common.sh.j2
Normal file
|
@ -0,0 +1,35 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# 'common' file sourced by other scripts under tuned profile
|
||||
#
|
||||
# dynamically determine the connected GPU using the DRM subsystem
|
||||
CARD=$(/usr/bin/grep -ls ^connected /sys/class/drm/*/status | /usr/bin/grep -o 'card[0-9]' | /usr/bin/sort | /usr/bin/uniq | /usr/bin/sort -h | /usr/bin/tail -1)
|
||||
|
||||
function get_hwmon_dir() {
|
||||
CARD_DIR="/sys/class/drm/${1}/device/"
|
||||
for CANDIDATE in "${CARD_DIR}"/hwmon/hwmon*; do
|
||||
if [[ -f "${CANDIDATE}"/power1_cap ]]; then
|
||||
# found a valid hwmon dir
|
||||
echo "${CANDIDATE}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# determine the hwmon directory
|
||||
HWMON_DIR=$(get_hwmon_dir "${CARD}")
|
||||
|
||||
# read all of the power profiles, used to get the IDs for assignment later
|
||||
PROFILE_MODES=$(< /sys/class/drm/"${CARD}"/device/pp_power_profile_mode)
|
||||
|
||||
# get power capability; later used determine limits
|
||||
read -r -d '' POWER_CAP < "$HWMON_DIR"/power1_cap_max
|
||||
|
||||
# enable THP; profile enables the 'vm.compaction_proactiveness' sysctl
|
||||
# improves allocation latency
|
||||
echo 'always' | tee /sys/kernel/mm/transparent_hugepage/enabled
|
||||
|
||||
# export determinations
|
||||
export CARD
|
||||
export HWMON_DIR
|
||||
export PROFILE_MODES
|
||||
export POWER_CAP
|
Loading…
Add table
Add a link
Reference in a new issue