Controlling Nvidia GPU fan speed and clock speed on linux with cool-bits

User avatar
scole of TSBT
Boinc Major General
Boinc Major General
Posts: 5597
Joined: Mon Feb 03, 2014 2:38 pm
Location: Goldsboro, (Eastern) North Carolina, USA
Has thanked: 16 times
Been thanked: 29 times

#1 Controlling Nvidia GPU fan speed and clock speed on linux with cool-bits

Post by scole of TSBT »

I know setting the cool-bits option in Xorg config file has been around a while and mentioned in several other posts. This post is a nugget which will allow to set the GPU fan speed and GPU clock automatically whenever the computer restarts.

This method will only work with linux desktop installations and you must set the default user account to automatically login. I cannot find any options to control GPU fan speed on an installation without a desktop other than reflashing the GPU BIOS.

I also run Mint which is a debian variation, as is Ubuntu.

To set/enable the cool-bits options, run this from a terminal or ssh window...

Code: Select all

nvidia-xconfig --cool-bits=12
If you want to enable and mess with overvolting you can set the cool-bits option to 24.

If you have multiple GPUs run this to enable control of all GPUs...

Code: Select all

nvidia-xconfig --enable-all-gpus
After the desktop restarts you will be able to control the fan speed and clock speeding using the Nvidia X Server Settings app from the desktop. Those settings are not saved though and every time the computer restarts you must open the Nvidia X Server Settings app and set the options again. Who wants to have to do that every time, right?

You can automatically set the GPU fan speed and GPU clock speed using a script that runs after the desktop starts. Just create a script file, with all the correct permissions, and put this command in it...

Code: Select all

nvidia-settings -a "[gpu:0]/GPUFanControlState=1" -a "[fan:0]/GPUTargetFanSpeed=80"
If you have a second GPU and want to set the fan speed, put this command in also...

Code: Select all

nvidia-settings -a "[gpu:1]/GPUFanControlState=1" -a "[fan:1]/GPUTargetFanSpeed=80"
There is a GPU index on the commands so you need to figure out which GPU is 0, 1 and so on.

Those commands don't adjust the GPU clock speed though. If you also want to adjust the clock speed use this command...

Code: Select all

nvidia-settings -a "[gpu:0]/GPUFanControlState=1" -a "[fan:0]/GPUTargetFanSpeed=80" -a "[gpu:0]/GPUGraphicsClockOffset[2]=200"
If something isn't working, you can put the output in a log file like so...

Code: Select all

nvidia-settings -a "[gpu:0]/GPUFanControlState=1" -a "[fan:0]/GPUTargetFanSpeed=80" -a "[gpu:0]/GPUGraphicsClockOffset[2]=200" > /home/owner/set_gpu_fan_speed.log
Test your scripts from a terminal window first to make sure they work as expected. Once they do, configure an desktop autostart process to run that script. In Mint, you can go to Settings / Session and Startup / Application Autostart and Add an entry. Set Name, Description, command (the script like you would run from terminal window) and Trigger set to on login. Click ok and you're all set. The next time that system restarts, verify everything ran as expected and the fan speed and clock speed are set as expected.

For reference...https://wiki.archlinux.org/title/NVIDIA ... nd_cooling
These users thanked the author scole of TSBT for the post:
PecosRiverM
Rating: 11.11%
Image
User avatar
scole of TSBT
Boinc Major General
Boinc Major General
Posts: 5597
Joined: Mon Feb 03, 2014 2:38 pm
Location: Goldsboro, (Eastern) North Carolina, USA
Has thanked: 16 times
Been thanked: 29 times

#2 Re: Controlling Nvidia GPU fan speed and clock speed on linux with cool-bits

Post by scole of TSBT »

Added...
and you must set the default user account to automatically login
Image
Post Reply Previous topicNext topic

Return to “Linux”