Enable Nvidia gpu and Intel integrated gpu simultaneously

Write tutorials here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this
Post Reply
Pheeble
Level 2
Level 2
Posts: 52
Joined: Sun Jun 21, 2015 11:27 pm
Location: Brisbane, Australia

Enable Nvidia gpu and Intel integrated gpu simultaneously

Post by Pheeble » Sat Mar 17, 2018 10:34 pm

After repeatedly reading that it is impossible to enable both an Nvidia gpu and an integrated Intel gpu at the same time, I have discovered a simple method that has worked for me in my desktop pc.

Apparently this has been possible since RandR version 1.4 in 2013. In fact, the Intel gpu is not being used for graphics processing, but simply to display the desktop output of the Nvidia gpu on an Intel-connected monitor, as detailed at http://uk.download.nvidia.com/XFree86/L ... ndr14.html

I have successfully tested it in new default installations of Linux Mint Mate 18.3 and Xubuntu 16.04.4 without requiring any xorg.conf file creation.

This tutorial assumes that at least one monitor is attached to the Nvidia gpu, and at least one monitor to the motherboard. I have 3 monitors connected to the Nvidia gpu (2 DVI + 1 VGA), and one connected to the motherboard VGA port. Together the monitors form a single very wide desktop; windows can be dragged from any monitor to any other monitor. Maximizing a window causes it to fill one monitor only.

My system:
Motherboard: Gigabyte Z97X-SOC Force with AMI BIOS firmware version F7
CPU: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz with integrated Intel gpu
Display: Nvidia GeForce GTX 970 on PCI Express x16 controller

The basic method is:

1. Ensure integrated GPU is disabled in the BIOS settings. To check, boot the computer and enter the BIOS settings. On my system this means holding the DEL key while booting. Save any changes in the BIOS and reboot.
bios_display_settings_before_installation.png
BIOS before OS installation. Note that the Intel GPU is disabled and the initial display is set to PCIe (the Nvidia GPU)

2. Perform a standard installation of the operating system.

3. Boot into the newly installed OS. One monitor connected to the Nvidia gpu will be active. Install the driver for the Nvidia GPU. In Linux Mint Mate 18.3: Menu -> Administration -> Driver Manager. Restart the computer. Now all Nvidia-connected monitors should be active.

4. Reboot the computer, and enter the BIOS settings. Enable the Intel gpu and set Intel as the initial display. Save BIOS settings and reboot.
bios_display_settings_after_installation.png
BIOS settings showing 'Intel Processor Graphics' enabled, and 'Initial Display Output' set to IGFX ie. Intel integrated gpu.

5. The OS loads and now uses the monitor attached to the motherboard as the initial display. It may be necessary to rearrange the desktop layout to span the different monitors in the correct order. In Linux Mint Mate 18.3, open Menu -> Preferences -> Displays and drag the monitor layout icons around to get the configuration you want. The Display Preferences dialog in Linux Mint Mate 18.3 can be problematic. It may require a bit of patience as it sometimes restricts the placement of the monitor icons, making it difficult to rearrange all icons at once. I had to move one or two monitor icons, apply and close, then reopen the Display Preferences dialog again and continue. Repeat until all the monitor layout is organized how you want.
Monitor Preferences.png
Linux Mint Mate 18.3 Display Preferences showing the monitor icons arranged side-by-side.

At this point all of the monitors should be tiled to act as one continuous desktop.

The Nvidia gpu is fully accessible to the system. I have played Steam games and performed gpu rendering using CUDA and OpenCL in Blender without any problem.

P.S. I would have attached more screenshots but the forum limits me to 3 attachments. Other screenshots are attached at viewtopic.php?f=49&t=265883&p=1445093#p1445093
Last edited by Pheeble on Sun Mar 18, 2018 5:11 pm, edited 1 time in total.

Pheeble
Level 2
Level 2
Posts: 52
Joined: Sun Jun 21, 2015 11:27 pm
Location: Brisbane, Australia

xorg.conf version: Enable Nvidia gpu and Intel integrated gpu simultaneously

Post by Pheeble » Sun Mar 18, 2018 5:02 pm

Sometimes it is necessary to use a device configuration in /etc/X11/xorg.conf - as I do due to a missing edid in my Viewsonic monitors:

Code: Select all

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

Section "Device"
    Identifier "intel"
    Driver "modesetting"
    BusID "PCI:0@0:2:0"
    Option "AccelMethod" "None"
EndSection

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

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "PCI:1@0:0:0"
    Option "ConstrainCursor" "off"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    Option "AllowEmptyInitialConfiguration" "on"
    Option "IgnoreDisplayDevices" "CRT"
    Option "CustomEDID" "DFP-0:/etc/X11/viewsonic-vp950b-edid.bin; DFP-4:/etc/X11/viewsonic-vp950b-edid.bin"
EndSection
The 'ServerLayout' section sets the Nvidia device as the active gpu, and prevents the Intel gpu from being involved in rendering. The Intel device is only used for displaying a desktop rendered by the Nvidia device. This is referred to as 'offloading', as explained at http://uk.download.nvidia.com/XFree86/L ... ndr14.html.

There follows a pair of 'Device' and 'Screen' sections for each of the gpus. The 'Device' sections specify the PCI bus used by each gpu. This can be determined for the devices using 'lspci':

Code: Select all

lspci | grep -i vga
00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller (rev 06)
01:00.0 VGA compatible controller: NVIDIA Corporation GM204 [GeForce GTX 970] (rev a1)
For the Intel, the lspci output is '00:02.0'. In xorg.conf, this is translated to '0@0:2:0'. So the xorg.conf PCI bus address for the Intel device becomes ' BusID "PCI:0@0:2:0" '. Similarly, the Nvidia's PCI bus address is translated from lspci's '01:00.0' to xorg.conf's ' BusID "PCI:1@0:0:0" '. Adjust according to your system's lspci output.

majenko
Level 1
Level 1
Posts: 1
Joined: Sun Nov 11, 2018 6:17 pm

Re: Enable Nvidia gpu and Intel integrated gpu simultaneously

Post by majenko » Sun Nov 11, 2018 6:20 pm

That is awesome stuff! I have been running on a pair of nVidia cards for a while now, and getting it to work with three monitors has been a right royal pain. And now one of them has a fan that is giving up the ghost - groaning like mad. I've "fixed" it numerous times, but decided I wanted to simplify.

Now thanks to this I have got the internal intel on my HP i5 running as an offload with three screens seamlessly - no configuration (other than arranging them with xrandr) needed - and only one nVidia card installed. Bliss.

Post Reply

Return to “Tutorials”