暫無描述

Глухов Кирилл Викторович 3a949fed14 discover max TDP via upp, remove timeout, lower fallback to 120W 1 月之前
.gitignore e28a78eee5 initial commit: amd-gpu-temp-control 1 月之前
README.md 3a949fed14 discover max TDP via upp, remove timeout, lower fallback to 120W 1 月之前
amd-gpu-temp-control.js 3a949fed14 discover max TDP via upp, remove timeout, lower fallback to 120W 1 月之前
amd-gpu-temp-control.service e28a78eee5 initial commit: amd-gpu-temp-control 1 月之前
install.sh e28a78eee5 initial commit: amd-gpu-temp-control 1 月之前

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. Discovers actual max TDP via upp get SmallPowerLimit1 at startup (fallback: 120W)
  2. Reads temperature from all temp*_input sensors under /sys/class/drm/card{N}/device/hwmon/
  3. Compares against configured min/max temperature thresholds
  4. When temperature exceeds the range, linearly scales TDP down via upp PowerPlay table modifications
  5. When temperature drops below the range, restores TDP to maximum
  6. Changes are applied in configured step increments to avoid abrupt power shifts

Requirements

  • Node.js (v14+, for fs/child_process only — no npm packages)
  • upp — Radeon PowerPlay table tool (pipx install upp or build from source)
  • root — required for writing PowerPlay tables

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,
  "uppPath": "upp"
}
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)
uppPath upp Path to the upp binary

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