I know this is an old thread, but it's one of the top search results for the issue of running nvidia-settings over ssh and maybe this is useful for people from the future.
If you just need to run the command-line
nvidia-settings tool (e.g., to display information that
nvidia-smi hides for certain GPUs) and you have root access to the remote machine, you can override the
DISPLAY variable to
:0. The remote X server will then give you an error
Invalid MIT-MAGIC-COOKIE-1 key, because no matter whether you have root access or not, you need a valid xauth magic cookie. Luckily, even if nobody is logged in at the machine, the login screen (e.g., lightdm) will have such a magic cookie. You can try to find it with
ps aux | grep auth. For lightdm, it is placed at
/var/run/lightdm/root/:0. As root, you can hijack this cookie by setting the
XAUTHORITY variable to it. Put together, the following should display the GPU, memory bandwidth and PCIe bandwidth utilization when logging in to a remote server with ssh (and no X-forwarding):
sudo DISPLAY=:0 XAUTHORITY=/var/run/lightdm/root/:0 nvidia-settings -t -q GPUUtilization
For a somewhat tidier output, you can try
https://devtalk.nvidia.com/default/t...not-supported/, also overriding
DISPLAY and
XAUTHORITY as shown above.