![Ubuntu 17.04 nvidia-settings,如何从 sshd 运行?](https://linux22.com/image/1001742/Ubuntu%2017.04%20nvidia-settings%EF%BC%8C%E5%A6%82%E4%BD%95%E4%BB%8E%20sshd%20%E8%BF%90%E8%A1%8C%EF%BC%9F.png)
我有一个简单的脚本,带有 GPU 设置:
#!/bin/bash
#nvidia-settings -a '[gpu:0]/GPUGraphicsMemoryOffset[3]=850'
nvidia-settings -a '[gpu:0]/GPUMemoryTransferRateOffset[3]=1900'
nvidia-settings -a '[gpu:0]/GPUFanControlState=1'
nvidia-settings -a '[fan:0]/GPUTargetFanSpeed=80'
但我无法ssh
通过 crontab 运行此脚本。这些设置仅在实际屏幕/显示器上有效。
当我远程运行它时,出现以下错误:
$ ./gpu0.sh
Unable to init server: Could not connect: Connection refused
ERROR: The control display is undefined; please run `nvidia-settings --help` for usage information.
Unable to init server: Could not connect: Connection refused
ERROR: The control display is undefined; please run `nvidia-settings --help` for usage information.
Unable to init server: Could not connect: Connection refused
ERROR: The control display is undefined; please run `nvidia-settings --help` for usage information.
我该如何解决这个问题?
答案1
首先运行这个:
export DISPLAY=:0.0