How to run both Intel and Nvidia graphics card driver on dual monitor setup?

I'm trying to get Intel and Nvidia graphics card working together with two monitors. One monitor should use the Intel card and the other the Nvidia card. Of course, I want to use only one keyboard and one mouse to switch between both screens. Bumblebee didn't work for me.

I don't want to use the xserver-xorg-video-all package because I need the Nvidia card for gaming and I can't use only one graphics card because I need one for KVM virtualisation and the other one for my Linux desktop

So I tried to install the drivers and to configure the Xserver manually. The Nvidia driver is working and I get a video output. But I don't get a video output with the Intel card.

I followed the instructions in this blog post

The config files:

/etc/X11/xorg.conf.nvidia
/etc/X11/xorg.conf.intel
/etc/lightdm/lightdm.conf

Here's a related StackOveflow post


Solution 1:

It is possible since 2013 using graphics offloading (see http://us.download.nvidia.com/XFree86/Linux-x86/319.12/README/randr14.html)

The following uses the free drivers (nouveau) and won't work using nvidia's proprietary ones.

I've been using this for a few months and it works well enough for me. Here's my setup :

 __nvidia__ __intel___ __nvidia__
|          |          |          |
|  DVI-I-1 |   VGA-1  |  DVI-D-1 |
|__________|__________|__________|

Here's what you should use if you're running off an nvidia card and would like to output a third screen via the embeded graphics (intel) :

Xorg.conf

# Discrete Card as Primary GPU

Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nouveau"
    Inactive "intel"
EndSection

Section "Device"
    Identifier  "nouveau"
    Driver      "nouveau"
    BusID       "PCI:1:0:0" # see man lspci
EndSection

Section "Screen"
    Identifier "nouveau"
    Device "nouveau"
EndSection

Section "Device"
    Identifier  "intel"
    Driver      "modesetting"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

Now add this to your session manager startup script :

xrandr --setprovideroutputsource modesetting nouveau
xrandr --output VGA-1 --mode 1920x1080
sleep 1s
xrandr --output VGA-1 --mode 1920x1080 --pos 1920x0 --rotate normal --output DVI-D-1 --mode 1920x1080 --pos 3840x0 --output DVI-I-1 --mode 1920x1080 --pos 0x0

Those pastes come from my own config and should be tweaked to fit your own use case. The full documentation is available here : http://us.download.nvidia.com/XFree86/Linux-x86/319.12/README/randr14.html

In this configuration, the nvidia GPU does all the rendering work. The Intel iGPU simply displays whatever the main GPU sends to it. Please note that the nvidia GPU is totally unaware of the state of the iGPU when it sends frames to display. That means there may be a fair amount of tearing (horizontally AND diagonaly !). For those who may wanna tru it, you can't use the "TearFree" option in your Xorg.conf.

Solution 2:

A little simplier than in MikaDo- post.

Triple monitors with GT 1030 (DVI, HDMI) and Intel HD 4600 (VGA output).

BIOS Settings:

Primary GPU: PCI Express
IGPU Multi-monitor: Enabled

Worked for me on Ubuntu 14.04 with NVIDIA driver (not Nouveau, didn't try Nouveau actually), exactly like it is described in original article (http://us.download.nvidia.com/XFree86/Linux-x86/319.12/README/randr14.html) (had to sleep out first! :-))

just figure out Nvidia BUS ID with

nvidia-xconfig --query-gpu-info

and had to put final commands in .xprofile

#!/bin/sh
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

then displays layout is configured with native Ubuntu Display Settings (GUI)

Solution 3:

I successfully let it work by following MikaDo's solution in Ubuntu 18.04

OS : ubuntu 18.04  
GPU : nvidia 1080ti @ nvidia 410.104 driver / CUDA 10.0  
MB: MSI Z370 tomahawk  
CPU: intel core i7 8700  
Screen1 : LG 29" 21:9 @ 1080ti/DP  
Screen2 : PHILIPS 27" 4K @ Intel Graphic/HDMI on motherboard 

1.Enable iGPU option in bios and install intel graphic driver

2.Add the following lines in /etc/X11/xorg.conf: (remember to backup before editing)

Section "Device"
    Identifier "intel"
    Driver "modesetting"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

3.

sudo xrandr --setprovideroutputsource modesetting NVIDIA-0
sudo xrandr --auto
  1. Reboot. Then you'll see 2 screens both display well. (but may not work in correct resolution) enter image description here

5. Follow this tutorial to add display mode

In my case enter image description here enter image description here enter image description here enter image description here