This guide creates a custom file sensor in CoolerControl to base fan curves on GPU power draw (via nvidia-smi), scaled to a fake temperature (0–100°C) for any GPU TDP. Edit TDP value in script for your GPU (e.g., 350W for RTX 3090).
- NVIDIA GPU with nvidia-smi installed.
- CoolerControl on Linux.
- Run commands as user or sudo where needed.
Create ~/gpu_power_to_temp.sh:
#!/bin/bash
TDP=350 # Edit this: Your GPU's max TDP in Watts (e.g., 450 for RTX 4090)
POWER_RAW=$(/usr/bin/nvidia-smi --query-gpu=power.draw --format=csv,noheader,nounits | head -n1)
POWER_SCALED=$(awk "BEGIN {printf \"%.0f\", $POWER_RAW * (100 / $TDP) * 1000}")
echo "$POWER_SCALED" > /tmp/gpu_power_temp- Scaling: 0W → 0 (0°C fake), TDP W → 100000 (100°C fake in millidegrees).
- Make executable:
chmod +x ~/gpu_power_to_temp.sh - Test:
~/gpu_power_to_temp.sh && cat /tmp/gpu_power_temp(should show single integer, e.g., 49000 for ~170W at 350 TDP).
Add a cron loop instead of a persistent background script.
Edit crontab:
crontab -eAdd:
* * * * * /bin/bash -c 'for i in {1..20}; do /home/yourusername/gpu_power_to_temp.sh & sleep 3; done'- Replace
/home/yourusernamewith your home path (echo $HOME). - Runs once per minute and internally loops 20× every 3 seconds (~60s).
Verify cron entry:
crontab -lCheck updates:
ls -l /tmp/gpu_power_tempThe timestamp should update about every ~3 seconds.
- Open CoolerControl UI > Settings > Custom Sensors > Add File sensor.
- File path:
/tmp/gpu_power_temp - Name: e.g., "GPU Power as Temp"
- Unit: Temperature (millidegrees Celsius).
- Save.
- Controls page > Add Profile > Graph.
- Temp Source: Select your custom sensor ("GPU Power as Temp").
- Define graph points: X-axis 0–100000 (fake °C = scaled power %), Y-axis fan % (e.g., 30000 → 40%, 70000 → 80%, 100000 → 100%).
- Apply to fan(s).
- No file: Check script paths, nvidia-smi (
which nvidia-smi), permissions. - Invalid digits: Ensure single integer output.
- Not updating: Check loop process, add logging if needed (
>> /tmp/gpu_loop_log 2>&1in loop). - Multi-GPU: Adjust
head -n1for specific GPU.