我有一个简单的脚本,带有 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