Skip to content

Instantly share code, notes, and snippets.

View ba2512005's full-sized avatar

Mohammad Anwar ba2512005

View GitHub Profile
@AlexKordic
AlexKordic / gpu_fan.py
Created March 22, 2024 17:36
Script to control nvidia GPU fan speed.
import pynvml, time
from pynvml import *
TEMP_MIN_VALUE = 30.0 # fan is around 30%
TEMP_MAX_VALUE = 65.0 # fan is at 100% onwards
TEMP_RANGE = TEMP_MAX_VALUE - TEMP_MIN_VALUE
def fanspeed_from_t(t):
if t <= TEMP_MIN_VALUE: return 0.0
if t >= TEMP_MAX_VALUE: return 1.0
return (t - TEMP_MIN_VALUE) / TEMP_RANGE
@goodjob1114
goodjob1114 / cool_gpu2.sh
Created December 11, 2017 06:39 — forked from squadbox/cool_gpu2.sh
A script to control Nvidia GPU fan speed on headless (non-X) linux nodes
#!/bin/bash
# cool_gpu2.sh This script will enable or disable fixed gpu fan speed
#
# Description: A script to control GPU fan speed on headless (non-X) linux nodes
# Original Script by Axel Kohlmeyer <[email protected]>
# https://sites.google.com/site/akohlmey/random-hacks/nvidia-gpu-coolness
#
# Modified for newer drivers and removed old work-arounds