Nvidia-settings not Working on Ubuntu 20.04.2

Any Help please

Try
DISPLAY=:0.1 nvidia-settings
or
DISPLAY=:1.1 nvidia-settings

@Generix , i tried your suggestion but i get this error

# sudo DISPLAY=:0.1 nvidia-settings
No protocol specified
Unable to init server: Could not connect: Connection refused

ERROR: The control display is undefined; please run nvidia-settings --help for usage information.

# sudo DISPLAY=:1.1 nvidia-settings
Unable to init server: Could not connect: Connection refused

ERROR: The control display is undefined; please run nvidia-settings --help for usage information.

# DISPLAY=:0.1 nvidia-settings
No protocol specified
Unable to init server: Could not connect: Connection refused

ERROR: The control display is undefined; please run nvidia-settings --help for usage information.

# DISPLAY=:1.1 nvidia-settings
Unable to init server: Could not connect: Connection refused

ERROR: The control display is undefined; please run nvidia-settings --help for usage information.

Are you running this over ssh or from desktop?

I am logging on to the server remotely using xRDP on the server and Windows RDP on my laptop. i am able to login fine and run nvidia-smi with no issues. but when i launch nvidia-settings it opens up a small empty window with the error i posted above

With SSH , i presume that it does not work.

To make sure it was not a permission issue i logged in as root.

xrdp is a virtual xserver running in software. nvidia-settings has to connect to the real xserver running on the nvidia gpu and the user has to have access to it.
So on another xserver you can’t use the gui, only cli, see
https://forums.developer.nvidia.com/t/tuning-nvidia-settings-over-ssh-error/60673/6?u=generix

Addendum: maybe the gui can be used by using the -c option, IDK.

Yes i have an actual full blown X-Server running on the Server itself . I just use xRDP for remote connection in order to do some work on the server or sometimes use SSH.

i tried it but here is what i get :

# ps a |grep X
2329 tty1 Sl+ 0:05 /usr/lib/xorg/Xorg vt1 -displayfd 3 -auth /run/user/124/gdm/Xauthority -background none -noreset -keeptty -verbose 3
9745 pts/0 S+ 0:00 grep --color=auto X

~# sudo -s DISPLAY=:0 XAUTHORITY=/run/user/124/gdm/Xauthority nvidia-settings
libEGL warning: DRI2: failed to authenticate

(nvidia-settings:9747): GLib-GObject-CRITICAL **: 18:05:36.355: g_object_unref: assertion ‘G_IS_OBJECT (object)’ failed
libEGL warning: DRI2: failed to authenticate
** Message: 18:05:38.194: PRIME: No offloading required. Abort
** Message: 18:05:38.194: PRIME: is it supported? no

Now the gui will show up on the gdm screen. Use cli commands.

Run the same commands above when connected using xRDP or SSH and i am still getting the same errors

SSH:

# ps a |grep X
2329 tty1 Sl+ 0:06 /usr/lib/xorg/Xorg vt1 -displayfd 3 -auth /run/user/124/gdm/Xauthority -background none -noreset -keeptty -verbose 3
10064 pts/2 S+ 0:00 grep --color=auto X

# sudo -s DISPLAY=:0 XAUTHORITY=/run/user/124/gdm/Xauthority nvidia-settings
libEGL warning: DRI2: failed to authenticate

(nvidia-settings:10066): GLib-GObject-CRITICAL **: 19:27:02.822: g_object_unref: assertion ‘G_IS_OBJECT (object)’ failed
libEGL warning: DRI2: failed to authenticate
** Message: 19:27:04.691: PRIME: No offloading required. Abort
** Message: 19:27:04.691: PRIME: is it supported? no

when using xRDP :

# ps a |grep X
2329 tty1 Sl+ 0:06 /usr/lib/xorg/Xorg vt1 -displayfd 3 -auth /run/user/124/gdm/Xauthority -background none -noreset -keeptty -verbose 3
10160 pts/0 S+ 0:00 grep --color=auto X

# sudo -s DISPLAY=:0 XAUTHORITY=/run/user/124/gdm/Xauthority nvidia-settings
libEGL warning: DRI2: failed to authenticate

(nvidia-settings:10162): GLib-GObject-CRITICAL **: 19:30:46.931: g_object_unref: assertion ‘G_IS_OBJECT (object)’ failed
libEGL warning: DRI2: failed to authenticate
** Message: 19:30:48.716: PRIME: No offloading required. Abort
** Message: 19:30:48.716: PRIME: is it supported? no

Nvidia Drivers is such $%^#&*#^^# pain to install or update in UBUNTU or Linux Distro. Its almost as if Nvidia is deliberately sabotaging their cards everytime. There is no chance you will have a clean Nvidia Drivers installation no matter the case. There is always something breaking. Nvidia understands they are NOT the only GPU cards available to users or business and at some point developers or users or business will rebel against issue after issue on their driver installation. Then if you try to get help from NVIDIA customer service , you’re completely out of luck. That’s where fingerpointing starts . They point to the ubuntu OS ( or any Linux Distro) and the OS guys point back while the customers are getting frustrated. SOLVE THIS ISSUE OF DRIVERS PLEASE , we are tired as customers and enough is enough