title: Dual GPU configuration on Ubuntu 16.04
body: <h1>Objective:</h1>
  
  <p>Have a multi-monitor extended display with monitors on two identical GPUs.</p>
  
  <h2>Hardware:</h2>
  
  <ul>
  <li>Geforce GTX 970 (x2)</li>
  <li>DELL E207WFP Monitor (x6)</li>
  <li>Z97-PRO motherboard</li>
  <li>i5-4690K CPU @3.50GHz</li>
  <li>24GB of RAM</li>
  </ul>
  
  <h2>Software:</h2>
  
  <ul>
  <li>Ubuntu 16.04.04 LTS</li>
  <li>4.4.0-116-generic kernel</li>
  <li>NVIDIA driver version 384.111</li>
  </ul>
  
  <hr>
  
  <h1>Test procedure</h1>
  
  <h3>1) Hardware Tests</h3>
  
  <ul>
  <li>Tested each monitor and their ports. <em>(success)</em></li>
  <li>Tested each Mobo PCI port one at a time with GPU &amp; monitor. <em>(success)</em></li>
  <li><p>Tested each GPU and all of its display ports. <em>(success)</em></p>
  
  <p><strong>NOTE:</strong> each GPU has 1 display, 1 HDMI, and 2 DVI ports.</p>
  
  <ul>
  <li>Tested each port by itself. <em>(success)</em></li>
  <li>Tested all ports displaying at the same time. <em>(success)</em></li>
  </ul></li>
  <li>Tested all cabling involved individually. <em>(success)</em></li>
  </ul>
  
  <h3>2) Software Tests</h3>
  
  <ul>
  <li>Tested if Ubuntu could handle 4 monitors on 1 GPU in extended mode. <em>(success)</em>
  
  <ul>
  <li>Monitor 1: Playing HD Movie in full-screen.</li>
  <li>Monitor 2: Playing Ark survival evolved on highest quality settings.</li>
  <li>Monitor 3: Active Discord video call.</li>
  <li>Monitor 4: OBS software rendering game &amp; Discord for active stream.</li>
  </ul></li>
  <li><p>Tested if Nvidia X Server can see both GPU when plugged in at same time. <em>(success)</em></p>
  
  <p><strong>NOTE:</strong> One GPU is disabled by default. </p></li>
  </ul>
  
  <hr>
  
  <h1>Attempting my objective</h1>
  
  <p>I have attempted a number of configurations with the xorg.conf file.
  The closest to success I get most trials is: </p>
  
  <ul>
  <li>All screens working, shows an extended screen saver image stretched
  across the monitors. </li>
  <li>The mouse is able to travel across all screens happily on the
  screen saver. </li>
  <li>Unfortunately when attempting to login in, I get an
  infinite login loop that reloads the login screen and re-prompts to
  login again.</li>
  </ul>
  
  <h3>xorg.conf file:</h3>
  
  <pre><code>#xorg.file for 6-screen, 2-GPU setup
  
  ###############################################################
  # Mouse Configuration options
  Section "InputDevice"
      Identifier     "Mouse0"
      Driver         "mouse"
      Option         "Protocol" "auto"
      Option         "Device" "/dev/psaux"
      Option         "Emulate3Buttons" "no"
      Option         "ZAxisMapping" "4 5"
  EndSection
  
  
  # Keyboard Configuration options
  Section "InputDevice"
      Identifier     "Keyboard0"
      Driver         "kbd"
  EndSection
  
  ###############################################################
  # Monitor Configuration options
  Section "Monitor"
      Identifier     "Monitor0"
      VendorName     "Dell, Inc."
      ModelName      "DELL E207WFP"
      HorizSync       30.0 - 83.0
      VertRefresh     56.0 - 75.0
  EndSection
  
  Section "Monitor"
      Identifier     "Monitor1"
      VendorName     "Dell, Inc."
      ModelName      "DELL E207WFP"
      HorizSync       30.0 - 83.0
      VertRefresh     56.0 - 75.0
  EndSection
  
  Section "Monitor"
      Identifier     "Monitor2"
      VendorName     "Dell, Inc."
      ModelName      "DELL E207WFP"
      HorizSync       30.0 - 83.0
      VertRefresh     56.0 - 75.0
  EndSection
  
  Section "Monitor"
      Identifier     "Monitor3"
      VendorName     "Dell, Inc."
      ModelName      "DELL E207WFP"
      HorizSync       30.0 - 83.0
      VertRefresh     56.0 - 75.0
  EndSection
  
  Section "Monitor"
      Identifier     "Monitor4"
      VendorName     "Dell, Inc."
      ModelName      "DELL E2009W"
      HorizSync       30.0 - 83.0
      VertRefresh     56.0 - 75.0
  EndSection
  
  Section "Monitor"
      Identifier     "Monitor5"
      VendorName     "Dell, Inc."
      ModelName      "DELL E2009W"
      HorizSync       30.0 - 83.0
      VertRefresh     56.0 - 75.0
  EndSection
  
  ################################################################
  # GPU Configuration options
  Section "Device"
      Identifier     "Device0"
      Driver         "nvidia"
      VendorName     "NVIDIA Corporation"
      BoardName      "GeForce GTX 970"
      BusID          "PCI:1:0:0"
  EndSection
  
  Section "Device"
      Identifier     "Device1"
      Driver         "nvidia"
      VendorName     "NVIDIA Corporation"
      BoardName      "GeForce GTX 970"
      BusID          "PCI:2:0:0"
  EndSection
  
  ################################################################
  # device &amp; monitor bindings configuration options
  Section "Screen"
      Identifier     "Screen0"
      Device         "Device0"
      Monitor        "Monitor0"
      Monitor        "Monitor1"
      Monitor        "Monitor2"
      Monitor        "Monitor3"
      Option         "Stereo" "0"
      Option         "nvidiaXineramaInfoOrder" "DFP-0"
      Option         "metamodes" "DVI-I-1: nvidia-auto-select +1680+0, HDMI-0: nvidia-auto-select +3360+0, DP-1: nvidia-auto-select +5040+0, DVI-D-0: nvidia-auto-select +0+0"
      Option         "SLI" "Off"
      Option         "MultiGPU" "Off"
      Option         "BaseMosaic" "off"
      DefaultDepth    24
      SubSection     "Display"
          Depth       24
      EndSubSection
  EndSection
  
  
  Section "Screen"
      Identifier     "Screen1"
      Device         "Device1"
      Monitor        "Monitor4"
      Monitor        "Monitor5"
      Option         "Stereo" "0"
      Option         "metamodes" "DVI-I-1: nvidia-auto-select +1680+1050, DVI-D-0: nvidia-auto-select +3360+1050"
      Option         "SLI" "Off"
      Option         "MultiGPU" "Off"
      Option         "BaseMosaic" "off"
      DefaultDepth    24
      SubSection     "Display"
          Depth       24
      EndSubSection
  EndSection
  
  #############################################################
  # Xinerma &amp; Compsite extensions
  Section "Extensions"
      Option         "Composite" "Disable"
  EndSection
  
  ##############################################################
  # Screen bindings configuration options
  Section "ServerLayout"
      Identifier     "Layout0"
      Screen      0  "Screen0" 0 1050
      Screen      1  "Screen1" Above "Screen0"
  
      InputDevice    "Keyboard0" "CoreKeyboard"
      InputDevice    "Mouse0" "CorePointer"
  
      Option         "Xinerama" "1"
  EndSection
  
  ###########################################################
  # Unused section
  Section "Files"
  EndSection
  </code></pre>
  
  <hr>
  
  <h1>Clarifications</h1>
  
  <p>This is <strong>not</strong> an infinite login loop question.
  The infinite login loop is a symptom of my problem.</p>
  
  <p>There are several infinite loop question/answers, those assume you've made a mistake and want to "fix" the problem by resetting to default.  Here are several of those reset to default "fixes' that are not my problem.</p>
  
  <ul>
  <li><a href="https://askubuntu.com/questions/762831/ubuntu-16-stuck-in-login-loop-after-installing-nvidia-364-drivers/" title="research 01">login loop from ubuntu fresh install</a></li>
  <li><a href="https://askubuntu.com/questions/223501/ubuntu-gets-stuck-in-a-login-loop">sudo startx mistake</a></li>
  <li><a href="https://askubuntu.com/questions/862943/login-infinite-loop-after-installing-an-nvidia-driver">nvidia driver login loop</a></li>
  <li><a href="https://www.linuxslaves.com/2016/05/3-ways-fix-ubuntu-gets-stuck-login-loop.html" rel="noreferrer">3 common login loop fixes tutorial</a></li>
  <li><a href="https://askubuntu.com/questions/759995/after-upgrade-from-14-04-to-16-04-login-screen-runs-in-a-loop-while-console-logi">Ubuntu upgrade login loop</a></li>
  <li><a href="https://askubuntu.com/questions/845390/ubuntu-16-04-lts-login-loop-black-screen-tty">updates cause login loop</a></li>
  </ul>
  
  <p>I <strong>do not</strong> want to reset to default, and can return my system to working conditions on one graphics cards after each attempt. I am asking how to further change settings/configurations so as to get my goal (without the login loop)?</p>