7

I have a headless (there isn't monitor at all) test rig for crypto mining with two graphic cards on it (GTX1060). It worked fine until update to release 17.10.

ghopper@miner:~$ uname -a
Linux miner 4.13.0-19-generic #22-Ubuntu SMP Mon Dec 4 11:58:07 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

ghopper@miner:~$ ps -ef|grep X
root      1082  1080  0 13:25 tty1     00:00:00 /usr/lib/xorg/Xorg vt1 -displayfd 3 -auth /run/user/127/gdm/Xauthority -background none -noreset -keeptty -verbose 3
ghopper   1571  1557  0 14:25 pts/0    00:00:00 grep --color=auto X


ghopper@miner:~$ xauth list
miner/unix:0  MIT-MAGIC-COOKIE-1  2386b22487fb3507bdb0a62d36c2da20


ghopper@miner:~$ echo $DISPLAY
:0


ghopper@miner:~$ cat /etc/X11/xorg.conf
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 384.90  (buildmeister@swio-display-x86-rhel47-05)  Tue Sep 19 18:13:03 PDT 2017

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    Screen      1  "Screen1" RightOf "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection

Section "Monitor"
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 1060 3GB"
    BusID          "PCI:2:0:0"
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 1060 3GB"
    BusID          "PCI:3:0:0"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "AllowEmptyInitialConfiguration" "True"
    Option         "UseDisplayDevice" "DFP-0"
    Option         "Coolbits" "31"
    Option         "ConnectedMonitor" "DFP-0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "AllowEmptyInitialConfiguration" "True"
    Option         "UseDisplayDevice" "DFP-0"
    Option         "Coolbits" "31"
    Option         "ConnectedMonitor" "DFP-0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

The cards work fine:

ghopper@miner:~$ nvidia-smi
Fri Dec  8 13:50:11 2017       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 384.90                 Driver Version: 384.90                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 106...  Off  | 00000000:02:00.0  On |                  N/A |
| 46%   75C    P2   102W / 120W |   2454MiB /  3011MiB |     99%      Default |
+-------------------------------+----------------------+----------------------+
|   1  GeForce GTX 106...  Off  | 00000000:03:00.0  On |                  N/A |
| 44%   72C    P2    97W / 120W |   2403MiB /  3013MiB |     99%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0       888      C   /home/ghopper/claymore/ethdcrminer64        2385MiB |
|    0      1082      G   /usr/lib/xorg/Xorg                            13MiB |
|    0      1118      G   /usr/bin/gnome-shell                          51MiB |
|    1       888      C   /home/ghopper/claymore/ethdcrminer64        2385MiB |
|    1      1082      G   /usr/lib/xorg/Xorg                             6MiB |
+-----------------------------------------------------------------------------+

Here is my problem: I can't use nvidia-settings tool.

ghopper@miner:~$ nvidia-settings 
Invalid MIT-MAGIC-COOKIE-1 keyUnable to init server: Could not connect: Connection refused

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

ghopper@miner:~$ xhost 
Invalid MIT-MAGIC-COOKIE-1 keyxhost:  unable to open display ":0"
ghopper@miner:~$ DISPLAY=:0 nvidia-settings 
Invalid MIT-MAGIC-COOKIE-1 keyUnable to init server: Could not connect: Connection refused

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

ghopper@miner:~$ DISPLAY=: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.

What can I do to fix it?

3
  • Is X running at all?
    – Jos
    Commented Dec 8, 2017 at 11:12
  • Yes it is. With a default xorg.conf file I cat use a monitor and mange X-server. ghopper@miner:~$ ps -ef|grep X root 1082 1080 0 13:25 tty1 00:00:00 /usr/lib/xorg/Xorg vt1 -displayfd 3 -auth /run/user/127/gdm/Xauthority -background none -noreset -keeptty -verbose 3 ghopper 1571 1557 0 14:25 pts/0 00:00:00 grep --color=auto X
    – GHopper
    Commented Dec 8, 2017 at 11:27
  • 1
    OK, this output is relevant. I think you should add it to the question.
    – Jos
    Commented Dec 8, 2017 at 11:28

2 Answers 2

2

Try this before running it

xhost +local:

The xhost program is used to add and delete host names or user names to the list allowed to make connections to the X server. The local family specifies all the local connections.

5
  • 1
    Could you please extend your answer? What it does, maybe supporting documentation.. Commented Jan 26, 2019 at 16:28
  • 1
    I am having similar troubles, but when I type xhost +local: I get Invalid MIT-MAGIC-COOKIE-1 keyxhost: unable to open display ":0" (same if I set DISPLAY to "0" "0.0" etc)
    – Lexible
    Commented Mar 23, 2019 at 18:55
  • you are entering the command in a user command line?
    – user372194
    Commented Mar 26, 2019 at 22:15
  • 1
    Just in case others come past here... @Lexible : try "export DISPLAY=:1.0" and also add local connections to the Xauthority variable/file with "xhost +local:". The first time you run you get an error, but then error will go away, as local non-network connections have been added going forward.
    – sarlacii
    Commented Nov 21, 2019 at 7:12
  • for me this worked. check here: unix.stackexchange.com/questions/659362/…. Newest installations of debian make as default easy as hostname for whatever reasons. this created a lot problems for me. check sysctl.conf, set kernel.hostname=NAME, and populate changes in bashrc adding sysctl -p --system. Also, cat .Xauthority to check what is the hostname given there. Commented Dec 31, 2023 at 14:42
-1

If you are trying to run x0vncserver on display:0 you HAVE TO BE actually logged in, before you can run any command. If this is the invisible console on a headless server - one solution I found is to automatically login at boot. Check this link:https://techpiezo.com/linux/enable-or-disable-automatic-login-in-ubuntu-20-04/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .