# amd-gpu-temp-control Monitors AMD Radeon GPU temperatures via sysfs and dynamically adjusts TDP limits using [upp](https://github.com/sibradzic/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, linearly scales TDP down via `upp` PowerPlay table modifications 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) - **upp** — Radeon PowerPlay table tool (`pipx install upp` or build from source) - **root** — required for writing PowerPlay tables ## Install ```bash sudo ./install.sh ``` Copies the script to `/usr/local/bin/amd-gpu-temp-control` and installs the systemd service. ## Uninstall ```bash sudo ./install.sh --uninstall ``` Removes the binary and service unit, stops the service. ## Configuration Default config path: `/etc/amd-gpu-temp-control.json` ```json { "minTemp": 70, "maxTemp": 80, "minTdpPercent": 10, "maxTdpPercent": 100, "tdpStepPercent": 10, "checkIntervalMs": 2000, "cmdTimeoutMs": 5000, "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) | | `cmdTimeoutMs` | 5000 | Timeout for `upp` command (ms) | | `uppPath` | `upp` | Path to the `upp` binary | ## Usage ``` node amd-gpu-temp-control.js [options] --config, -c Config file path --help, -h Show help ``` ## Service management ```bash systemctl status amd-gpu-temp-control journalctl -u amd-gpu-temp-control -f systemctl restart amd-gpu-temp-control ``` ## License MIT