I logged into my linux laptop via an SSH session. I issued the following command:
nvidia-settings --display :1.0 -q DitheringMode
and I got the same (expected) output that I would get if I issued that command locally from a terminal on the laptop itself. The 1:0 display indicator may be different on other systems.
For attributes that are queryable based on gpu not display, such as GPUFanControlState, I was able to do this successfully from a remote system over SSH:
I don’t know if any of this works if there is not actually a graphical X desktop running on the target machine. These did not require -Y on the ssh command.
Unable to init server: Could not connect: Connection refused
ERROR: Error resolving target specification '' (No targets match target specification), specified in query
'DitheringMode'.
On the machine where the X server is running (i.e. the target machine) try running:
xhost +
then retry the nvidia-settings command from the remote machine. And it’s quite possible that 1:0 is not the correct display indicator for your target machine.
For ease of use I added this to my .bashrc script.
fans() {
nvidia-settings --display :1.0 -a "[gpu:0]/GPUFanControlState=1" -a "[fan:0]/GPUTargetFanSpeed=$1"
echo "Fan speeds set to $1 percent"
}
Now you can just type ‘fans 100’ and voila. Adjust as needed.
Also, you could add this to a crontab to check the temp or if the gpu is training and set the fan speed accordingly.
when running nvidia-settings --display :10.0 -q [gpu:0]/GPUFanControlState
($DISPLAY=localhost:10.0 in my case) I am getting this message libEGL warning: DRI2: failed to authenticate
Did anyone face the same problem?
I don’t see why this has to be a problem that we all have. As it was said earlier in a thread, if there was just a simple nvidia-smi command, that would be great. I’m currently trying to determine what cards are dead in a server, and I would like to just use nvidia-smi to max out the fan speed on the cards that work correctly (I tried to make them all run at full load, but it was still hard to determine which was which, they all seemed around the same temp to the touch, and at full load were at 40% RPM vs 20% idle, adjacent cards were probably warming up the dead card, and idk how to map pcie bus to physical slot on the board).
ah. glad to see it helped you. while i ssh in through vscode (vscode-server), it does not create an X Server automatically. Hence, have to do some gimmicks to run a virtual x server and set that as display. Everything works fine after that.
I have not been able to find how to increase fan speeds in cli.
When I try to run the commands I get errors
root:~# nvidia-xconfig -a --cool-bits=28
Using X configuration file: "/etc/X11/xorg.conf".
WARNING: Unable to parse X.Org version string.
Backed up file '/etc/X11/xorg.conf' as '/etc/X11/xorg.conf.backup'
New X configuration file written to '/etc/X11/xorg.conf'
root:~# nvidia-settings -a '[gpu:0]/GPUFanControlState=1' -a '[fan:0]/GPUTargetFanSpeed=99'
ERROR: libgtk-3.so.0: cannot open shared object file: No such file or directory
libnvidia-gtk3.so: cannot open shared object file: No such file or directory
libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory
libnvidia-gtk2.so: cannot open shared object file: No such file or directory
ERROR: A problem occurred when loading the GUI library. Please check your installation and library path. You may need to specify this library when
calling nvidia-settings. Please run `nvidia-settings --help` for usage information.
When I run other nvidia-settings commands they do provide returns
# nvidia-settings -e list
OperatingSystem
NvidiaDriverVersion
NvControlVersion
GLXServerVersion
GLXClientVersion
...
Here is what apt shows
# apt list --installed | grep nvidia
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
nvidia-installer-cleanup/now 20151021+11 amd64 [installed,upgradable to: 20220217+3~deb12u1]
nvidia-modprobe/stable,now 535.161.07-1~deb12u1 amd64 [installed]
# dpkg -i nvidia-settings_565.57.01-1_amd64.deb
dpkg: regarding nvidia-settings_565.57.01-1_amd64.deb containing nvidia-settings, pre-dependency problem:
nvidia-settings pre-depends on nvidia-installer-cleanup
nvidia-installer-cleanup is unpacked, but has never been configured.
dpkg: error processing archive nvidia-settings_565.57.01-1_amd64.deb (--install):
pre-dependency problem - not installing nvidia-settings
Errors were encountered while processing:
nvidia-settings_565.57.01-1_amd64.deb
I see quite a few posts here but couldn’t find how to control Fan speed via terminal on a headless server, also no display monitors or any other peripherals connected, unless you have GUI or XServer installed.
The workaround works here as well, thanks! Just to summarise the commands to manually choose fan speed, could you check if the below is correct?
nvidia-settings -a GPUFanControlState=1 -a GPUTargetFanSpeed=90 # set it to 90%
nvidia-settings -a GPUFanControlState=0 # set back to system , is this correct?