Version 1.4 of the X Resize, Rotate, and Reflect Extension (RandR 1.4 for short) adds a way for drivers to work together so that one graphics device can display images rendered by another. This can be used on Optimus-based laptops to display a desktop rendered by an NVIDIA GPU on a screen connected to another graphics device, such as an Intel integrated graphics device or a USB-to-VGA adapter.
X.Org X server version 1.13 or higher.
A Linux kernel, version 3.13 or higher, with CONFIG_DRM enabled.
Version 1.4.0 of the xrandr command-line utility.
To use the NVIDIA driver as an RandR 1.4 output source provider,
the X server needs to be configured to use the NVIDIA driver for
its primary screen and to use the “modesetting” driver for the other graphics
device. If X.Org X server version 1.17.2 or higher is installed,
this can be achieved by placing the following in /etc/X11/xorg.conf
:
Section "Module" Load "modesetting" EndSection Section "Device" Identifier "nvidia" Driver "nvidia" BusID "<BusID for NVIDIA device here>" Option "AllowEmptyInitialConfiguration" EndSection
See “What is the format of a PCI Bus ID?” for information on determining the appropriate BusID string for your graphics card.
Older X servers require a slightly more complicated configuration:
Section "ServerLayout" Identifier "layout" Screen 0 "nvidia" Inactive "intel" EndSection Section "Device" Identifier "nvidia" Driver "nvidia" BusID "<BusID for NVIDIA device here>" EndSection Section "Screen" Identifier "nvidia" Device "nvidia" Option "AllowEmptyInitialConfiguration" EndSection Section "Device" Identifier "intel" Driver "modesetting" EndSection Section "Screen" Identifier "intel" Device "intel" EndSection
The X server does not automatically enable displays attached to
the non-NVIDIA graphics device in this configuration. To do that,
use the xrandr
command line
tool:
$ xrandr --setprovideroutputsource modesetting NVIDIA-0 $ xrandr --auto
This pair of commands can be added to your X session startup
scripts, for example by putting them in $HOME/.xinitrc
before running startx
.
Use the
$ xrandr --listproviders
command to query the capabilities of the graphics devices. If
the system requirements are met and the X server is configured
correctly, there should be a provider named NVIDIA-0
with the Source Output
capability and one named
modesetting
with the
Sink Output
capability. If
either provider is missing or doesn't have the expected capability,
check your system configuration.
When running against X.Org X server with video driver ABI 23 or higher, synchronization is supported with compatible drivers. At the time of writing, synchronization is compatible with the “modesetting” driver with Intel devices on Linux version 4.5 or newer. If all requirements are met, synchronization will be used automatically.
An X.Org X server that supports synchronization has yet to be officially released. Without synchronization, displays are prone to “tearing”. See Caveats for details.
If synchronization is being used but is not desired, it can be disabled with:
$ xrandr --output <output> --set "PRIME Synchronization" 0
and re-enabled with:
$ xrandr --output <output> --set "PRIME Synchronization" 1
See Vblank syncing for information on how OpenGL applications can synchronize with sink-provided outputs.
Support for PRIME Synchronization relies on DRM KMS support. See Chapter 33, Direct Rendering Manager Kernel Modesetting (DRM KMS) for more information.
An X.Org X server with video driver ABI 23 or higher has yet to
be released, so synchronization cannot yet be officially supported.
Once released, likely as X.Org X server version 1.19.x, subsequent
drivers will be launched with official support. Despite the lack of
official support, the functionality can be tested using an X server
built from Git commit 2a79be9
.
When running against X.Org X server version 1.18.x or lower, there is no synchronization between the images rendered by the NVIDIA GPU and the output device. This means that the output device can start reading the next frame of video while it is still being updated, producing a graphical artifact known as “tearing”. Tearing is expected due to limitations in the design of the X.Org X server prior to video driver ABI 23.
The NVIDIA driver currently only supports the Source Output
capability. It does not
support render offload and cannot be used as an output sink.
Some versions of the “modesetting” driver try to load a sub-module
called “glamor”, which
conflicts with the NVIDIA GLX implementation. Please ensure that
the libglamoregl.so
X module is not
installed.