How to change GPU fan settings on Ubuntu Server 18.04?

I have a GTX1080ti in a Ubuntu Server Edition 18.04 under my desk. When I train my neural network the fan stays off most of the time but bursts to full speed for a few seconds every 30 seconds or so. My coworkers have informed me in no uncertain terms that it would be preferable if the fan could continuously at a lower speed so I am trying to adjust the GPU fan settings. (They have also requested to management that my machine be moved to a closet somewhere to no avail, apparently that would constitute me getting special treatment.) I am very confident that I can cool the GPU by running the fan consistently at a lower speed as all my coworkers computers do this already running similar workloads on similar machines.

I tried installing nvclock and got the following error.

[sudo] password for brian:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package nvclock```

I tried using nvidia-settings a la and get the following error.
```sudo nvidia-settings -a "[gpu:0]/GPUFanControlState=1" -a "[fan:0]/GPUTargetFanSpeed=50"
Unable to init server: Could not connect: Connection refused```

From what I have read I need to somehow set the display and xauthority but the suggestion of running `ps a |grep X` doesn't find anything for me.

Any suggestions?

On the Ubuntu forums, someone suggested the following for Ubuntu 17.04. Maybe this still works for Ubuntu 18.04?

cd /etc/X11
sudo nvidia-xconfig --enable-all-gpus
nvidia-xconfig --cool-bits=4

There is also an answer for Ubuntu 18.04 on Super User Stack Exchange: