Skip to content

Instantly share code, notes, and snippets.

@ihaque
ihaque / amdfan.py
Created November 29, 2011 10:43
Automatic temperature-based fan-speed control for AMD GPUs in Linux
from bisect import bisect_left
from subprocess import Popen, PIPE
from time import sleep
import numpy as np
def get_temperature(gpu=0):
lines = Popen(["aticonfig", "--adapter=%d" % gpu, "--od-gettemperature"],
stdout=PIPE).communicate()[0].split("\n")
lines = [xx.strip() for xx in lines if len(xx.strip()) > 0]
# Adapter 0 - AMD Radeon HD 6800 Series