NVIDIA Optimus is a technology that allows an Intel integrated GPU and discrete NVIDIA GPU to be built into and accessed by a laptop.
There are several methods available:
- #Use Intel graphics only - saves power, because NVIDIA GPU will be completely powered off.
- #Use NVIDIA graphics only - gives more performance than Intel graphics, but drains more battery (which is not welcome for mobile devices). This utilizes the same underlying process as the optimus-manager and nvidia-xrun options, it should be utilized for troubleshooting and verifying general functionality, before opting for one of the more automated approaches.
- Using both (use NVIDIA GPU when needed and keep it powered off to save power):
- #Using PRIME render offload - official method supported by NVIDIA.
- #Using optimus-manager - switches graphics with a single command (logout and login required to take effect). It achieves maximum performance out of NVIDIA GPU and switches it off if not in use. Since the 1.4 release AMD+NVIDIA combination is also supported.
- #Using nvidia-xrun - run separate X session on different TTY with NVIDIA graphics. It achieves maximum performance out of NVIDIA GPU and switches it off if not in use.
- #Using Bumblebee - provides Windows-like functionality by allowing to run selected applications with NVIDIA graphics while using Intel graphics for everything else. Has significant performance issues.
- #Using nouveau - offers poorer performance (compared to the proprietary NVIDIA driver) and may cause issues with sleep and hibernate. Does not work with latest NVIDIA GPUs.
- #Using EnvyControl - Similar to optimus-manager but does not require extensive configuration or having a daemon running in the background as well as having to install a patched version of GDM if you are a GNOME user.
- #Using NVidia-eXec - Similar to Bumblebee, but without the performance impact. It works on both Xorg and Wayland. This package is experimental, and is currently being tested only under GNOME/GDM.
- #Using nvidia-switch - Similar to nvidia-xrun, but not needing to change TTY, the switches will be done by login and logouts in your display manager. This package is being tested on Debian based system, but, like nvidia-xrun, it must work in all Linux systems.
Use Intel graphics only
If you only care to use a certain GPU without switching, check the options in your system's BIOS. There should be an option to disable one of the cards. Some laptops only allow disabling of the discrete card, or vice-versa, but it is worth checking if you only plan to use just one of the cards.
If your BIOS does not allow to disable Nvidia graphics, you can disable it from the Linux kernel itself. See Hybrid graphics#Fully power down discrete GPU.
Use CUDA without switching the rendering provider
You can use CUDA without switching rendering to the Nvidia graphics. All you need to do is ensure that the Nvidia card is powered on before starting a CUDA application, see Hybrid graphics#Fully power down discrete GPU for details.
Now when you start a CUDA application, it will automatically load all necessary kernel modules. Before turning off the Nvidia card after using CUDA, the
nvidia kernel modules have to be unloaded first:
# rmmod nvidia_uvm # rmmod nvidia
Use NVIDIA graphics only
The proprietary NVIDIA driver can be configured to be the primary rendering provider. It also has notable screen-tearing issues unless you enable prime sync by enabling NVIDIA#DRM kernel mode setting, see  for further information. It does allow use of the discrete GPU and has (as of January 2017) a marked edge in performance over the nouveau driver.
First, install the NVIDIA driver and . Then, configure
/etc/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf the options of which will be combined with the package provided
/usr/share/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf to provide compatibility with this setup.
Section "OutputClass" Identifier "intel" MatchDriver "i915" Driver "modesetting" EndSection Section "OutputClass" Identifier "nvidia" MatchDriver "nvidia-drm" Driver "nvidia" Option "AllowEmptyInitialConfiguration" Option "PrimaryGPU" "yes" ModulePath "/usr/lib/nvidia/xorg" ModulePath "/usr/lib/xorg/modules" EndSection
Next, add the following two lines to the beginning of your
xrandr --setprovideroutputsource modesetting NVIDIA-0 xrandr --auto
Now reboot to load the drivers, and X should start.
If your display dpi is not correct add the following line:
xrandr --dpi 96
If you get a black screen when starting X, make sure that there are no ampersands after the two
xrandr commands in
~/.xinitrc. If there are ampersands, it seems that the window manager can run before the
xrandr commands finish executing, leading to a black screen.
If you are using a display manager then you will need to create or edit a display setup script for your display manager instead of using
For the LightDM display manager:
#!/bin/sh xrandr --setprovideroutputsource modesetting NVIDIA-0 xrandr --auto
Make the script executable.
Now configure lightdm to run the script by editing the
[Seat:*] section in
Now reboot and your display manager should start.
xrandr --setprovideroutputsource modesetting NVIDIA-0 xrandr --auto
For the GDM display manager create two new .desktop files:
[Desktop Entry] Type=Application Name=Optimus Exec=sh -c "xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto" NoDisplay=true X-GNOME-Autostart-Phase=DisplayServer
Make sure that GDM use X as default backend.
You can check if the NVIDIA graphics are being used by installingand running
$ glxinfo | grep NVIDIA
For more information, look at NVIDIA's official page on the topic .
Use switchable graphics
Using PRIME render offload
This is the official NVIDIA method to support switchable graphics.
See PRIME#PRIME render offload for details.
See Optimus-manager upstream documentation. It covers both installation and configuration in Arch Linux systems.
See EnvyControl upstream documentation. It covers both installation and usage instructions.
See NVidia-eXec upstream documentation. It covers both installation and usage instructions.
See nvidia-switch upstream documentation. It covers both installation and usage instructions.
Enable DRM kernel mode setting, which will in turn enable the PRIME synchronization and fix the tearing.
You can read the official forum thread for details.
Failed to initialize the NVIDIA GPU at PCI:1:0:0 (GPU fallen off the bus / RmInitAdapter failed!)
Resolution, screen scan wrong. EDID errors in Xorg.log
This is due to the NVIDIA driver not detecting the EDID for the display. You need to manually specify the path to an EDID file or provide the same information in a similar way.
To provide the path to the EDID file edit the Device Section for the NVIDIA card in Xorg.conf, adding these lines and changing parts to reflect your own system:
Section "Device" Option "ConnectedMonitor" "CRT-0" Option "CustomEDID" "CRT-0:/sys/class/drm/card0-LVDS-1/edid" Option "IgnoreEDID" "false" Option "UseEDID" "true" EndSection
If Xorg will not start try swapping out all references of CRT to DFB.
card0 is the identifier for the Intel card to which the display is connected via LVDS. The edid binary is in this directory. If the hardware arrangement is different, the value for CustomEDID might vary but yet this has to be confirmed. The path will start in any case with
Alternatively you can generate your edid with tools like
Wrong resolution without EDID errors
Using nvidia-xconfig, incorrect information might be generated in
xorg.conf and in particular wrong monitor refresh rates that restrict the possible resolutions. Try commenting out the
VertRefresh lines. If this helps, you can probably also remove everything else not mentioned in this article.
Lockup issue (lspci hangs)
Symptoms: lspci hangs, system suspend fails, shutdown hangs, optirun hangs.
Applies to: newer laptops with GTX 965M or alike when bbswitch (e.g. via Bumblebee) or nouveau is in use.
When the dGPU power resource is turned on, it may fail to do so and hang in ACPI code (kernel bug 156341).
When using nouveau, disabling runtime power-management stops it from changing the power state, thus avoiding this issue.
To disable runtime power-management, add
nouveau.runpm=0 to the kernel parameters.
For known model-specific workarounds, see this issue.
In other cases you can try to boot with
acpi_osi="!Windows 2015" or
acpi_osi=! acpi_osi="Windows 2009" added to your Kernel parameters. (Consider reporting your laptop to that issue.)
No screens found on a laptop/NVIDIA Optimus
$ lspci | grep VGA
outputs something similar to:
00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 02) 01:00.0 VGA compatible controller: nVidia Corporation Device 0df4 (rev a1)
NVIDIA drivers now offer Optimus support since 319.12 Beta  with kernels above and including 3.9.