以下是一种简单的方法,不需要编写脚本,连接假显示器或摆弄,可以通过SSH执行以控制多个NVIDIA GPU的风扇。它已在Arch Linux上进行了测试。
识别卡的PCI ID:
编辑:我现在不确定什么是最好的方法。以前,我建议过lspci -k | grep -A 2 -E "(VGA|3D)"。但是,这在我的新Threadripper系统上没有提供正确的ID。
有效的方法是sudo startx打开/var/log/Xorg.0.log(或startX在其输出中在“日志文件:”行下列出的任何位置),然后寻找该行NVIDIA(0): Valid display device(s) on GPU- at PCI:。
编辑 /etc/X11/xorg.conf
这是一个三GPU机器的示例:
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
该BusID咄咄在上一步中确定的PCI ID匹配。AllowEmptyInitialConfiguration即使未连接监视器,该选项也允许X启动。该选件Coolbits可以控制风扇。它还可以允许超频,但这未经我测试。
编辑 /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
cat
为了方便起见,我使用.xinitrc执行nvidia设置,尽管可能还有其他方法。在这里,我将粉丝人数设置为75%。我阻止X服务器使用空cat命令关闭。这不是严格必要的,但是我发现有时候X卡关闭时,卡会拒绝离开P8低功耗状态,这会给我带来麻烦。第一行将打印出系统中的每个GPU风扇。
启动X
sudo startx -- :0
您可以从SSH执行此命令。输出将是:
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.
监控温度和时钟速度
nvidia-smi可用于观察温度和功率消耗。较低的温度将使该卡具有更高的时钟频率并增加其功耗。您可以sudo nvidia-smi -pl 150用来限制功耗并保持显卡散热,也可以sudo nvidia-smi -pl 300用来使其超频。如果给定150W,我的1080 Ti将以1480 MHz运行,如果给定300W,则将在1800 MHz以上运行,但这取决于工作负载。您可以使用以下命令nvidia-smi -q或更具体地监控其时钟速度,watch 'nvidia-smi -q | grep -E "Utilization| Graphics|Power Draw"'
返回自动风扇管理。
重启。我还没有找到另一种使风扇自动运转的方法。