3

Inside nvidia-settings (running with sudo elevated privileges), I am unable to get a second X Screen to work. Here is a step-by-step description of one thing I have tried:

  1. On the left, select "X Server Display Configuration"
  2. Select the secondary display (the one that goes to receiver)
  3. In the "Configuration" drop-down select "New X screen (requires X restart)"
  4. Select "Apply"
  5. When the "Cannot Apply" dialog box pops up explaining that the configuration must be saved to the X config file, select "Apply What Is Possible" (may then need to select "OK" within 15 seconds to keep changes)
  6. Select "Save to X Configuration File" and "Save"

To restart the X Server for changes to take effect, I have tried several things such as restarting the computer and restarting the X Server process via:

sudo systemctl restart display-manager

Still after many trials, only one X Screen exists. I checked the contents of the systemd journal via journalctl -e _COMM=gdm-x-session. Here is an interesting excerpt:

(II) NVIDIA(0): Validated MetaModes:
(II) NVIDIA(0):     "DP-0:nvidia-auto-select+0+0"
(II) NVIDIA(0): Virtual screen size determined to be 2560 x 1440
(--) NVIDIA(0): DPI set to (108, 107); computed from "UseEdidDpi" X config
(--) NVIDIA(0):     option
(EE) NVIDIA(G0): GeForce GTX 960 (GPU-0) already has an X screen assigned;
(EE) NVIDIA(G0):     skipping this GPU screen
(EE) NVIDIA(G0): Failing initialization of X screen

Here is a somewhat interesting excerpt:

(II) Loading sub module "glxserver_nvidia"
(II) LoadModule: "glxserver_nvidia"
(II) Loading /usr/lib64/xorg/modules/extensions/libglxserver_nvidia.so
(II) Module glxserver_nvidia: vendor="NVIDIA Corporation"
        compiled for 1.6.99.901, module version = 1.0.0
        Module class: X.Org Server Extension
(II) NVIDIA GLX Module  440.82  Wed Apr  1 19:47:36 UTC 2020
(II) NVIDIA: The X server supports PRIME Render Offload.
(WW) NVIDIA(0): Failed to initialize Base Mosaic!  Reason: Only one GPU
(WW) NVIDIA(0):     detected.  Only one GPU will be used for this X screen.

Here is a less interesting excerpt:

(II) Initializing extension GLX
(II) Indirect GLX disabled.
(II) GLX: Another vendor is already registered for screen 0

Regarding the message GeForce GTX 960 (GPU-0) already has an X screen assigned; skipping this GPU screen Failing initialization of X screen, if this is indeed the root cause, I do not understand why this was not an issue before I performed a fresh re-installation of Fedora 31. I checked /etc/X11/xorg.conf and verified that two GPU devices are currently defined - one for each X Screen in the file (albeit they point to the same physical device). Here is the entirety of /etc/X11/xorg.conf:

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 440.82

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

Section "Files"
EndSection

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

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

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Dell S2716DG"
    HorizSync       34.0 - 209.0
    VertRefresh     30.0 - 144.0
    Option         "DPMS"
EndSection

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "DENON, Ltd. DENON-AVR"
    HorizSync       30.0 - 136.0
    VertRefresh     58.0 - 121.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 960"
    BusID          "PCI:1:0:0"
    Screen          0
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 960"
    BusID          "PCI:1:0:0"
    Screen          1
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-1"
    Option         "metamodes" "DP-0: nvidia-auto-select +0+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "metamodes" "HDMI-0: nvidia-auto-select +0+0 {AllowGSYNC=Off}"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

System Information

  • Fresh installation of Fedora 31
  • One graphics card (GeForce GTX 960) with proprietary Nvidia drivers installed via Software Center from "RPM Fusion for Fedora 31 - Nonfree - NVIDIA Driver" repository
  • Two monitors connected to the graphics card
    • Main computer display via DisplayPort (goes to a Dell computer monitor)
    • Secondary display + sound output via HDMI (goes to a DENON receiver)

Question

Does anyone know how to get multiple X Screens working again? Please let me know if there is more useful technical information I can provide (relevant shell commands would be greatly appreciated).

Additional Background: Motivation for Having Two X Screens

The computer insists that any display connected to HDMI is "primary" for certain activities, regardless of which monitor is selected as the "primary display" in nvidia-settings or how things are ordered in xorg.conf. I believe this is a feature of the graphics card firmware because POST messages, the GRUB2 menu, and other low-level software always display over HDMI if connected. This is not configurable.

While running the operating system, this "default to HDMI" phenomenon causes significant issues with new windows opening on the secondary display. The new windows are not visible because the TV connected to the receiver is almost always off while the receiver itself remains on to provide sound. I learned that I could use the shift + window btn + arrow btn shortcut to bring the active window to the display of my choosing without having to turn on the TV to drag it over via the GUI; this helped slightly. Besides being annoying, sometimes a newly opened window would go unnoticed, and even worse: Some full screen applications (e.g. games) could not be moved to the correct display, or could only span both displays. This has been a major usability issue.

At some point, I was able to come up with the following solution: Create a new X Screen and assign each monitor its own X Screen. This of course only fixed the issues I was having within the operating system, but was quite a satisfactory solution. Games worked, windows would never go to the wrong display, etc.

The problem now is that after freshly installing Fedora, I have been unable to get the X Server to run two X Screens again.

2
  • I do not see ServerLayout section in your xorg.conf. Take a look here x.org/releases/X11R7.0/doc/html/DESIGN2.html.
    – nobody
    Commented Apr 22, 2020 at 6:23
  • @nobody I apologize, I had only included a portion of xorg.conf to try to reduce the amount of text. It does indeed have a ServerLayout section, which you could not have seen. I am updating the question now to include my entire xorg.conf file instead of just an excerpt. Please take another look.
    – Babak
    Commented Apr 22, 2020 at 16:20

2 Answers 2

3

After much research and experimentation (with .conf files and otherwise) I was never able to determine the root cause of this issue. I did eventually get two X Screens working again by doing a full re-installation of Fedora and being extra diligent while installing the proprietary Nvidia drivers. The issue may have been related to a nuance of the Nvidia driver installation the first time around. My best theory is I may have selected "YES" when the Nvidia driver installer prompted me to run the Xconfig utility. Unfortunately I do not remember my selection so I am not sure if this was the problem.

Below, I describe the method by which I installed the Nvidia driver this more recent time, which resulted in the expected X Screen setup behavior. The procedure includes a few of my personal preferences, which are not really related to the driver installation but are documented because I did them (those personal preferences are marked as such). Step 1 is the first thing I did after the completely fresh installation.

Proprietary Nvidia Driver Installation on Fedora GNU/Linux:

  1. sudo dnf upgrade
  2. Restart the computer sudo shutdown -r now
  3. sudo dnf install kernel-devel kernel-headers gcc make dkms acpid libglvnd-glx libglvnd-opengl libglvnd-devel pkgconfig
  4. sudo vi /etc/default/grub
    1. In the GRUB_CMDLINE_LINUX entry, remove rhgh quiet (this is my personal preference)
    2. Still in the GRUB_CMDLINE_LINUX entry, add rd.driver.blacklist=nouveau and nouveau.modeset=0
    3. After the GRUB_TIMEOUT line, add the new line "GRUB_TIMEOUT_STYLE=menu" (this is my personal preference)
    4. :wq to save and exit vi
  5. sudo grub2-editenv - unset menu_auto_hide (this is my personal preference)
  6. I have UEFI boot and am running Fedora so to regenerate my GRUB2 config I use: sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg (this is usually different for legacy boot or other distributions)
  7. Restart the computer sudo shutdown -r now (the display will be low-resolution and low-quality)
  8. sudo init 3 to switch the operating system to runlevel 3
  9. Log in at the prompt
  10. cd to directory containing the .run file downloaded from Nvidia (for me it was ~/Downloads)
  11. sudo ./NVIDIA_driver_file_name.run (may need to execute sudo chmod +x [file_name] to make it executable)
  12. When prompted, do install the DKMS and do install the 32-bit compatibility libraries
  13. When prompted, do not run the Xconfig utility
  14. Restart the computer sudo shutdown -r now
1
  • what desktop environment are you using? I've been searching for more information on getting a setup like this working. I've been successful in having two X screens up, but not successful in getting the desktop environment to support both of them. Any information you have would be incredible for me. Thanks!
    – Natolio
    Commented Apr 7, 2021 at 1:59
0

Let me give you an example of configuration file, which I am using successfully on CentOS7 and CentOS8 for two screens. They are very similar to Fedora that you are using. On previous systems (CentOS5) I used xorg.conf, but now I put this into /etc/X11/xorg.conf.d/20-nvidia-graphics.conf:

Section "ServerLayout"
    Identifier     "Default Layout"
    Screen         0 "Screen0" 0 0
    Screen         1 "Screen1" LeftOf "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

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

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

Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    Screen         1
    Option         "UseDisplayDevice" "DFP-1"
    Option         "ConnectedMonitor" "DFP-0, DFP-1"
    Option         "CustomEDID" "DFP-1:/etc/X11/ADP361.bin; DFP-0:/etc/X11/0.bin"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    Screen         0
    Option         "UseDisplayDevice" "DFP-0"
    Option         "ConnectedMonitor" "DFP-0, DFP-1"
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    DefaultDepth    24
    Option         "metamodes" "DFP-1: 1200x1920 +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    DefaultDepth    24
    Option         "metamodes" "DFP-0: 2048x2048 +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

This file creates two screens on my computers and I am even able to run different window managers on each screen. I guess you would run the same window manager on both. I think one of the tricks is to disable Xinerama, which joins all screens together.

You should tweak the configuration file until you get it right. I believe, my sample is a good start, since it works for me.

Maybe you could use read-edid to read monitors EDID and provide it in a file. In that way it does not matter what drivers thinks is connected, as it will use EDID provided from a file.

2
  • Thank you, @nobody. I will try your suggestion tonight. Do you think that CustomEDID line for Device1 is related to the problem? My xorg.conf does not mention CustomEDID anywhere. I looked up the meaning of EDID: Extended Display Identification Data. I wonder if specifying a CustomEDID will clear up the problem of (GPU-0) already has an X screen assigned ... Failing initialization of X screen.
    – Babak
    Commented Apr 22, 2020 at 16:14
  • FYI my /etc/X11/xorg.conf.d contains only one file at the moment: 00-keyboard.conf.
    – Babak
    Commented Apr 22, 2020 at 16:30

This site is temporarily in read-only mode and not accepting new answers.

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