🌐
ArchWiki
wiki.archlinux.org › title › Fan_speed_control
Fan speed control - ArchWiki
4 days ago - A configuration example can be found in Gentoo:Fan speed control/thinkfan#Configuration. You can test your configuration first by running thinkfan manually (as root): ... When you have it configured correctly, start/enable thinkfan.service. The tool Lenovo Legion Linux allows to change the fan curves that are stored in the embedded controller.
management of the rotational speed of a computer fan
Computer fan control - Wikipedia
Fan control is the management of the rotational speed of an electric fan. In computers, various types of computer fans are used to provide adequate cooling, and different fan control mechanisms balance … Wikipedia
🌐
NVIDIA Developer Forums
forums.developer.nvidia.com › accelerated computing › cuda › cuda programming and performance
How to set fanspeed in Linux from terminal - CUDA Programming and Performance - NVIDIA Developer Forums
April 8, 2019 - I’m just trying to find help on how to manually set my fan speed on my Nvidia GPU. the command: nvidia-settings -a “[gpu:0]/GPUFanControlState=1” -a “[fan:0]/GPUCurrentFanSpeed=n” ...
Discussions

Heya, need a good way to control fan curve on Linux - NVIDIA
Nvidia added a better API to control fans over a year ago but no one has stepped up to modify GWE to use it. More on reddit.com
🌐 r/linux_gaming
34
3
February 26, 2024
The Simplest Way to Control Nvidia GPU Fan Speed in Linux
Stupidest? Definitely · What one really wants is a target temperature. There are two pieces I'd use here: More on news.ycombinator.com
🌐 news.ycombinator.com
6
12
June 28, 2024
Controlling fan speed of AMD gpu

You'll want to be installing Radeon Profile.

It seems to be the best tool for undervolting/overclocking/fan control of AMD cards. It's certainly the best I have used.

It operates in two parts. There is a system daemon running in the background, and a front end GUI that connects to it.

Update: I just went back and had another look at Corectrl as well, and it is pretty simple to set up fan curves in it as well (just go to the Profiles section). You won't go far wrong with either.

More on reddit.com
🌐 r/linux_gaming
12
11
July 17, 2020
How to adjust NVIDIA GPU fan speed on a headless node? - Unix & Linux Stack Exchange
You can monitor their clock speed with nvidia-smi -q or more specifically, watch 'nvidia-smi -q | grep -E "Utilization| Graphics|Power Draw"' Reboot. I haven't found another way to make the fans automatic. ... Are you able to individually control fans on each GPU this way? I've seen that EVGA 1080 Ti cards using this method only change the #1 ( of 3 fans ). Any recommendations for Linux... More on unix.stackexchange.com
🌐 unix.stackexchange.com
May 27, 2017
🌐
GitHub
github.com › foucault › nvfancontrol
GitHub - foucault/nvfancontrol: NVidia dynamic fan control for Linux and Windows · GitHub
Nvfancontrol provides dynamic fan control for NVidia graphic cards on Linux and Windows. Sometimes it is desirable to control the fan speed of the graphics card using a custom response curve instead of the automatic setting that is built into ...
Starred by 236 users
Forked by 19 users
Languages   Rust
Top answer
1 of 10
26

In the terminal run:

sudo nvidia-xconfig
sudo nvidia-xconfig --cool-bits=4

restart your computer and search for NVIDIA X Server Settings in the Dash. There should be an option to change fan speed under Thermal Settings.

2 of 10
8

To control Nvidia GPU fan speed via Terminal on Linux Mint 20 with a 1070 Ti:

sudo nvidia-xconfig --cool-bits=4

to tell nvidia-xconfig to allow the fan to be controlled in the command line. You may need to reboot here.

nvidia-smi

Gives information about the GPU(s) and their numbers. Importantly I note that my 1070 Ti is GPU 0.

nvidia-settings -a "[gpu:0]/GPUFanControlState=1" -a "[fan:0]/GPUTargetFanSpeed=55"

For a much more detailed overview of this feature including multiple GPU fans, check out this thorough documentation Nvidia Overclocking and Cooling

For a somewhat rambling and wayward thread which lead me to the above link, check out Set Fanspeed in Linux from Terminal

==================END OF ANSWER==================

And as an extra tidbit not asked for in this question, you can also adjust the power output of your Nvidia GPU with:

sudo nvidia-smi -i 0 -pl 90

Where the 0 is my GPU number, and the 90 is the maximum power in watts. If you set this too low, you will get an error. In my limited experience, setting it too high had no effect. I found I can get 95%+ performance for ~75% energy cost by setting the power level to 100 in the above command in my mining rig, but I imagine other power conscious users would appreciate this too.

🌐
Reddit
reddit.com › r/linux_gaming › heya, need a good way to control fan curve on linux - nvidia
r/linux_gaming on Reddit: Heya, need a good way to control fan curve on Linux - NVIDIA
February 26, 2024 -

So, let me summarize to a lot of you.

my GPU is a 1660 Super, and since NVIDIA has a lot of problems on Linux I tend to try and find solutions and alternatives, but nothing seems to get to fix it.

I want to set a fan curve for my GPU, and Green With Envy sadly seems to just never work.

Even after setting the optimal settings, and enabling coolbits, it still refuses to work no matter what. If there is some kind of way to control fans for GPU fans on Linux, I would be very glad and it would help me a lot.

NVIDIA in general is still awful on Linux from my point of view, but i'm hoping those kinds of things will improve in the future.

🌐
Hacker News
news.ycombinator.com › item
The Simplest Way to Control Nvidia GPU Fan Speed in Linux | Hacker News
June 28, 2024 - Stupidest? Definitely · What one really wants is a target temperature. There are two pieces I'd use here:
🌐
nixCraft
cyberciti.biz › nixcraft › howto › centos › how to find fan speed in linux for cpu and gpu
How to find fan speed in Linux for CPU and GPU - nixCraft
September 12, 2024 - Explains how to monitor CPU/GPU temprature and fan speed in Linux using sensors command and GUI tools such as psensor, xsensors for GNOME/KDE/MATE desktop.
Find elsewhere
🌐
Medium
closex.medium.com › the-simplest-linux-nvidia-gpu-fan-speed-control-tutorial-8d641e9efdff
The Simplest Linux NVIDIA GPU Fan Speed Control Tutorial | by CloseX | Medium
June 28, 2024 - With everything set up, all you need to do is run the following command to start controlling the fan speed: ... x@x:~$ ./fan.sh [sudo] password for x: ============================================================ Driver Version: 535.183.01 GPU 0: NVIDIA GeForce RTX 2080 Ti Fan Count: 1 ============================================================ Temperature: 42°C Total Curve Point: 4 Current Curve Point: 2 Previous_Curve_Point: 1 Fan_Speed: 45% ============================================================ Temperature_Delta: 17 Fan_Speed_Delta: 40 Temperature_Increment: 2 Fan_Speed_Increment: 4.705882352941177 Previous_Temperature: 42°C Step_Down_Temperature: 37 ============================================================
🌐
Reddit
reddit.com › r/linux_gaming › controlling fan speed of amd gpu
r/linux_gaming on Reddit: Controlling fan speed of AMD gpu
July 17, 2020 -

Hi Folks,

I am very new to Linux and try to control my gpu fan speed like I do with Afterburner on Windows.

I installed fancontrol and lm-sensors via the terminal and used "sudo pmwconfig", but am unsure how to proceed.

I get:

"This program will search your sensors for pulse width modulation (pwm)

controls, and test each one to see if it controls a fan on

your motherboard. Note that many motherboards do not have pwm

circuitry installed, even if your sensor chip supports pwm.

We will attempt to briefly stop each fan using the pwm controls.

The program will attempt to restore each fan to full speed

after testing. However, it is ** very important ** that you

physically verify that the fans have been to full speed

after the program has completed.

Found the following devices:

hwmon0 is k10temp

hwmon1 is asus

hwmon2 is amdgpu

Found the following PWM controls:

hwmon2/pwm1 current value: 104

hwmon2/pwm1 is currently setup for automatic speed control.

In general, automatic mode is preferred over manual mode, as

it is more efficient and it reacts faster. Are you sure that

you want to setup this output for manual control? (n)"

How do I now actually create a speed curve for hwmon2? Does the system know which temp sensor belongs to hwmon2?

- I don't want to proceed without a plan, fearing I deactivate the automatic mode and can't compensate it. I read that at some point a config is created, which (for the gpu fan) would be nice

- i don't want to interfere with the cpu fans, as I control them via BIOS and am very happy with it

Thank you very much!

Edit: I just noticed this sub may be not perfectly fitting for this kind of question, sorry. This happens me all the time...

🌐
Medium
medium.com › carre4 › nvidia-fan-controller-for-linux-diy-2b6173176c8f
NVIDIA Fan Controller For Linux(DIY) | by Sabin Sharma | CARRE4 | Medium
May 4, 2021 - 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
🌐
Techticity
techticity.com › howto › how-to-control-nvidia-graphics-card-fan-speed-in-linux
How to control Nvidia graphics card Fan Speed Automatically in Linux – Techticity
September 19, 2018 - The reference sheet is available at http://download.nvidia.com/XFree86/Linux-… But it’s recommended to keep it at 28 to enable all the features. After this, a reboot or a logout is required to apply the changes. After the reboot/login, open the NVIDIA X Server Settings application · Go to the ‘Thermal Settings’ section and you can control the fan speed by your own hands:
🌐
CloseX
blog.closex.org › posts › 26a7c6ee
The Simplest Linux NVIDIA GPU Fan Speed Control Tutorial | CloseX
July 29, 2024 - Learn the simplest method to control NVIDIA GPU fan speed on Linux via SSH, ensuring optimal performance without a graphical interface.
🌐
GitHub
github.com › vandabbin › nvidia-fan-control-linux
GitHub - vandabbin/nvidia-fan-control-linux: Fan Curve Control Script for Nvidia GPUs on Linux · GitHub
This script allows directly setting fan speed on Nvidia GPUs either manually or with a "fan curve". Supports Day and Night fan curves · While the default fan curve settings will work, you may want to customize them to meet your needs or preferences. Add a line to cron like this to enable automatic fan control...
Starred by 43 users
Forked by 8 users
Languages   Shell 96.6% | Makefile 3.4%
🌐
UbuntuHandbook
ubuntuhandbook.org › home › howtos › control gpu/cpu fan speed with coolercontrol in ubuntu 24.04
Control GPU/CPU Fan Speed with CoolerControl in Ubuntu 24.04 | UbuntuHandbook
It depends on Hwmon kernel drivers ... as well as most NVIDIA and AMD GPUs. ... With CoolerControl, you can monitor the temperatures of your CPU, GPU, hard disk, etc devices in graphs, and set fan to either fixed or dynamic speed....
🌐
Linux Mint Forums
forums.linuxmint.com › board index › main edition support › beginner questions
How can i control my Nvidia gpu fans? - Linux Mint Forums
May 1, 2021 - ... Have a look at these two links: ... show you how to ensure Nvidia software has the fan control enabled (scroll down to the bit about: "sudo nvidia-xconfig --cool-bits=4") so you can actually have control over the fan settings....
🌐
GitHub
github.com › KristianHolsheimer › nvidia-fan-controller
GitHub - KristianHolsheimer/nvidia-fan-controller: Nvidia GPU Fan Controller for linux · GitHub
A simple standalone python script to keep your Nvidia GPUs below a given temperature, e.g. python3 nvidia_fan_controller.py --target-temperature 60 · This script uses a simple PID-controller to regulate the fan speed.
Starred by 15 users
Forked by 9 users
Languages   Python
🌐
Medium
medium.com › @s1ddok › control-your-gpu-fan-speeds-while-connecting-to-your-machine-via-ssh-e01895b8909e
Control your GPU fan speeds while connecting to your machine via SSH | by Andrey Volodin | Medium
October 14, 2022 - NVIDIA has nvidia-settings console app which technically allows you to set any GPU settings using terminal. I started googling on how to set the fan speed for individual GPU using that. First of all, you have to set a bitmask that will allow controlling cooling settings:
🌐
Ideanist
ideanist.com › 2017 › 07 › 29 › control-nvidia-fan-speed-linux-ubuntu-16
Control NVIDIA GPU Fan Speed on Linux Ubuntu 16.04 – ideanist.com
To adjust the fan speed during operation of the system you can use from a remote terminal, e.g. sudo env DISPLAY=:1 nvidia-settings -a [gpu:0]/GPUFanControlState=1 -a [fan-0]/GPUTargetFanSpeed=89 ... Interesting! ... This script worked like a charm while controlling the fan speed, but it also ...
Top answer
1 of 3
11

The following is a simple method that does not require scripting, connecting fake monitors, or fiddling and can be executed over SSH to control multiple NVIDIA GPUs' fans. It has been tested on Arch Linux.

Create xorg.conf

sudo nvidia-xconfig --allow-empty-initial-configuration --enable-all-gpus --cool-bits=7

This will create an /etc/X11/xorg.conf with an entry for each GPU, similar to the manual method.

Note: Some distributions (Fedora, CentOS, Manjaro) have additional config files (eg in /etc/X11/xorg.conf.d/ or /usr/share/X11/xorg.conf.d/), which override xorg.conf and set AllowNVIDIAGPUScreens. This option is not compatible with this guide. The extra config files should be modified or deleted. The X11 log file shows which config files have been loaded.

Alternative: Create xorg.conf manually

Identify your cards' PCI IDs:

nvidia-xconfig --query-gpu-info

Find the PCI BusID fields. Note that these are not the same as the bus IDs reported in the kernel.

Alternatively, do sudo startx, open /var/log/Xorg.0.log (or whatever location startX lists in its output under the line "Log file:"), and look for the line NVIDIA(0): Valid display device(s) on GPU-<GPU number> at PCI:<PCI ID>.

Edit /etc/X11/xorg.conf

Here is an example of xorg.conf for a three-GPU machine:

Section "ServerLayout"
        Identifier "dual"
        Screen 0 "Screen0"
        Screen 1 "Screen1" RightOf "Screen0"
        Screen 1 "Screen2" RightOf "Screen1"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BusID          "PCI:5:0:0"
    Option         "Coolbits"       "7"
    Option         "AllowEmptyInitialConfiguration"
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BusID          "PCI:6:0:0"
    Option         "Coolbits"       "7"
    Option         "AllowEmptyInitialConfiguration"
EndSection

Section "Device"
    Identifier     "Device2"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BusID          "PCI:9:0:0"
    Option         "Coolbits"       "7"
    Option         "AllowEmptyInitialConfiguration"
EndSection

Section "Screen"
        Identifier     "Screen0"
        Device         "Device0"
EndSection

Section "Screen"
        Identifier     "Screen1"
        Device         "Device1"
EndSection

Section "Screen"
        Identifier     "Screen2"
        Device         "Device2"
EndSection

The BusID must match the bus IDs we identified in the previous step. The option AllowEmptyInitialConfiguration allows X to start even if no monitor is connected. The option Coolbits allows fans to be controlled. It can also allow overclocking.

Note: Some distributions (Fedora, CentOS, Manjaro) have additional config files (eg in /etc/X11/xorg.conf.d/ or /usr/share/X11/xorg.conf.d/), which override xorg.conf and set AllowNVIDIAGPUScreens. This option is not compatible with this guide. The extra config files should be modified or deleted. The X11 log file shows which config files have been loaded.

Edit /root/.xinitrc

nvidia-settings -q fans
nvidia-settings -a [gpu:0]/GPUFanControlState=1 -a [fan:0]/GPUTargetFanSpeed=75
nvidia-settings -a [gpu:1]/GPUFanControlState=1 -a [fan:1]/GPUTargetFanSpeed=75
nvidia-settings -a [gpu:2]/GPUFanControlState=1 -a [fan:2]/GPUTargetFanSpeed=75

I use .xinitrc to execute nvidia-settings for convenience, although there's probably other ways. The first line will print out every GPU fan in the system. Here, I set the fans to 75%.

Launch X

sudo startx -- :0

You can execute this command from SSH. The output will be:

Current version of pixman: 0.34.0
    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Sat May 27 02:22:08 2017
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"

  Attribute 'GPUFanControlState' (pushistik:0[gpu:0]) assigned value 1.

  Attribute 'GPUTargetFanSpeed' (pushistik:0[fan:0]) assigned value 75.


  Attribute 'GPUFanControlState' (pushistik:0[gpu:1]) assigned value 1.

  Attribute 'GPUTargetFanSpeed' (pushistik:0[fan:1]) assigned value 75.


  Attribute 'GPUFanControlState' (pushistik:0[gpu:2]) assigned value 1.

  Attribute 'GPUTargetFanSpeed' (pushistik:0[fan:2]) assigned value 75.

Monitor temperatures and clock speeds

nvidia-smi and nvtop can be used to observe temperatures and power draw. Lower temperatures will allow the card to clock higher and increase its power draw. You can use sudo nvidia-smi -pl 150 to limit power draw and keep the cards cool, or use sudo nvidia-smi -pl 300 to let them overclock. My 1080 Ti runs at 1480 MHz if given 150W, and over 1800 MHz if given 300W, but this depends on the workload. You can monitor their clock speed with nvidia-smi -q or more specifically, watch 'nvidia-smi -q | grep -E "Utilization| Graphics|Power Draw"'

Returning to automatic fan management.

Reboot. I haven't found another way to make the fans automatic.

2 of 3
5

I've written a pip-installable Python script to do something similar to @AlexsandrDubinsky's suggestion.

When you run fans.py, it sets up a temporary X server for each GPU with a fake display attached. Then, it loops over the GPUs every few seconds and sets the fan speed according to their temperature. When the script dies, it returns control of the fans to the drivers and cleans up the X servers.

🌐
GitHub
github.com › andyljones › coolgpus
GitHub - andyljones/coolgpus: GPU fan control for headless Linux · GitHub
Now the fan speed will be 5% at <20C, then increase linearly to 30% up to 55C, then again linearly to 99% up to 80C. If your system uses systemd and you want to run this as a service, create a systemd unit file at /etc/systemd/system/coolgpus.service as per this template: [Unit] Description=Headless GPU Fan Control After=syslog.target [Service] ExecStart=/home/ajones/conda/bin/coolgpus --kill Restart=on-failure RestartSec=5s ExecStop=/bin/kill -2 $MAINPID KillMode=none [Install] WantedBy=multi-user.target
Starred by 349 users
Forked by 46 users
Languages   Python