nvidia在linux上控制风扇速度,需要起X,在无显示器链接的服务器上显得有点坑,这里汇总一下整个流程

1.nvidia-xconfig --cool-bits=4 生成xorg.conf

2.在X已启动的前提下,用nvidia-settings -q all | grep -i fan 列出关于风扇的所有属性,其中应该有 GPUFanControlState,把它设置为 1,然后再根据需要设置 GPUFanTarget,例如nvidia-settings -a [gpu:0]/GPUFanControlState=1 -a [fan:0]/GPUTargetFanSpeed=70

3.如果X没有启动,管理员权限执行 X :1 & 启动X,注意,这里:1需要根据实际情况修改,例如改为2、3。

多GPU风扇控制,参考

https://sites.google.com/site/akohlmey/random-hacks/nvidia-gpu-coolness

主要改动是针对不同GPU,修改xorg.conf Device BusID,添加CustomEDID,欺骗X链接显示器,启动不同的X,并指定环境变量DISPLAY(例如=:2、=:3),之后再执行nvidia-settings。这里提供一个xorg.conf模板

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig: version 352.39 (buildmeister@swio-display-x64-rhel04-18) Fri Aug 14 18:49:16 PDT 2015

Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"
# generated from default
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
# generated from default
Identifier "Keyboard0"
Driver "kbd"
EndSection

Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Unknown"
EndSection

Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BusID "PCI:131:0:0"
Screen 0
Option "UseDisplayDevice" "DFP-0"
Option "ConnectedMonitor" "DFP-0"
Option "CustomEDID" "DFP-0:/opt/set-gpu-fans/dfp-edid.bin"
Option "Coolbits" "5"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
Option "Coolbits" "5"
Option "UseDisplayDevice" "DFP-0"
Option "ConnectedMonitor" "DFP-0"
Option "CustomEDID" "DFP-0:/opt/set-gpu-fans/dfp-edid.bin"
SubSection "Display"
Depth 24
Modes "1024x768"
EndSubSection
EndSection

05-12 10:52