How can I force multiple monitors to act as separate X screens with Optimus/Prime?

I have a laptop running Fedora Core 26. It uses the 940MX for the video card. My window manager is FVWM. My driver version is 410.70 and the operating system patches are up to date.

I wish to connect another monitor and use it as a completely separate X screen. On my workstation with two GT610s I can use nvidia-settings to get the desired behavior by unselecting “Enable Xinerama” in the “X Server Display Configuration.” It works perfectly and I am extremely happy with it.

On the laptop, however, nvidia-settings tells me I need a RandR capable tool and nothing I’ve found has been able to make it work the way I want. My searches only reveal ways to enable xinerama-like behavior which is the opposite of what I want to accomplish. Can anyone suggest a solution? Thanks!

What is achievable and how depends largely on which gpu the external connectors are connected to. Find out that first.

Assuming at least one of the external connectors are connected to the GPU how would I achieve my goal?

Current configuration: built-in display (eDP-1-1) and a monitor plugged into the HDMI port (DHMI-1-1) and another monitor plugged into the USB-C port with an USB-C to HDMI adaptor (DP-1-1).

xrandr output with this configuration

Screen 0: minimum 8 x 8, current 4144 x 1920, maximum 16384 x 16384
eDP-1-1 connected 1920x1080+1200+0 (normal left inverted right x axis y axis) 381mm x 214mm
1920x1080 60.00*+ 48.07
1400x1050 59.98
1280x1024 60.02
1280x960 60.00
1024x768 60.04 60.00
960x720 60.00
928x696 60.05
896x672 60.01
800x600 60.00 60.32 56.25
700x525 59.98
640x512 60.02
640x480 60.00 59.94
512x384 60.00
400x300 60.32 56.34
320x240 60.05
HDMI-1-1 connected 1200x1920+0+0 left (normal left inverted right x axis y axis) 519mm x 324mm
1920x1200 59.95*+
1600x1200 60.00
1680x1050 59.88
1280x1024 75.02 60.02
1152x864 75.00
1024x768 75.03 60.00
800x600 75.00 60.32
640x480 75.00 59.94
720x400 70.08
DP-1-1 connected 1024x1280+3120+0 left (normal left inverted right x axis y axis) 376mm x 301mm
1280x1024 60.02*+ 75.02
1152x864 75.00
1024x768 75.03 70.07 60.00
832x624 74.55
800x600 72.19 75.00 60.32 56.25
640x480 75.00 72.81 66.67 59.94
720x400 70.08
HDMI-1-2 disconnected (normal left inverted right x axis y axis)

Here’s the output of xrandr --listproviders

Providers: number : 2
Provider 0: id: 0x203 cap: 0x1, Source Output crtcs: 0 outputs: 0 associated providers: 1 name:NVIDIA-0
Provider 1: id: 0x46 cap: 0x2, Sink Output crtcs: 3 outputs: 4 associated providers: 1 name:modesetting

Unfortunately, all of your outputs are connected to the intel gpu (marked -1-1, nvidia connectors would be named DP-0, DP-1 etc.)
In theory, all you could achieve would be all three screens running on intel glx (mesa) or two on intel and one on nvidia.
The first one should be easily achievable using ZaphodHeads, for the second one you would also need at least Xserver 1.20 since you would have to run different glx providers and then use ZaphodHeads+PRIME.
In theory, because that’s a use case which probably isn’t tested.
Don’t know if triple-PRIME would work but I don’t think so.

Thanks! “ZaphodHeads” That’s awesome. It took me a second to understand why it’s called that. I had no idea that option even existed.

I presume I can use the same output names xrandr reported to assign a screen number to a particular output in the xorg.conf’s device section.

I’ll doink around with it and if it works I’ll post a reply to proclaim victory and include my xorg.conf.

Good luck.
The double numbers like HDMI-1-1 only applies to the inactive, secondary state. When active, the first ‘1’ is dropped, HDMI-1.