Skip to content

Instantly share code, notes, and snippets.

@wangruohui
Last active April 25, 2024 10:38
Show Gist options
  • Save wangruohui/bc7b9f424e3d5deb0c0b8bba990b1bc5 to your computer and use it in GitHub Desktop.
Save wangruohui/bc7b9f424e3d5deb0c0b8bba990b1bc5 to your computer and use it in GitHub Desktop.
Intel for display, Nvidia for computing

Intel for display, NVIDIA for computing

This guide will show you how to use Intel graphics for rendering display and NVIDIA graphics for CUDA computing on Ubuntu 18.04 / 20.04 desktop.

I made this work on an ordinary gaming PC with two graphics devices, an Intel UHD Graphics 630 plus an NVIDIA GeForce GTX 1080 Ti. Both of them can be shown via lspci | grep VGA.

00:02.0 VGA compatible controller: Intel Corporation Device 3e92
01:00.0 VGA compatible controller: NVIDIA Corporation GP102 [GeForce GTX 1080 Ti] (rev a1)

This guide can be summarized into two steps:

  1. To install NVIDIA drivers without OpenGL files.
  2. To configure Xorg to use the Intel graphics.

I haven't tested on different hardware configurations, but it should work similarly. See this section for more discussion.

0. Preparation

Before operating within Linux, you need to make some configuration on your hardware. Make sure monitors are plugged to the motherboard the instead of dedicated display card. Configure the BIOS to make Intel graphics as the primary display device (usually select IGFX instead of PEG or PCIE). Make sure your computer could boot to GUI and be logged in to desktop successfully under this setting.

1. Install NVIDIA driver without OpenGL files

I suggest installing the driver in either of the following ways. If you would like to follow your own method, just make sure the OpenGL files are not installed.

1.1. Uninstall all previous installations

Common steps for both methods to avoid possible conflicts.

  1. If you have installed via PPA repositories

    sudo apt purge nvidia*
    # some interactive operations
    sudo apt autoremove
    # some interactive operations

    Check remaining packages related to NVIDIA.

    dpkg -l | grep nvidia

    If some packages are not removed, manually remove them by

    sudo dpkg -P <package_name>

    If you have add third party repositories, e.g. ones from NVIDIA, remove them too. This could be done by removing related files under /etc/apt/source.list.d/ or via ppa-purge utility.

  2. If you have installed via binary installers

    sudo nvidia-uninstall
    # some interactive operations
  3. Reboot.

1.2.A. Install from PPA Repository

  1. Add the ppa:graphics-drivers/ppa repository.

    sudo add-apt-repository ppa:graphics-drivers/ppa
    # some interactive operations

    On ubuntu 18.04 sudo apt update is automatically performed after adding a PPA, thus not manually required.

  2. Install the headless NVIDIA driver

    sudo apt install nvidia-headless-418 nvidia-utils-418

    Version 418 is the latest when I write this page. Changing to the latest version available is a good idea.

    IMPORTANT

    The nvidia-headless-418 contains only the driver, while the full nvidia-driver-418 package contain everything including display component such OpenGL libraries. If you hope to connect the display to a NVIDIA display card, install the full package, otherwise, install only the driver.

    The nvidia-utils-418 package provide utilities such as nvidia-smi.

  3. Reboot. If the installation is successful, command nvidia-smi will show all NVIDIA GPUs.

1.2.B. Install from Binary Installer

My previous post, thought old, is detailed and still work.

To summary:

  1. Download the binary installer from NVIDIA official site and make it executable.

  2. Disable nouveau driver by creating file /etc/modprobe.d/blacklist-nouveau.conf with content

    blacklist nouveau
    options nouveau modeset=0
    

    or just executing the installer and it will prompt to create it for you.

  3. Execute sudo update-initramfs -u and then reboot.

  4. After booting, switch to tty1. Stop display services such as gdm, gdm3, lightdm. Kill all process that is using the graphic card, such as Xorg or X.

  5. Execute the installer with --no-opengl-files suffix (IMPORTANT) to avoid installation of all OpenGL related files, like

    sudo ./NVIDIA-Linux-x86_64-418.56.run --no-opengl-files

    Or if you would like to display from an NVIDIA graphic card, execute the installer without any arguments, like

    sudo ./NVIDIA-Linux-x86_64-418.56.run
  6. After a successful installation, command nvidia-smi will show all NVIDIA GPUs.

2. Configure Xorg

The installed NVIDIA driver and configurations will hint Xorg to start with NVIDIA devices. Depending on whether NVIDIA related display libraries are well installed, the X server would failed to start or success to start but still use NVIDIA devices, both of which are unwanted.

We can force Xorg to use Intel graphics by creating a configuration file with the following contents and save it to /etc/X11/xorg.conf.

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "intel"
    VendorName     "Intel Corporation"
    BusID          "PCI:0:2:0
EndSection

The key point is the "BusID" option. It indicates the PCI bus id that the Intel graphics connects to. It can be retrieved from lspci. For example, on my computer, lspci outputs 00:02.0 VGA compatible controller: Intel Corporation Device 3e92, thus the bus id is 0:2:0.

Note that the bus id output from lspci is hexadecimal but the number filled in xorg.conf should be decimal. For example, if the output from lspci is 82:00.0 VGA com..., you need to fill PCI:130:0:0 in the configuration.

On Ubuntu 20.04 you may want to set the driver to modesetting instead of intel. I met some problem and solved as this link (and links within it) describes.

Setting with multiple monitors would be a little bit complex. Here is my example of setting with two monitors. Some fields are missing but it works as Xorg will smartly use some default configs. Anyway, search the Internet to get a proper set of configurations for you. man xorg.conf and ArchLinux wiki are good references.

Section "Device"
    Identifier     "Device0"
    Driver         "modesetting"
    VendorName     "Intel Corporation"
    BusID          "PCI:0:2:0
    Option         "TearFree" "true"
    Option         "monitor-DP-1" "DP"
    Option         "monitor-HDMI-2" "HDMI"
EndSection

Section "Monitor"
    Identifier "DP"
    Option     "Rotate" "Left"
EndSection

Section "Monitor"
    Identifier "HDMI"
    Option     "RightOf " "DP"
    Option     "Primary" "true"
EndSection

After the configuration, reboot the computer. If it successes, you will be able to login to the desktop. If it fails, you could be locked at the login screen. Reboot to advance mode, drop to root prompt and check /var/log/Xorg.*.log.* for hints.

After login successfully, open an terminal and execute glxheads. The displayed rendering devices should be the Intel graphics.

glxheads: exercise multiple GLX connections (any key = exit)
Usage:
  glxheads xdisplayname ...
Example:
  glxheads :0 mars:0 venus:1
Name: :0
  Display:     0x56151a1570e0
  Window:      0x2000002
  Context:     0x56151a182f60
  GL_VERSION:  3.0 Mesa 18.0.5
  GL_VENDOR:   Intel Open Source Technology Center
  GL_RENDERER: Mesa DRI Intel(R) HD Graphics (Coffeelake 3x8 GT2)

Check nvidia-smi, there should be no Xorg process listed and memory occupation should be 0MB.

Thu Nov 22 07:05:55 2018
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 418.56       Driver Version: 418.56       CUDA Version: 10.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 108...  Off  | 00000000:01:00.0 Off |                  N/A |
|  0%   52C    P0    57W / 250W |      0MiB / 11178MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

Execute a heavy GPU program and move your mouse during the computation. The display should be smooth, as the computing and display rendering are separated on different devices.

Congratulations!

If glxheads outputs some virtual graphics and nvidia-smi still output Xorg processes, you probably still using the NVIDIA graphics for rendering. It just pass the rendered image to Intel graphics for display. When running heavy GPU programs, the display will still be slow.

3. Discussion

Separating display and computing is important for a smooth work.

  1. You could use a remote headless server for computing a local client for display. You can connect the remote server via SSH. This could be the simplest way. Under this setting, a properly installed headless driver will make everything work. You don't need to follow this guide.

  2. If you have only one computer and there is only one graphic device in your computer. Its unfortunate. You have to use the only device for all tasks and you would suffer severe display latency when running GPU programs.

  3. You user a single computer for both computing and display. There are two (or more) graphic devices and they are from the same vendor. Then the problem could be mush easier. Taking NVIDIA as the example, with a properly installed driver, display and computing can be perfectly separated. One can plug monitors to device 0 and use CUDA_VISIBIE_DEVICE=1 environment flag to perform computing on device 1. You probably don't need this guide.

  4. You user a single computer for both computing and display. There are two (or more) graphic devices but they are from different vendors. For example, an ordinary gaming PC configuration could include a Intel HD Graphics within the CPU and a dedicated GPU from NVIDIA. One need to plug monitors to the motherboard to use the Intel one for display and run CUDA program on the NVIDIA one. Then you are at the right place.

  5. For some purpose, you need an NVIDIA GPU for both computing and rendering. Then you probably need to run both of them on a single GPU. You need to install the drvier with OpenGL support and tune some rendering settings in Xorg.

@liuhengyue
Copy link

Hi,

Thanks for your posting and it saved some extra space for my hard-working GPU.
I have a integrated Intel UHD 630 graphics and Ubuntu 18.04. After set up everything, there is flicker and horizontal splits when playing video. Then I found a solution for that. Just add following lines within the "Device" section in the xorg config.

    Option "AccelMethod" "sna"
    Option "TearFree" "true"
    Option "DRI" "3"

Hope it can help other people with similar issues. Thanks.

@isofew
Copy link

isofew commented Jan 5, 2020

Hi,

Thanks for your posting and it saved some extra space for my hard-working GPU.
I have a integrated Intel UHD 630 graphics and Ubuntu 18.04. After set up everything, there is flicker and horizontal splits when playing video. Then I found a solution for that. Just add following lines within the "Device" section in the xorg config.

    Option "AccelMethod" "sna"
    Option "TearFree" "true"
    Option "DRI" "3"

Hope it can help other people with similar issues. Thanks.

Thank you! This fixed my problem exactly.

@uberneko
Copy link

Hello !
Are you sure this is still working on Ubuntu 20.04 ? I just tried on Mint 20 Cinnamon (beta) - once I do the xorg.conf file, I can reboot but when for instance I try launching Blender, it doesn't work (segmentation issue - core dump). And glxheads seems not to work either.
I tried before in plain Ubuntu 20.04 - same issues (plus the glitch).
I tried now with Xubuntu 20.04 - xorg won't start, it complains that something is wrong is the xorg.conf file.

@uberneko
Copy link

By removing GPUs and putting them back at the very last moment (just after installing the headless drivers actually), I managed to make it boot with Xubuntu, but same result : Blender would not start, segmentation fault, core dump. Plus glxheads does not work as well.

@wangruohui
Copy link
Author

Hello !
Are you sure this is still working on Ubuntu 20.04 ? I just tried on Mint 20 Cinnamon (beta) - once I do the xorg.conf file, I can reboot but when for instance I try launching Blender, it doesn't work (segmentation issue - core dump). And glxheads seems not to work either.
I tried before in plain Ubuntu 20.04 - same issues (plus the glitch).
I tried now with Xubuntu 20.04 - xorg won't start, it complains that something is wrong is the xorg.conf file.

Hi, i have just test it on plain ubuntu 2004 a few days ago. There was some glitch problem but it finally got resolved. It seems the driver option should be replaced from intel to modesetting. Reference link are also updated within the post. See if it can help you. Thank you :)

@uberneko
Copy link

uberneko commented Jun 16, 2020

Thanks for your pretty fast answer !
Umm indeed I didn't test this one - I shall try later.
When trying to find a solution I also discovered the existence of a kernel parameter : "nogpumanager" - which apparently avoids ... Ubuntu to keep on re-initializing the xorg conf ? (https://forums.developer.nvidia.com/t/ubuntu-18-04-headless-390-intel-igpu-after-prime-select-intel-lost-contact-to-geforce-1050ti/66698) - I'll investigate this one too.

@gautham20
Copy link

Exactly what I needed, Thanks!
Few things I have noticed, In ubuntu 18.04.4, driver modesetting had to be used instead of intel, because with intel I had display glitches.
And before updating xorg.conf, get the current xorg conf by sudo X :2 -configure and change the drives whereever necessary, this will have you covered for multiple displays.

@lxxue
Copy link

lxxue commented Jun 20, 2020

Hi,

Thanks for your posting and it saved some extra space for my hard-working GPU.
I have a integrated Intel UHD 630 graphics and Ubuntu 18.04. After set up everything, there is flicker and horizontal splits when playing video. Then I found a solution for that. Just add following lines within the "Device" section in the xorg config.

    Option "AccelMethod" "sna"
    Option "TearFree" "true"
    Option "DRI" "3"

Hope it can help other people with similar issues. Thanks.

Thanks!

@lxxue
Copy link

lxxue commented Jun 20, 2020

Exactly what I needed, Thanks!
Few things I have noticed, In ubuntu 18.04.4, driver modesetting had to be used instead of intel, because with intel I had display glitches.
And before updating xorg.conf, get the current xorg conf by sudo X :2 -configure and change the drives whereever necessary, this will have you covered for multiple displays.

Hi!
Could you share the updated xorg.conf? The sudo X :2 -configure doesn't work for me and I couldn't find a fix for it using google (Error: Number of created screens does not match number of detected devices).
Right now I have two monitors but only one monitor correctly displays the desktop. I check the Displays provided by Ubuntu 18.04 and found that it cannot detect the second screen. I used to use Nvidia GPU for display and it worked with two monitors. Thanks!

@gautham20
Copy link

Exactly what I needed, Thanks!
Few things I have noticed, In ubuntu 18.04.4, driver modesetting had to be used instead of intel, because with intel I had display glitches.
And before updating xorg.conf, get the current xorg conf by sudo X :2 -configure and change the drives whereever necessary, this will have you covered for multiple displays.

Hi!
Could you share the updated xorg.conf? The sudo X :2 -configure doesn't work for me and I couldn't find a fix for it using google (Error: Number of created screens does not match number of detected devices).
Right now I have two monitors but only one monitor correctly displays the desktop. I check the Displays provided by Ubuntu 18.04 and found that it cannot detect the second screen. I used to use Nvidia GPU for display and it worked with two monitors. Thanks!

I'm not sure if this will fix your issue, but here is my xorg.conf

Section "ServerLayout"
	Identifier     "X.org Configured"
	Screen      0  "Screen0" 0 0
	Screen      1  "Screen1" RightOf "Screen0"
	InputDevice    "Mouse0" "CorePointer"
	InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
	ModulePath   "/usr/lib/xorg/modules"
	FontPath     "/usr/share/fonts/X11/misc"
	FontPath     "/usr/share/fonts/X11/cyrillic"
	FontPath     "/usr/share/fonts/X11/100dpi/:unscaled"
	FontPath     "/usr/share/fonts/X11/75dpi/:unscaled"
	FontPath     "/usr/share/fonts/X11/Type1"
	FontPath     "/usr/share/fonts/X11/100dpi"
	FontPath     "/usr/share/fonts/X11/75dpi"
	FontPath     "built-ins"
EndSection

Section "Module"
	Load  "glx"
EndSection

Section "InputDevice"
	Identifier  "Keyboard0"
	Driver      "kbd"
EndSection

Section "InputDevice"
	Identifier  "Mouse0"
	Driver      "mouse"
	Option	    "Protocol" "auto"
	Option	    "Device" "/dev/input/mice"
	Option	    "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
	Identifier   "Monitor0"
	VendorName   "Monitor Vendor"
	ModelName    "Monitor Model"
EndSection

Section "Monitor"
	Identifier   "Monitor1"
	VendorName   "Monitor Vendor"
	ModelName    "Monitor Model"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option     "SWcursor"           	# [<bool>]
        #Option     "HWcursor"           	# [<bool>]
        #Option     "NoAccel"            	# [<bool>]
        #Option     "ShadowFB"           	# [<bool>]
        #Option     "VideoKey"           	# <i>
        #Option     "WrappedFB"          	# [<bool>]
        #Option     "GLXVBlank"          	# [<bool>]
        #Option     "ZaphodHeads"        	# <str>
        #Option     "PageFlip"           	# [<bool>]
        #Option     "SwapLimit"          	# <i>
        #Option     "AsyncUTSDFS"        	# [<bool>]
        #Option     "AccelMethod"        	# <str>
        #Option     "DRI"                	# <i>
	Identifier  "Card0"
	Driver      "modesetting"
	BusID       "PCI:0:2:0"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option     "SWcursor"           	# [<bool>]
        #Option     "kmsdev"             	# <str>
        #Option     "ShadowFB"           	# [<bool>]
        #Option     "AccelMethod"        	# <str>
        #Option     "PageFlip"           	# [<bool>]
        #Option     "ZaphodHeads"        	# <str>
        #Option     "DoubleShadow"       	# [<bool>]
	Identifier  "Card1"
	Driver      "modesetting"
	BusID       "PCI:0:2:0"
EndSection

Section "Screen"
	Identifier "Screen0"
	Device     "Card0"
	Monitor    "Monitor0"
	SubSection "Display"
		Viewport   0 0
		Depth     1
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     4
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     8
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     15
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     16
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
	EndSubSection
EndSection

Section "Screen"
	Identifier "Screen1"
	Device     "Card1"
	Monitor    "Monitor1"
	SubSection "Display"
		Viewport   0 0
		Depth     1
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     4
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     8
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     15
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     16
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
	EndSubSection
EndSection

@uberneko
Copy link

@wangruohui:
After a few time, I settled down to one different option though. But I confirm switching to modesetting instead of intel within ubuntu 20.04 will do the trick and that still works.
I use Linux Mint and spent some time with there beta Cinnamon Linux Mint 20.
Actually now they introduced the nvidia applet switcher (more or less prime, I'd say), which allows to go to saving mode (intel), performance mode (nvidia) and on-demand.
On saving mode, strangely, even if NVIDIA drivers are installed (the full ones), Blender would not see the cards, so it would propose only CPU rendering. On performance, it works, but it is the situation we don't want, using one NVIDIA graphic card for both display and computing (CUDA here).
The interesting mode is 'on-demand'. Here we are on intel for display, and programs can be launched with running with NVIDIA cards as option.
There, Blender does see the graphic cards, and GPU rendering (even Optix now) works quite well.
I just see some strange Xorg processes in nvidia-smi (one per NVIDIA card actually) - but if I run a game with NVIDIA, I clearly see the new process for the game, if I run that game without graphic card, I don't see it in nvidia-smi. So I guess it works (for some reasons the only program 'polluting' nvidia-smi with a process when being lauch on intel, i.e. normally, without demanding the graphic card, is LibreOffice... can't understand why...).
But currently that new situation satisfies me.

@mhassankhan90
Copy link

Hi there,

I followed the guide to set up my integrated graphics (intel) for display and nvidia for computing. I am using Ubuntu 20.04. I installed the Nvidia driver and checked nvidia-smi. It was working fine. I then added the above mentioned contents to my xorg.conf file. Now when I run nvidia-smi command, it gives me error that "NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running." Please help me resolve this issue.

Regards,

@as181920
Copy link

@mhassankhan90
I tries this and works, edit file /etc/modprobe.d/blacklist-nvidia.conf
blacklist nvidia-drm
alias nvidia-drm off

found here:http://litaotju.github.io/2019/03/13/=Use-intel-for-display-nvidia-for-computing/

@josiahlaivins
Copy link

If youre xorg.conf keeps being overwiritten, I would try: https://askubuntu.com/questions/731990/gpu-manager-overwrites-xorg-conf

@fenglixin
Copy link

fenglixin commented Apr 13, 2021

Thanks ! This saved my life!!
I am using Ubuntu 20.04.2 , Intel HD graphic for display and nvidia RTX 3090.

@NiranthS
Copy link

I have a laptop with an RTX 3070 with Intel UHD. I am not able to see "VGA compatible controller: Intel Corporation Device" when I run lspci | grep vga
Can someone help me with this?

@NiranthS
Copy link

NiranthS commented Apr 19, 2021

@fenglixin , can you help me with the setup. I also have Intel HD and RTX 3070. I am not able to see "VGA compatible controller: Intel Corporation Device" when I run lspci | grep vga. Did this happen with you also?

@fenglixin
Copy link

fenglixin commented Apr 25, 2021

@NiranthS Some motherboard default forbids the onboard graphics on BIOS, you should check you manual handbook to figure out how to enable it in BIOS.

@NiranthS
Copy link

Thanks, will try it out.

@0xAl3xH
Copy link

0xAl3xH commented May 25, 2021

I have run into this exact issue. It seems like nvidia-settings will only work with xorg running on it. Has anyone been able to separate the GPUS, intel for display and nvidia for compute while also being able to access nvidia-settings?

@mhassankhan90
Copy link

@al3x-huang there is no need to do it manually now. NVidia has added this option in NVIDIA optimus GPU switcher. Install latest cuda toolkit and select "NVIDIA on demand" in optimus setting after installation.

Copy link

ghost commented Jun 24, 2021

Thanks a lot, I was struggling to configure my own. Despite I had to do some manual configuration in the BIOS, but this guide was straight forward to the point. My hardware: AMD Vega 8 + NVIDIA 16 Series.

@ttppss
Copy link

ttppss commented Nov 24, 2021

@fenglixin , can you help me with the setup. I also have Intel HD and RTX 3070. I am not able to see "VGA compatible controller: Intel Corporation Device" when I run lspci | grep vga. Did this happen with you also?

Can you try "lspci -v" and see if you can find something called "Display Controller"? I'm also having a RTX 3070 and Intel HD, and that's what I saw, then I used that PCI in the config file. Seems that it is working for me.

@alierkan
Copy link

alierkan commented Feb 6, 2022

For newcomers, I should inform you.
You can try Pop OS Nvidia. It is ubuntu-based and you need only one line command to obtain this config and easily get back.

@zhongxiang117
Copy link

Thanks for your post, it works like a charm. I would like to share my /etc/X11/xorg.conf settings for dual monitors, may it be useful for similar users (my system is Ubuntu 20.04 built as 5.14.0-1031-oem #34-Ubuntu x86_64 x86_64 x86_64 GNU/Linux

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "modesetting"
    VendorName     "Intel Corporation"
    BusID   	   "PCI:0:2:0"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

@haipnh
Copy link

haipnh commented Jun 29, 2022

Hi,

I have 1x UHD 630, 1x 1080 Ti, 1x 1650 and 2 monitors connecting to the motherboard via DP and HDMI.

After a clean Ubuntu 18.04 installation, my system has user interface with GNOME. Examine the glxheads, it shows:

GL_RENDERER: Mesa DRI Intel(R) UHD Graphics (Comet Lake 3x8 GT2)

But after I install the headless NVIDIA drivers, utilities and reboot the machine, the system is stuck in the login screen that requires me to enter the password all of the time.

My procedure

sudo apt purge nvidia*
sudo apt autoremove
sudo reboot now
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt install nvidia-headless-515 nvidia-utils-515
sudo reboot now # it will be stuck in the login screen after this step

@haipnh
Copy link

haipnh commented Jun 29, 2022

[WORKED] My machine

  • Ubuntu 18.04
  • 1x UHD 630, 1x 1080 Ti, 1x 1650
  • 2 monitors connecting to the motherboard via DP and HDMI

During the Ubuntu installation wizard, check for automatically download 3rd drivers.

After the first boot, run lshw -c video to check which Intel driver is being used. For my UHD 630, the driver is "i915", not "intel".

So the configuration should be:

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "i915"
    VendorName     "Intel Corporation"
    BusID          "PCI:0:2:0"
EndSection

@fenglixin
Copy link

Hi,

I have 1x UHD 630, 1x 1080 Ti, 1x 1650 and 2 monitors connecting to the motherboard via DP and HDMI.

After a clean Ubuntu 18.04 installation, my system has user interface with GNOME. Examine the glxheads, it shows:

GL_RENDERER: Mesa DRI Intel(R) UHD Graphics (Comet Lake 3x8 GT2)

But after I install the headless NVIDIA drivers, utilities and reboot the machine, the system is stuck in the login screen that requires me to enter the password all of the time.

My procedure

sudo apt purge nvidia*
sudo apt autoremove
sudo reboot now
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt install nvidia-headless-515 nvidia-utils-515
sudo reboot now # it will be stuck in the login screen after this step

I think installing from binary method should be tried.

@haipnh
Copy link

haipnh commented Jul 5, 2022

Hey guys,

If you are looking for a offload rendering solution, check out my instruction here.

https://gist.github.com/haipnh/565cce0c4e1fb878b093d3faf7b37114

@gorkemgoknar
Copy link

Thank you this is the thing I was looking for to save 250Mb Vram off Nvidia gpu for machine learning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment