Difference between revisions of "Hybrid graphics"

From ArchWiki
Jump to: navigation, search
m (Solutions So Far: do not suggest specific aur helpers)
(update Pkg/AUR templates)
(Tag: wiki-scripts)
 
(89 intermediate revisions by 32 users not shown)
Line 1: Line 1:
[[Category:Graphics_(English)]]
+
[[Category:Graphics]]
{{Stub}}
+
[[ja:ハイブリッドグラフィック]]
{{i18n|Hybrid graphics}}
+
[[tr:Hibrit Grafik Teknolojileri]]
 +
[[zh-hans:Hybrid graphics]]
 +
Hybrid-graphics is a concept involving two graphics cards on same computer. The laptop manufacturers developed new technologies involving two graphic cards in an single computer, with different abilities and power consumptions. Hybrid-graphics is developed to support both high performance and power saving usages.
  
''Hybrid-graphics is a concept involving two graphics cards on same computer, it was first designed to control power consumption in laptops and is extending to desktop computers as well''
+
There are a variety of technologies and each manufacturer developed its own solution to this problem. This technology is well supported on Windows but it's still quite experimental with Linux distributions. Here we try to explain a little about each approach and models and some community solutions to the lack of GNU/Linux systems support.
  
== About Hybrid-graphics Technologies ==
+
== First Generation Hybrid Model (Basic Switching) ==
 +
{{Note|1=Unless your notebook is from the last decade, it’s most likely using [[#Dynamic Switching Model|dynamic switching]].}}
 +
The first generation of notebooks with hybrid graphics follow an approach that involves a two graphic card setup with a hardware multiplexer ([[Wikipedia:Multiplexer|MUX]]). It allows power save and low-end 3D rendering by using an Integrated Graphics Processor (IGP); or a major power consumption with 3D rendering performance using a Dedicated/Discrete Graphics Processor (DGP). This model makes the user choose (at boot time or at login time) within the two power/graphics profiles and is almost fixed through all the user session. The switch is done by a similar workflow:
  
The laptop manufacturers developed new technologies involving two graphic cards in an single computer, enabling both high performance and power saving usages. This technology is well supported on Windows but it's still quite experimental with Linux distributions.
 
 
We call hybrid graphics a set of two graphic cards with different abilities and power consumptions. There are a variety of technologies and each manufacturer developed it's own solution to this problem. Here we try to explain a little about each approach and models and some community solutions to the lack of GNU/Linux systems support.
 
 
== The "Old" Hybrid Model (Basic Switching) ==
 
 
This approach involves a two graphic card setup with a hardware multiplexer ([[Wikipedia:Multiplexer|MUX]]). It allows power save and low-end 3D rendering by using an Integrated Graphics Processor (IGP); or a major power consumption with 3D rendering performance using a Dedicated Graphics Processor (DGP). This model makes the user choose (at boot time or at login time) within the two power/graphics profiles and is almost fixed through all the user session. The switch is done by a similar workflow:
 
 
* Turn off the display
 
* Turn off the display
 
* Turn on the DGP
 
* Turn on the DGP
 
* Switch the multiplexer
 
* Switch the multiplexer
 
* Turn off the IGP
 
* Turn off the IGP
* Turn on agin the display
+
* Turn the display on again
 +
 
 
This switch is somewhat rough and adds some blinks and black screens in laptops that could do it "on the fly". Later approaches made the transition a little more user-friendly.
 
This switch is somewhat rough and adds some blinks and black screens in laptops that could do it "on the fly". Later approaches made the transition a little more user-friendly.
  
== The New Dynamic Switching Model ==
+
== Dynamic Switching Model ==
 +
 
 +
{{Note|This model is utilized by most manufacturers as of 2016.}}
  
Most of the new Hybrid-graphics technologies involves two graphic cards as the basic switching but now the DGP and IGP are plugged to a framebuffer and there is no hardware multiplexer. The IGP is always on and the DGP is switched on/off when there is a need in power-save or performance-rendering. In most cases there is no way to use ''only'' the DGP and all the switching and rendering is controlled by software.
+
Most of the new Hybrid-graphics technologies involve two graphic cards as the [[#First Generation Hybrid Model (Basic Switching)|basic switching]] but now the DGP and IGP are plugged to a framebuffer and there is no hardware multiplexer. The IGP is always on and the DGP is switched on/off when there is a need in power-save or performance-rendering. In most cases there is no way to use ''only'' the DGP and all the switching and rendering is controlled by software.
 
At startup, the Linux kernel starts using a video mode and setting up low-level graphic drivers which will be used by the applications. Most of the Linux distributions then use X.org to create a graphical environment. Finally, a few other softwares are launched, first a login manager and then a window manager, and so on. This hierarchical system has been designed to be used in most of cases on a single graphic card.
 
At startup, the Linux kernel starts using a video mode and setting up low-level graphic drivers which will be used by the applications. Most of the Linux distributions then use X.org to create a graphical environment. Finally, a few other softwares are launched, first a login manager and then a window manager, and so on. This hierarchical system has been designed to be used in most of cases on a single graphic card.
  
=== Nvidia Optimus ===
+
{{Note|1=<br/>Read [[NVIDIA Optimus]] and [[Bumblebee]] for details about NVidia using hybrid graphics with NVidia’s proprietary driver.<br/>Read [[PRIME]] basically everything else (like AMD Radeon and NVidia GPUs with Nouveau driver).}}
 
 
[http://www.nvidia.com/object/LO_optimus_whitepapers.html Nvidia Optimus Whitepaper]
 
 
 
==== Current Problems ====
 
 
 
* Switching between cards when possible.
 
* Switching on/off the discrete card.
 
* Be able to use the discrete card for 3D render.
 
* Be able to use both cards for 3D render (problem arised in [https://bbs.archlinux.org/viewtopic.php?id=120994 this post]).
 
 
 
==== Software Solutions So Far ====
 
 
 
* [[asus_switcheroo]] -- a solution for Intel/Nvidia switching on ASUS and other laptops with a similar hardware mux -- by Alex Williamson
 
* [[byo_switcheroo]] -- a solution to build your own handler (like acpi_call) to switch between cards with vga_switcheroo -- by Alex Williamson
 
* [http://en.gentoo-wiki.com/wiki/Vga_switcheroo vga_switcheroo] -- the original GPU switching solution primarily for Intel/ATI notebooks -- by David Airlie
 
* [[acpi_call]] -- allows you to switch off discrete graphics card to improve battery life -- by Michal Kottman
 
* [[PRIME]] -- long-term Optimus solution in progress -- by David Airlie
 
* [[Bumblebee]] -- allows you to run specific programs on the discrete graphic card, inside of an X session using the integrated graphic card. Works on Nvidia Optimus cards -- by Martin Juhl
 
* [[hybrid-windump]] -- dump window using Nvidia onto Intel display -- by Florian Berger and Joakim Gebart
 
  
=== ATI Dynamic Switchable Graphics ===
+
=== Fully Power Down Discrete GPU ===
  
This is a new technology similar to the one of Nvidia. There is no hardware multiplexer and gone into the market a few weeks/months ago.  
+
You may want to turn off the high-performance graphics processor to save battery power, this can be done by installing the {{pkg|acpi_call}} package.
  
==== Current Problems ====
+
{{Tip|For kernels not in the [[Official repositories]], the {{Pkg|acpi_call-dkms}} is an alternative. See also [[DKMS]].}}
  
''To be filled''
+
Once installed load the kernel module:
  
==== Solutions So Far ====
+
# modprobe acpi_call
  
Right now, the best solution is vga_switcheroo with combination of opensource drivers for your ATi and Intel graphics.
+
With the kernel module loaded run the following:
  
* '''Manual method'''
+
# /usr/share/acpi_call/examples/turn_off_gpu.sh
Make sure you have installed drivers. Run in terminal:
 
  
$ pacman -Q | grep -E "xf86-video-ati|xf86-video-intel"
+
This script will go through all the known data buses and attempt to turn them off. You will get an output similar to the following:
  
In case you get output similar to this:
+
Trying \_SB.PCI0.P0P1.VGA._OFF: failed
 +
Trying \_SB.PCI0.P0P2.VGA._OFF: failed
 +
Trying \_SB_.PCI0.OVGA.ATPX: failed
 +
Trying \_SB_.PCI0.OVGA.XTPX: failed
 +
Trying \_SB.PCI0.P0P3.PEGP._OFF: failed
 +
Trying \_SB.PCI0.P0P2.PEGP._OFF: failed
 +
Trying \_SB.PCI0.P0P1.PEGP._OFF: failed
 +
Trying \_SB.PCI0.MXR0.MXM0._OFF: failed
 +
Trying \_SB.PCI0.PEG1.GFX0._OFF: failed
 +
Trying \_SB.PCI0.PEG0.GFX0.DOFF: failed
 +
Trying \_SB.PCI0.PEG1.GFX0.DOFF: failed
 +
'''Trying \_SB.PCI0.PEG0.PEGP._OFF: works!'''
 +
Trying \_SB.PCI0.XVR0.Z01I.DGOF: failed
 +
Trying \_SB.PCI0.PEGR.GFX0._OFF: failed
 +
Trying \_SB.PCI0.PEG.VID._OFF: failed
 +
Trying \_SB.PCI0.PEG0.VID._OFF: failed
 +
Trying \_SB.PCI0.P0P2.DGPU._OFF: failed
 +
Trying \_SB.PCI0.P0P4.DGPU.DOFF: failed
 +
Trying \_SB.PCI0.IXVE.IGPU.DGOF: failed
 +
Trying \_SB.PCI0.RP00.VGA._PS3: failed
 +
Trying \_SB.PCI0.RP00.VGA.P3MO: failed
 +
Trying \_SB.PCI0.GFX0.DSM._T_0: failed
 +
Trying \_SB.PCI0.LPC.EC.PUBS._OFF: failed
 +
Trying \_SB.PCI0.P0P2.NVID._OFF: failed
 +
Trying \_SB.PCI0.P0P2.VGA.PX02: failed
 +
Trying \_SB_.PCI0.PEGP.DGFX._OFF: failed
 +
Trying \_SB_.PCI0.VGA.PX02: failed
  
xf86-video-ati 6.14.1-1
+
See the "works"? This means the script found a bus which your GPU sits on and it has now turned off the chip. To confirm this, your battery time remaining should have increased.
xf86-video-intel 2.15.0-2
 
  
you're good to go. In other case install drivers:
+
{{Note|To turn the GPU back on just reboot.}}
  
$ pacman -S xf86-video-ati xf86-video-intel
+
Currently, the chip will turn back on with the next reboot. To get around this, add the kernel module to the array of modules to load at boot:
  
'''DO NOT''' reboot your computer! In most cases system '''won't boot''' with both drivers installed. Blacklist radeon module:
+
{{hc|/etc/modules-load.d/acpi_call.conf|
 +
#Load 'acpi_call.ko' at boot.
  
$ echo > /etc/modprobe.d/radeon.conf blacklist\ radeon
+
acpi_call}}
  
This will prevent system from hanging during boot. vga_switcheroo works only with radeon module loaded. To load radeon automatically on system startup open {{Filename|/etc/rc.local}} and add line:
+
To turn off the GPU at boot we could just run the above script but honestly that is not very elegant so instead lets make use of systemd's tmpfiles.  
  
modprobe radeon
+
{{hc|/etc/tmpfiles.d/acpi_call.conf|
  
optionally, you can turn off radeon right after system boot to save some battery energy and cool down your laptop. To do this, add following line to {{Filename|/etc/rc.local}}:
+
w /proc/acpi/call - - - - \\_SB.PCI0.PEG0.PEGP._OFF}}
  
echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
+
The above config will be loaded at boot by systemd. What it does is write the specific OFF signal to the {{ic|/proc/acpi/call}} file. Obviously, replace the {{ic|\_SB.PCI0.PEG0.PEGP._OFF}} with the one which works on your system (please note that you need to escape the backslash).
* '''AUR method'''
 
Get it from: [http://aur.archlinux.org/packages.php?ID=51704 hybrid-video-ati-intel AUR package]
 
  
== See Also ==
+
{{Tip| If you are experiencing trouble hibernating or suspending the system after disabling the GPU, try to enable it again by sending the corresponding acpi_call. See also [[Power_management#Suspend.2Fresume_service_files|Suspend/resume service files]].}}
* [http://linux-hybrid-graphics.blogspot.com Linux Hybrid-Graphics Blog]
 
* [http://hybrid-graphics-linux.tuxfamily.org/index.php Hybrid graphics on Linux Wiki]
 
* [http://www.nvidia.com/object/optimus_technology.html Nvidia Optimus commercial presentation]
 
* [http://www.amd.com/us/products/technologies/switchable-graphics/Pages/dynamic-switchable-graphics.aspx ATI commercial presentation]
 
* [[Bumblebee|ArchWiki Article on Bumblebee]]
 

Latest revision as of 21:57, 3 December 2017

Hybrid-graphics is a concept involving two graphics cards on same computer. The laptop manufacturers developed new technologies involving two graphic cards in an single computer, with different abilities and power consumptions. Hybrid-graphics is developed to support both high performance and power saving usages.

There are a variety of technologies and each manufacturer developed its own solution to this problem. This technology is well supported on Windows but it's still quite experimental with Linux distributions. Here we try to explain a little about each approach and models and some community solutions to the lack of GNU/Linux systems support.

First Generation Hybrid Model (Basic Switching)

Note: Unless your notebook is from the last decade, it’s most likely using dynamic switching.

The first generation of notebooks with hybrid graphics follow an approach that involves a two graphic card setup with a hardware multiplexer (MUX). It allows power save and low-end 3D rendering by using an Integrated Graphics Processor (IGP); or a major power consumption with 3D rendering performance using a Dedicated/Discrete Graphics Processor (DGP). This model makes the user choose (at boot time or at login time) within the two power/graphics profiles and is almost fixed through all the user session. The switch is done by a similar workflow:

  • Turn off the display
  • Turn on the DGP
  • Switch the multiplexer
  • Turn off the IGP
  • Turn the display on again

This switch is somewhat rough and adds some blinks and black screens in laptops that could do it "on the fly". Later approaches made the transition a little more user-friendly.

Dynamic Switching Model

Note: This model is utilized by most manufacturers as of 2016.

Most of the new Hybrid-graphics technologies involve two graphic cards as the basic switching but now the DGP and IGP are plugged to a framebuffer and there is no hardware multiplexer. The IGP is always on and the DGP is switched on/off when there is a need in power-save or performance-rendering. In most cases there is no way to use only the DGP and all the switching and rendering is controlled by software. At startup, the Linux kernel starts using a video mode and setting up low-level graphic drivers which will be used by the applications. Most of the Linux distributions then use X.org to create a graphical environment. Finally, a few other softwares are launched, first a login manager and then a window manager, and so on. This hierarchical system has been designed to be used in most of cases on a single graphic card.

Note:
Read NVIDIA Optimus and Bumblebee for details about NVidia using hybrid graphics with NVidia’s proprietary driver.
Read PRIME basically everything else (like AMD Radeon and NVidia GPUs with Nouveau driver).

Fully Power Down Discrete GPU

You may want to turn off the high-performance graphics processor to save battery power, this can be done by installing the acpi_call package.

Tip: For kernels not in the Official repositories, the acpi_call-dkms is an alternative. See also DKMS.

Once installed load the kernel module:

# modprobe acpi_call

With the kernel module loaded run the following:

# /usr/share/acpi_call/examples/turn_off_gpu.sh

This script will go through all the known data buses and attempt to turn them off. You will get an output similar to the following:

Trying \_SB.PCI0.P0P1.VGA._OFF: failed
Trying \_SB.PCI0.P0P2.VGA._OFF: failed
Trying \_SB_.PCI0.OVGA.ATPX: failed
Trying \_SB_.PCI0.OVGA.XTPX: failed
Trying \_SB.PCI0.P0P3.PEGP._OFF: failed
Trying \_SB.PCI0.P0P2.PEGP._OFF: failed
Trying \_SB.PCI0.P0P1.PEGP._OFF: failed
Trying \_SB.PCI0.MXR0.MXM0._OFF: failed
Trying \_SB.PCI0.PEG1.GFX0._OFF: failed
Trying \_SB.PCI0.PEG0.GFX0.DOFF: failed
Trying \_SB.PCI0.PEG1.GFX0.DOFF: failed
Trying \_SB.PCI0.PEG0.PEGP._OFF: works!
Trying \_SB.PCI0.XVR0.Z01I.DGOF: failed
Trying \_SB.PCI0.PEGR.GFX0._OFF: failed
Trying \_SB.PCI0.PEG.VID._OFF: failed
Trying \_SB.PCI0.PEG0.VID._OFF: failed
Trying \_SB.PCI0.P0P2.DGPU._OFF: failed
Trying \_SB.PCI0.P0P4.DGPU.DOFF: failed
Trying \_SB.PCI0.IXVE.IGPU.DGOF: failed
Trying \_SB.PCI0.RP00.VGA._PS3: failed
Trying \_SB.PCI0.RP00.VGA.P3MO: failed
Trying \_SB.PCI0.GFX0.DSM._T_0: failed
Trying \_SB.PCI0.LPC.EC.PUBS._OFF: failed
Trying \_SB.PCI0.P0P2.NVID._OFF: failed
Trying \_SB.PCI0.P0P2.VGA.PX02: failed
Trying \_SB_.PCI0.PEGP.DGFX._OFF: failed
Trying \_SB_.PCI0.VGA.PX02: failed

See the "works"? This means the script found a bus which your GPU sits on and it has now turned off the chip. To confirm this, your battery time remaining should have increased.

Note: To turn the GPU back on just reboot.

Currently, the chip will turn back on with the next reboot. To get around this, add the kernel module to the array of modules to load at boot:

/etc/modules-load.d/acpi_call.conf
#Load 'acpi_call.ko' at boot.

acpi_call

To turn off the GPU at boot we could just run the above script but honestly that is not very elegant so instead lets make use of systemd's tmpfiles.

/etc/tmpfiles.d/acpi_call.conf

w /proc/acpi/call - - - - \\_SB.PCI0.PEG0.PEGP._OFF

The above config will be loaded at boot by systemd. What it does is write the specific OFF signal to the /proc/acpi/call file. Obviously, replace the \_SB.PCI0.PEG0.PEGP._OFF with the one which works on your system (please note that you need to escape the backslash).

Tip: If you are experiencing trouble hibernating or suspending the system after disabling the GPU, try to enable it again by sending the corresponding acpi_call. See also Suspend/resume service files.