NVIDIA Fan Controller For Linux(DIY)

Sabin Sharma
CARRE4
Published in
3 min readMay 4, 2021
Simple GUI To Control GPU Fan Speed

Linux has always been a niche in terms of overclocking. After researching for few hours, I came to a conclusion that there were very few tools available that can overclock your GPU fan speed. And those which were available were very complicated. Eventually I came up with 3 lines of code that could overclock your GPU fan speed.

First to enable overclocking (One time thing)

sudo nvidia-xconfig -a --cool-bits=28 --allow-empty-initial-configuration

Secondly enable GPU fan control to manual mode

nvidia-settings -a '[gpu:0]/GPUFanControlState=1

Lastly set the fan speed

nvidia-settings -a '[fan]/GPUTargetFanSpeed=<some number>

The above mentioned code pretty much sums up the overclocking process,But wait!!! who would like to enter 3 lines of code every-time they boot up their system. So to save time I made a simple GUI to overclock your fan.

You could try executing this code with your window manager or any display manager. In case of awesome window manager you could just append this code into your rc.lua file:

awful.spawn.with_shell("nvidia-settings -a '[fan]/GPUTargetFanSpeed=85'")

Or if you are not like me using window manager then you could save your time by using GUI. In the following step I will guide you through all the installation process.

Step 1: Clone or Download file from the link nvidia-fan-control-gui-linux

Step 2: You need to install some dependencies. I prefer anaconda for managing my packages, You can use your own preferred package manager to install the dependencies. All the dependencies are lised on requirement.txt file

Step 3: Run the program as you would run a python script

Step 4: In order to overclock you need to generate xorg.conf file mentioning the overclocking descriptions. You could just do this by clicking on Initialize Nvidia Xconfig

Before generating xorg.conf
After generating xorg.conf

After that reboot button will be enable if xorg.conf is successfully generated.If not then check your driver and ensure that nvidia-smi and nvidia-settings are available.

Step 5: Click on reboot button (note: It is mandatory to reboot)

Step 6: If everything goes well, After reboot your system interface must look something like this.

After reboot

Step 7: Now all you need is to set your desired speed

After you set your fan speed

Source code here:

Who am I?

Just a weird college scholar who admires creating strange thing. I have a blog referring to how to get initiated into DIY Python Code Analyzer , Make Your Own AI Powered Game

--

--

Sabin Sharma
CARRE4
Writer for

Life is like gradient .. learn calculate update