Keep GPU and CPU temperatures within given limit.
With it you no longer have to worry about hardware heating up when running long time tasks, especially for your cheap GTX1660, P106 and P104 GPU cards.
You can use the command line tool sustainer
:
sustainer # default target is 'all', so both cpu and gpu stats will be sustained
python3 -m sustainer # alternative syntax
# to specify only cpu or gpu as target
sustainer --target cpu
sustainer --target gpu
# changing default configuration:
env TARGET_TEMP=60 sustainer # default: 65
env MAX_POWER_LIMIT_RATIO=0.7 sustainer # default: 0.8
env MAX_FREQ_RATIO=0.7 sustainer # default: 0.8
Optionally run with a process manager such as pm2 to persist as daemon:
pm2 start -n sustainer_daemon sustainer
pm2 save
If you want to call it with code, check out the test files.
First, install from PyPI:
pip install sustainer
Then, install the following binaries:
# Ubuntu
sudo apt install -y cpufrequtils lm-sensors
# Debian
sudo apt install -y linux-cpupower lm-sensors
For NVIDIA GPU, you need to install related drivers and make sure nvidia-smi
is in PATH.
For AMD GPU, install ROCm drivers and make sure rocm-smi
is in PATH.
CPU: Intel, AMD, ARM
GPU: NVIDIA, AMD
Linux only currently.