Debian – multiple monitors and multiple GPUs

TL;DR:

1. xrandr --listproviders
2. xrandr xrandr --setprovideroutputsource 1 0
3. xrandr --output HDMI-1-2 --auto

Background Ramble

So I had my system running nicely on both Windows and Linux (Debian GNU/Linux 8 with KDE), triple monitors all running off my GTX1080. Along comes Oculus and changes their implementation so you can only use “Desktop Pull-out” if you have less than 3 monitors plugged in. Fixed that by moving one of my monitors onto the integrated GPU; I only need my main monitor on the NVidia card for gaming.

This also meant moving monitors around on the outputs so that my main monitor would display the BIOS etc. (the side monitors are rotated 90 degrees).

Not surprisingly Linux needed some post-bootup configuration, and somewhat surprisingly it took quite a bit of searching to find the magic invocations this time around. The magic program itself is xrandr, nobody should be using an Xorg.conf in this day and age.

Step 1 – List Providers

First things, listing the number of “providers” (ie, graphics cards) in your system:

xrandr --listproviders

xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x1fb cap: 0x1, Source Output crtcs: 4 outputs: 8 associated providers: 1 name:NVIDIA-0
Provider 1: id: 0x45 cap: 0x2, Sink Output crtcs: 3 outputs: 3 associated providers: 1 name:modesetting

If this doesn’t show you your cards, you have to do further digging, for example, the integrated GPU might be disabled in your BIOS.

Step 2 – Link Providers

Next, we have to “link” the providers together (this is the bit I had trouble finding):

xrandr xrandr --setprovideroutputsource 1 0

Step 3 – Enable Output

To get a list of possible output ports, use the following:

xrandr -q

xrandr -q
Screen 0: minimum 8 x 8, current 3610 x 1680, maximum 32767 x 32767
DVI-D-0 disconnected (normal left inverted right x axis y axis)
HDMI-0 disconnected (normal left inverted right x axis y axis)
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 connected 1050x1680+0+0 right (normal left inverted right x axis y axis) 474mm x 296mm
   1680x1050     59.95*+
   1440x900      59.89  
   1400x1050     59.98  
   1360x765      60.00  
   1280x1024     75.02    60.02  
   1280x960      60.00  
   1280x720      60.00    50.00  
   1152x864      75.00  
   1024x768      75.03    70.07    60.00  
   800x600       75.00    72.19    60.32    56.25  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    72.81    59.94  
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
DP-4 connected primary 2560x1440+1050+0 (normal left inverted right x axis y axis) 597mm x 336mm
   2560x1440    143.86*+ 119.88    99.90    59.95  
   1920x1080     60.00    59.94    50.00  
   1440x900      59.89  
   1440x576      50.00  
   1440x480      59.94  
   1366x768      59.79  
   1280x1024     75.02    60.02  
   1280x720      59.94    50.00  
   1152x864      75.00  
   1024x768      75.03    70.07    60.00  
   800x600       75.00    72.19    60.32    56.25  
   720x576       50.00  
   640x480       75.00    72.81    59.94  
DP-5 disconnected (normal left inverted right x axis y axis)
DP-1-1 disconnected (normal left inverted right x axis y axis)
HDMI-1-1 connected (normal left inverted right x axis y axis)
   1680x1050     59.95 +
   1400x1050     59.95  
   1280x1024     75.02    60.02  
   1440x900      59.90  
   1280x960      60.00  
   1360x768      59.80  
   1152x864      75.00  
   1280x720      60.00    50.00    59.94  
   1024x768      75.03    70.07    60.00  
   832x624       74.55  
   800x600       72.19    75.00    60.32    56.25  
   720x576       50.00  
   720x480       60.00    59.94  
   640x480       75.00    72.81    66.67    60.00    59.94  
   720x400       70.08  
HDMI-1-2 disconnected (normal left inverted right x axis y axis)
  1680x1050 (0x46) 146.250MHz -HSync +VSync
        h: width  1680 start 1784 end 1960 total 2240 skew    0 clock  65.29KHz
        v: height 1050 start 1053 end 1059 total 1089           clock  59.95Hz
  1280x1024 (0x48) 135.000MHz +HSync +VSync
        h: width  1280 start 1296 end 1440 total 1688 skew    0 clock  79.98KHz
        v: height 1024 start 1025 end 1028 total 1066           clock  75.02Hz
  1280x1024 (0x49) 108.000MHz +HSync +VSync
        h: width  1280 start 1328 end 1440 total 1688 skew    0 clock  63.98KHz
        v: height 1024 start 1025 end 1028 total 1066           clock  60.02Hz
  1280x960 (0x4b) 108.000MHz +HSync +VSync
        h: width  1280 start 1376 end 1488 total 1800 skew    0 clock  60.00KHz
        v: height  960 start  961 end  964 total 1000           clock  60.00Hz
  1152x864 (0x4d) 108.000MHz +HSync +VSync
        h: width  1152 start 1216 end 1344 total 1600 skew    0 clock  67.50KHz
        v: height  864 start  865 end  868 total  900           clock  75.00Hz
  1280x720 (0x4e) 74.250MHz +HSync +VSync
        h: width  1280 start 1390 end 1430 total 1650 skew    0 clock  45.00KHz
        v: height  720 start  725 end  730 total  750           clock  60.00Hz
  1280x720 (0x4f) 74.250MHz +HSync +VSync
        h: width  1280 start 1720 end 1760 total 1980 skew    0 clock  37.50KHz
        v: height  720 start  725 end  730 total  750           clock  50.00Hz
  1024x768 (0x51) 78.750MHz +HSync +VSync
        h: width  1024 start 1040 end 1136 total 1312 skew    0 clock  60.02KHz
        v: height  768 start  769 end  772 total  800           clock  75.03Hz
  1024x768 (0x52) 75.000MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1328 skew    0 clock  56.48KHz
        v: height  768 start  771 end  777 total  806           clock  70.07Hz
  1024x768 (0x53) 65.000MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock  48.36KHz
        v: height  768 start  771 end  777 total  806           clock  60.00Hz
  800x600 (0x55) 50.000MHz +HSync +VSync
        h: width   800 start  856 end  976 total 1040 skew    0 clock  48.08KHz
        v: height  600 start  637 end  643 total  666           clock  72.19Hz
  800x600 (0x56) 49.500MHz +HSync +VSync
        h: width   800 start  816 end  896 total 1056 skew    0 clock  46.88KHz
        v: height  600 start  601 end  604 total  625           clock  75.00Hz
  800x600 (0x57) 40.000MHz +HSync +VSync
        h: width   800 start  840 end  968 total 1056 skew    0 clock  37.88KHz
        v: height  600 start  601 end  605 total  628           clock  60.32Hz
  800x600 (0x58) 36.000MHz +HSync +VSync
        h: width   800 start  824 end  896 total 1024 skew    0 clock  35.16KHz
        v: height  600 start  601 end  603 total  625           clock  56.25Hz
  720x576 (0x59) 27.000MHz -HSync -VSync
        h: width   720 start  732 end  796 total  864 skew    0 clock  31.25KHz
        v: height  576 start  581 end  586 total  625           clock  50.00Hz
  720x480 (0x5b) 27.000MHz -HSync -VSync
        h: width   720 start  736 end  798 total  858 skew    0 clock  31.47KHz
        v: height  480 start  489 end  495 total  525           clock  59.94Hz
  640x480 (0x5c) 31.500MHz -HSync -VSync
        h: width   640 start  656 end  720 total  840 skew    0 clock  37.50KHz
        v: height  480 start  481 end  484 total  500           clock  75.00Hz
  640x480 (0x60) 25.175MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock  31.47KHz
        v: height  480 start  490 end  492 total  525           clock  59.94Hz

And then just try enabling each one in turn:

xrandr --output HDMI-1-1 --auto

And bingo, hopefully your display(s) will pop up.