Heya, need a good way to control fan curve on Linux - NVIDIA
The Simplest Way to Control Nvidia GPU Fan Speed in Linux
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.comHow to adjust NVIDIA GPU fan speed on a headless node? - Unix & Linux Stack Exchange
Videos
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.
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.
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.
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...
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.
I think corectrl will do what you want. Probably in your repo. I'm not an AMD GPU guy but I remember reading about this a while back thinking it was cool.
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.
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.