Logo

Indie Machine Learning and Video Game Dev

Neural Net Downloads
How to
Hardware Reviews
Get Merch
About
Training of the week
8 August 2019

How to use Intel Integrated graphics and NVIDIA GPU at same time on linux laptop

by Mathieu Poliquin

This post is to for ML devs who want to have their nvidia gpu memory dedicated entirely for their experiments. By default, X and all the apps you use are put on the nvidia gpu while the Intel Integrated Graphics chip stays mostly idle.

1. List PCI devices

lspci

You should see something like this nividia_smi

Take note of the bus id of the Intel chip

2. Edit xorg.conf file

Next, we need to edit the xorg.conf file to tell X to use Intel chip by default

sudo gedit etc/X11/xorg.conf

Copy this in the file but don’t forget to change it with your Bus ID

Section "Device"
    Identifier      "intel"
    Driver          "intel"
    BusId           "PCI:0:2:0"
EndSection

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

REBOOT!!!

3. Test it out

Install the Intel gpu tools if don’t have them already

sudo apt-get install intel-gpu-tools

Launch the CPU usage minitoring tool

sudo intel_gpu_top

Launch some videos or other GPU intensive app and notice the usage of the Intel chip nividia_smi

Launch nivdia-smi to make sure it’s at zero vram usage

nvidia-smi -l 1

You should see something like this: nividia_smi

I made a video following these steps:

tags: intel - integrated graphics - nvidia - gpu - machine learning - linux