nvidia-settings: unable to init server

The purpose of this system is to run a quad GPU F@H/BOINC setup as headless. My problem is that I cannot adjust the fan speeds. I am interacting with the system via SSH with PuTTY.

1: Installed Ubuntu Server 17.04. During the installation, I deselected standard system utilities, and selected OpenSSH from tasksel.

2: Upon installation, I ran the following commands:

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update; sudo apt -y full-upgrade
sudo apt install nvidia-384 xorg x11-xserver-utils xauth
sudo reboot

3: After reboot, I did:

sudo nvidia-xconfig -a --enable-all-gpus --cool-bits=28 --allow-empty-initial-configuration

This is the resulting xorg.conf.

4: I then attempted to input these commands:

sudo nvidia-settings -a [gpu:0]/GPUFanControlState=1
sudo nvidia-settings -a [gpu:0]/GPUTargetFanSpeed=100

Both give me the following message:

Unable to init server: Could not connect: Connection refused
ERROR: The control display is undefined; please run `nvidia-settings --help`for usage information.

Since Iā€™ve read that SSH causes certain issues, Iā€™ve seen some solutions where youā€™re required to use these commands instead:

DISPLAY=:0 XAUTHORITY=/var/run/lightdm/root/:0 sudo nvidia-settings -a [gpu:0]/GPUFanControlState=1
DISPLAY=:0 XAUTHORITY=/var/run/lightdm/root/:0 sudo nvidia-settings -a [gpu:0]/GPUTargetFanSpeed=100

The first command returns the following message:

Attribute 'GPUFanControlState' (hiigaran:0[gpu:0]) assigned value 1

The second command returns nothing, and no change in fan speed is heard. nvidia-smi confirms that the fan speeds remained unchanged.

I thought perhaps if SSH was still being the issue, Iā€™d create a script and let the system execute the commands itself. So I created a file called fancontrols with the following contents:

nvidia-settings -a [gpu:0]/GPUFanControlState=1
nvidia-settings -a [fan:0]/GPUTargetFanSpeed=100
nvidia-settings -a [gpu:1]/GPUFanControlState=1
nvidia-settings -a [fan:1]/GPUTargetFanSpeed=100
nvidia-settings -a [gpu:2]/GPUFanControlState=1
nvidia-settings -a [fan:2]/GPUTargetFanSpeed=100
nvidia-settings -a [gpu:3]/GPUFanControlState=1
nvidia-settings -a [fan:3]/GPUTargetFanSpeed=100

I did chmod +x and added the following line to the bottom of crontab -e:

@reboot /home/hiigaran/Scripts/fancontrols

No change after a reboot. This script works on another system with identical hardware that runs Mint with Cinnamon, so the script should be good.

Iā€™m not quite sure what to do with this. Why do I get the unable to init server message? What connection is being refused, and why? And is it related to the error about the undefined control display? I tried adding ā€˜Option ā€œUseDisplayDeviceā€ ā€œDFPā€ā€™ to one of the device sections in my xorg.conf, but it seemed to make no difference, so I removed it.

Iā€™m clueless on this one, guys. Highly unlikely itā€™s a bug, I did run the bug report script. Onlyā€¦I donā€™t know how to upload the file with a command line interface. No, Iā€™m fairly certain this is a Linux issue. Probably missing a package, or some permission problem or something along those lines. Perhaps someone might know where Iā€™m going wrong.

How can I control the speed of the fans if I do not have any window manager? Neither ligthdm nor any. I have an ubuntu server.

Iā€™am interesting in the same question: how i can control fan speed from console only (without X server)?

Not possible. Start a dummy xserver.

Hi, just want to say that your solution was right.

DISPLAY=:0 XAUTHORITY=/var/run/lightdm/root/:0 sudo nvidia-settings -a [gpu:0]/GPUFanControlState=1
DISPLAY=:0 XAUTHORITY=/var/run/lightdm/root/:0 sudo nvidia-settings -a [gpu:0]/GPUTargetFanSpeed=100

The only reason why in your case only the first command worked is because you did a mistake on the second one. If you put ā€œfan:0ā€ instaed of gpu:0 it will work. At least it worked for me.

try this:
DISPLAY=:0 XAUTHORITY=/var/run/lightdm/root/:0 sudo nvidia-settings -a [gpu:0]/GPUFanControlState=1
DISPLAY=:0 XAUTHORITY=/var/run/lightdm/root/:0 sudo nvidia-settings -a [fan:0]/GPUTargetFanSpeed=100

Thank you for the help.

1 Like