Skip to content

Instantly share code, notes, and snippets.

@doggeddalle
Last active March 10, 2026 09:27
Show Gist options
  • Select an option

  • Save doggeddalle/001f7fa7ded6f73d2ac6a2c69758f7c8 to your computer and use it in GitHub Desktop.

Select an option

Save doggeddalle/001f7fa7ded6f73d2ac6a2c69758f7c8 to your computer and use it in GitHub Desktop.
coolercontrol graph by gpu wattage - [cheat edition if you cannot be bothered getting vram temps, needs testing]

Guide: Custom Fan Profile in CoolerControl Based on GPU Power (Watts)

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).

Prerequisites

  • NVIDIA GPU with nvidia-smi installed.
  • CoolerControl on Linux.
  • Run commands as user or sudo where needed.

Step 1: Create Power-to-Temp Script

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).

Step 2: Run Script Periodically (Every ~3s)

Add a cron loop instead of a persistent background script.

Edit crontab:

crontab -e

Add:

* * * * * /bin/bash -c 'for i in {1..20}; do /home/yourusername/gpu_power_to_temp.sh & sleep 3; done'
  • Replace /home/yourusername with your home path (echo $HOME).
  • Runs once per minute and internally loops 20× every 3 seconds (~60s).

Verify cron entry:

crontab -l

Check updates:

ls -l /tmp/gpu_power_temp

The timestamp should update about every ~3 seconds.

Step 3: Add Custom Sensor in CoolerControl

  1. Open CoolerControl UI > Settings > Custom Sensors > Add File sensor.
  2. File path: /tmp/gpu_power_temp
  3. Name: e.g., "GPU Power as Temp"
  4. Unit: Temperature (millidegrees Celsius).
  5. Save.

Step 4: Create Fan Profile

  1. Controls page > Add Profile > Graph.
  2. Temp Source: Select your custom sensor ("GPU Power as Temp").
  3. Define graph points: X-axis 0–100000 (fake °C = scaled power %), Y-axis fan % (e.g., 30000 → 40%, 70000 → 80%, 100000 → 100%).
  4. Apply to fan(s).

Troubleshooting

  • 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>&1 in loop).
  • Multi-GPU: Adjust head -n1 for specific GPU.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment