linux下控制Nvidia显卡风扇转速
使用coolgpus脚本进行调节
pip install coolgpus
创建服务:
在/etc/systemd/system/coolgpus.service创建服务模板
sudo nano /etc/systemd/system/coolgpus.service
1 [Unit] 2 Description=Headless GPU Fan Control 3 After=syslog.target 4 5 [Service] 6 ExecStart=/home/ajones/conda/bin/coolgpus --kill --temp 20 40 50 60 70 --speed 15 30 75 75 99 7 Restart=on-failure 8 RestartSec=5s 9 ExecStop=/bin/kill -2 $MAINPID 10 KillMode=none 11 12 [Install] 13 WantedBy=multi-user.target
其中 /home/ajones/conda/bin/coolgpus 替换为实际路径,采用 which coolgpus 查看
-
--kill。You've got an X server hanging around for some reason: assuming you don't actually need it, run the script with
--kill
, which'll murder any existing X servers and let the script set up its own. Sometimes the OS might automatically recreate its X servers, and that's tricky enough to handle that it's up to you to sort out. -
--temp和--speed定义参考仓库:https://github.com/andyljones/coolgpus
可以通过如下命令进行控制
sudo systemctl enable coolgpus sudo systemctl start coolgpus sudo systemctl status coolgpus