Ingen beskrivning

Глухов Кирилл Викторович 1ddb5445f4 Replace upp with amd-smi for TDP control 1 månad sedan
.gitignore e28a78eee5 initial commit: amd-gpu-temp-control 1 månad sedan
README.md 1ddb5445f4 Replace upp with amd-smi for TDP control 1 månad sedan
amd-gpu-temp-control.js 1ddb5445f4 Replace upp with amd-smi for TDP control 1 månad sedan
amd-gpu-temp-control.service 1ddb5445f4 Replace upp with amd-smi for TDP control 1 månad sedan
install.sh 1ddb5445f4 Replace upp with amd-smi for TDP control 1 månad sedan

README.md

amd-gpu-temp-control

Monitors AMD Radeon GPU temperatures via sysfs and dynamically adjusts TDP limits using upp to keep temperatures within a configured range.

Supported GPUs

AMD Radeon discrete GPUs with PowerPlay table support:

  • Polaris
  • Vega
  • Radeon VII
  • Navi 10, 12, 14
  • Navi 21, 22, 23
  • Navi 3x (experimental)

Not supported: AMD APU iGPUs (different PowerPlay control methods).

How it works

  1. Reads temperature from all temp*_input sensors under /sys/class/drm/card{N}/device/hwmon/
  2. Compares against configured min/max temperature thresholds
  3. When temperature exceeds the range, scales TDP down via amd-smi
  4. When temperature drops below the range, restores TDP to maximum
  5. Changes are applied in configured step increments to avoid abrupt power shifts

Requirements

  • Node.js (v14+, for fs/child_process only — no npm packages)
  • amd-smi — AMD Software (pipx install amdgpu-tools)
  • root — required for setting power limits

Install

sudo ./install.sh

Copies the script to /usr/local/bin/amd-gpu-temp-control and installs the systemd service.

Uninstall

sudo ./install.sh --uninstall

Removes the binary and service unit, stops the service.

Configuration

Default config path: /etc/amd-gpu-temp-control.json

{
  "minTemp": 70,
  "maxTemp": 80,
  "minTdpPercent": 10,
  "maxTdpPercent": 100,
  "tdpStepPercent": 10,
  "checkIntervalMs": 2000
}
Parameter Default Description
minTemp 70 Lower temperature threshold (°C)
maxTemp 80 Upper temperature threshold (°C)
minTdpPercent 10 Minimum TDP percentage when throttling
maxTdpPercent 100 Maximum TDP percentage (full power)
tdpStepPercent 10 Maximum TDP change per cycle (%)
checkIntervalMs 2000 Temperature read interval (ms)

Usage

node amd-gpu-temp-control.js [options]

  --config, -c <path>   Config file path
  --help, -h            Show help

Service management

systemctl status amd-gpu-temp-control
journalctl -u amd-gpu-temp-control -f
systemctl restart amd-gpu-temp-control

License

MIT