Skip to content

Instantly share code, notes, and snippets.

@taras-sereda
Created November 8, 2024 22:15
Show Gist options
  • Save taras-sereda/15d1afb127a332721e008950574b972d to your computer and use it in GitHub Desktop.
Save taras-sereda/15d1afb127a332721e008950574b972d to your computer and use it in GitHub Desktop.
NVIDIA fan control from command line
#!/bin/bash
set -eo pipefail
FAN_SPEED=$1
DISPLAY=:1
startx -- ${DISPLAY} &
sleep 1
nvidia-settings -c ${DISPLAY} -a GPUFanControlState=1 -a GPUTargetFanSpeed=${FAN_SPEED}
killall Xorg
exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment