qideng7 / nfancurve

A small and lightweight Bash script for using a custom fan curve in Linux for those with an Nvidia GPU.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nfancurve

You are probably wondering why I have chosen to write this script in Bash. The reason is very simple; I wanted a script with the minimum number of dependencies possible. To get this script up-and-running you technically only need the temp.sh file, and the config file. If you don't have a certain dependency (i.e. git or procps) you can just remove the code that uses them.

The current version of the script is version 16.

This script is currently set up for Celsius. However, it can easily be modified for other temperature scales.

If you need any help configuring my script or don't know how to make it start automatically check the USAGE.md file.

Features

  • by default it has a slightly aggressive fan curve profile (lower temps, louder noise)
  • uses nvidia-settings commands
  • automatically enables/disables GPU fan control (but not CoolBits)
  • easy to read code, with plentiful comments (beginner friendly)
  • "intelligently" adjusts the time between tempurature readings
  • very lightweight
  • easy-to-use update script that uses git
  • supports multiple GPU control
  • now uses a config file that doesn't get overwritten after updates

Prerequisites

  • bash version 4 and above, or a bash-like shell with the same syntax (others untested)
  • NVIDIA GLX Driver version greater than 304
  • nvidia-settings for controlling the GPU(s)
  • coreutils for printf, etc.
  • procps in version 14 and greater - you can comment out the function check_already_running if you don't have it
  • git is needed for use of update.sh (it'll check for it when it's run)

How to install

GitHub

  • Download the .zip file straight from the GitHubs
  • Extract it somewhere, and open a terminal to that directory
  • Make sure CoolBits is enabled (see USAGE.md)
  • Run ./temp.sh for a foreground process, or ./update.sh for a background* one

git

  • Choose a folder you want to download/install the script in
  • git clone https://github.com/nan0s7/nfancurve
  • See instructions for GitHub for the rest

Arch Linux

There are unofficial AUR packages maintained by @Scrumplex.

*or just execute this command: nohup ./temp.sh >/dev/null 2>&1 &

Honourable mentions

  • @aryonoco, for being my multi-GPU guinea pig
  • @civyshk, for making a Python fork
  • @zJelly, for working on an AMD-GPU supporting fork
  • @dpayne, for adding useful script parameters
  • @Scrumplex, for adding check to avoid errors when config is missing, and maintaining the AUR package

TODO

  • make sure that "CoolBits" is enabled - not really the scope of this script
  • possibly check the currently installed driver version - earlier versions used the GPUCurrentFanSpeed command
  • add in a really detailed guide of how the script works
  • add nouveau support (once they fix Pascal)
  • add AMD support?
  • add support for GPU's that have more than one controllable fan (i.e. >1 fan controller)

About

A small and lightweight Bash script for using a custom fan curve in Linux for those with an Nvidia GPU.

License:GNU General Public License v3.0


Languages

Language:Shell 100.0%