distribution/packages/sysutils/system-utils/sources/autostart/AMD64/002-overclock
fewtarius 165f994bc1
* Rework profile bits so they are correctly named and sequenced.
* Drop deprecated device.config from AMD64.
* Add a platform quirk for AMD64.x
2023-09-04 10:46:11 +00:00

49 lines
1.1 KiB
Bash

#!/bin/sh
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
# Minimal OS variable loading for performance
. /etc/profile.d/001-functions
CPU_VENDOR=$(cpu_vendor)
case ${CPU_VENDOR} in
AuthenticAMD)
tocon "Configuring system TDP..."
# If there is no defined overclock, make sure it's "off".
OVERCLOCK=$(get_setting system.overclock)
if [ -z ${OVERCLOCK} ]
then
set_setting system.overclock off
fi
/usr/bin/overclock boot
;;
GenuineIntel)
tocon "Configuring system EPP..."
###
### Enable dynamic boost.
###
if [ -f "/sys/devices/system/cpu/intel_pstate/hwp_dynamic_boost" ]
then
echo 1 >/sys/devices/system/cpu/intel_pstate/hwp_dynamic_boost
fi
###
### Energy Performance Preference isn't writeable if pstates are in
### active mode.
###
if [ -f "/sys/devices/system/cpu/intel_pstate/status" ]
then
echo passive >/sys/devices/system/cpu/intel_pstate/status
fi
EPP=$(get_setting system.power.epp)
if [ ! -z ${EPP} ]
then
/usr/bin/set_epp
fi
;;
esac