cannot run nvidia-settings headless

I think I’ve done my due diligence on this and other forums, have made a lot of progress, but I’m still stuck!

The box I am trying to finish up is running Gentoo with 4.17 kernel - needed because I am using one of the new AMD APUs. Everything is working as well as it needs to be, but I can’t get any overclocking to happen on the Titan.

I had this problem for awhile:

broccoli ~ # nvidia-settings -q all

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

Then I found that I could do this:

broccoli ~ # export DISPLAY=:0.0
broccoli ~ # export XAUTHORITY=/var/run/slim.auth

and that gets me to here:

broccoli ~ # nvidia-settings -q all

ERROR: Unable to load info from any available system



ERROR: Unable to load info from any available system

Here’s my xorg.conf:

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

Section "Files"
EndSection

Section "InputDevice"
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol"
    Option         "Device" "/dev/input/mice"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

#stuff for the AMD GPU
Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "AMD"
    Driver         "amdgpu"
    BusID          "PCI:38:0:0"
    Option         "DRI"       "3"
    Option         "TearFree"  "true"
EndSection

Section "Screen"
    Identifier      "Screen0"
    Device          "AMD"
    Monitor         "Monitor0"
    DefaultDepth    24
    SubSection      "Display"
        Depth       24
    EndSubSection
EndSection

# stuff for the Titan V
Section "Monitor"
    Identifier      "Monitor1"
    VendorName      "Unknown"
    ModelName       "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option          "DPMS"
EndSection

Section "Device"
    Identifier      "TITANV"
    Driver          "nvidia"
    BusID           "PCI:10:0:0"
    VendorName      "NVIDIA Corporation"
    Option          "AllowEmptyInitialConfiguration" "true"
    Option          "UseDisplayDevice" "none"
    Option          "Coolbits" "5"
    Option          "AllowExternalGpus" "true"
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "TITANV"
    Monitor        "Monitor1"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

I am a little confused about my Xorg.0.log. It looks like it loads everything but I’m not sure if I should see more stuff happening with the nvidia card:

[    15.717] (==) Using config file: "/etc/X11/xorg.conf"
[    15.717] (==) Using config directory: "/etc/X11/xorg.conf.d"
[    15.717] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[    15.717] (==) ServerLayout "Layout0"
[    15.717] (**) |-->Screen "Screen0" (0)
[    15.717] (**) |   |-->Monitor "Monitor0"
[    15.717] (**) |   |-->Device "AMD"
[    15.717] (**) |-->Screen "Screen1" (1)
[    15.717] (**) |   |-->Monitor "Monitor1"
[    15.717] (**) |   |-->Device "TITANV"
[    15.717] (**) |-->Input Device "Keyboard0"
[    15.717] (**) |-->Input Device "Mouse0"
[    15.717] (==) Automatically adding devices
[    15.717] (==) Automatically enabling devices
[    15.717] (==) Automatically adding GPU devices

------------

[    15.718] (II) xfree86: Adding drm device (/dev/dri/card1)
[    15.718] (II) xfree86: Adding drm device (/dev/dri/card0)
[    15.740] (--) PCI: (0:16:0:0) 10de:1d81:10de:1218 rev 161, Mem @ 0xf6000000/16777216, 0xc0000000/268435456, 0xd0000000/33554432, I/O @ 0x0000f000/128, BIOS @ 0x????????/524288
[    15.740] (--) PCI:*(0:56:0:0) 1002:15dd:1002:15dd rev 200, Mem @ 0xe0000000/268435456, 0xf0000000/2097152, 0xf7500000/524288, I/O @ 0x0000d000/256, BIOS @ 0x????????/131072
[    15.740] (II) LoadModule: "glx"
[    15.741] (II) Loading /usr/lib64/xorg/modules/extensions/libglx.so
[    15.750] (II) Module glx: vendor="X.Org Foundation"
[    15.750]    compiled for 1.19.5, module version = 1.0.0
[    15.750]    ABI class: X.Org Server Extension, version 10.0
[    15.750] (II) LoadModule: "amdgpu"
[    15.750] (II) Loading /usr/lib64/xorg/modules/drivers/amdgpu_drv.so
[    15.754] (II) Module amdgpu: vendor="X.Org Foundation"
[    15.754]    compiled for 1.19.5, module version = 18.0.1
[    15.754]    Module class: X.Org Video Driver
[    15.754]    ABI class: X.Org Video Driver, version 23.0
[    15.754] (II) LoadModule: "nvidia"
[    15.754] (II) Loading /usr/lib64/xorg/modules/drivers/nvidia_drv.so
[    15.758] (II) Module nvidia: vendor="NVIDIA Corporation"
[    15.758]    compiled for 4.0.2, module version = 1.0.0
[    15.758]    Module class: X.Org Video Driver
[    15.759] (II) AMDGPU: Driver for AMD Radeon:
    All GPUs supported by the amdgpu kernel driver
[    15.759] (II) NVIDIA dlloader X Driver  396.18  Thu Apr  5 22:35:01 PDT 2018
[    15.759] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[    15.760] (++) using VT number 7

[    15.786] (II) [KMS] Kernel modesetting enabled.
[    15.806] (**) AMDGPU(0): Depth 24, (--) framebuffer bpp 32

-------

<i><* then there is a bunch of stuff about the AMD card but nothing about nvidia until....*></i>

--------

[    16.190] (II) config/udev: Adding input device HDA NVidia HDMI/DP,pcm=3 (/dev/input/event16)
[    16.190] (II) No input driver specified, ignoring this device.
[    16.190] (II) This device may have been added with another device file.
[    16.190] (II) config/udev: Adding input device HDA NVidia HDMI/DP,pcm=7 (/dev/input/event17)
[    16.190] (II) No input driver specified, ignoring this device.
[    16.190] (II) This device may have been added with another device file.
[    16.190] (II) config/udev: Adding input device HDA NVidia HDMI/DP (/dev/input/event18)
[    16.190] (II) No input driver specified, ignoring this device.
[    16.190] (II) This device may have been added with another device file.
[    16.190] (II) config/udev: Adding input device HDA NVidia HDMI/DP (/dev/input/event19)
[    16.190] (II) No input driver specified, ignoring this device.
[    16.190] (II) This device may have been added with another device file.

Does my xorg.conf look right? I think I hit all the main points I have seen in various other posts on the subject.

I am wondering if maybe there is something I need to put into .xinitrc to get the X server attached to the GPU running fully though. It looks like the kernel modules are loaded, and then something else is supposed to happeb, that doesn’t.

Any help would be appreciated!

xorg.conf takes decimal values for busid, it should read
BusID “PCI:16:0:0”
Then the screen number on the titan is 1 not 0 so the variable has to be
DISPLAY=:0.1