「ハイブリッドグラフィック」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(同期)
 
(6人の利用者による、間の12版が非表示)
1行目: 1行目:
 
[[Category:グラフィック]]
 
[[Category:グラフィック]]
 
[[en:Hybrid graphics]]
 
[[en:Hybrid graphics]]
  +
[[ru:Hybrid graphics]]
[[tr:Hibrit_Grafik_Teknolojileri]]
 
  +
[[zh-hans:Hybrid graphics]]
  +
{{Related articles start}}
  +
{{Related|NVIDIA Optimus}}
  +
{{Related|PRIME}}
  +
{{Related|Xorg}}
  +
{{Related|外付け GPU}}
  +
{{Related articles end}}
  +
ハイブリッドグラフィックスは同一のコンピュータで2つのグラフィックカードを動作させるというコンセプトです。ノート PC の製造業者たちは、性能と電力消費量の異なる2つのグラフィックカードを単一のコンピュータ上で使用する技術を開発しました。ハイブリッドグラフィックスでは、専用 GPU (ディスクリート GPU) を非アクティブにしておいて、統合 GPU よりも 3D 描画パフォーマンスが要求される場合にアクティブ化させることで、高パフォーマンスなユースケースと省電力なユースケースの両方をサポートするように開発されています。
   
  +
様々なテクノロジーが存在しており、この問題を解決するために個々のメーカーによって独自の方法が開発されています。このテクノロジーは Windows ではしっかりとサポートされていますが、Linux ディストリビューションでは未だ実験的な段階です。このページでは、それぞれのアプローチとモデルについて軽く説明し、そしてベンダーによる GNU/Linux システムのサポートが無いことに対するコミュニティによるソリューションを紹介します。
ハイブリッドグラフィックは同一のコンピュータで2つのグラフィックカードを動作させるというコンセプトで、始めはノートパソコンの電力消費量を抑える目的で構想され、今ではデスクトップのコンピュータにも拡張されています。
 
   
  +
{{Note|あなたの環境が 2010 年より前のものでない限り、システムは動的切り替えモデルを使用している可能性が高いです。以前のハイブリッドグラフィクスのソリューションでは、効果を発揮させるために再起動か、再ログインが必要なグラフィックスタック全体の再起動が必要でした。}}
== ハイブリッドグラフィックのテクノロジーについて ==
 
   
  +
== 動的切り替え ==
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.
 
   
  +
新しいハイブリッドグラフィック技術のほとんどは2つのグラフィクカードを使用します: 専用 GPU と統合 GPU はフレームバッファに接続されていて、ハードウェアのマルチプレクサは存在しません。統合 GPU は常にオンになっており、省電力と構成のレンダリングのどちらが必要とされているのかに合わせて 専用 GPU はオン/オフが切り替えられます。ほとんどの場合、専用 GPU ''のみ''を使用するための方法は存在せず、GPU のオン/オフとレンダリングは全てソフトウェアによって制御されます。
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 its 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.
 
   
  +
起動時に Linux カーネルは、あるビデオモードを使って起動し、アプリケーションによって使用される低レベルなグラフィックドライバをセットアップします。そして、ほとんどの Linux ディストリビューションは X.org を使用してグラフィク環境を整えます。最後に、いくつかの他のソフトウェアが起動されます: 最初にログインマネージャで、その次にウィンドウマネージャと言った具合です。このような階層的なシステムは、単一のグラフィックカードを使用する場合を想定して設計されています。
== "旧式"のハイブリッドモデル (ベーシックな切り替え) ==
 
   
  +
{{Note|NVIDIA のプロプライエタリドライバーを使用するハイブリッドグラフィックについては [[NVIDIA Optimus]] や [[Bumblebee]] を読んでください。その他 (AMD を使う場合や、[[nouveau]] で NVIDIA GPU を使う場合) については基本的に [[PRIME]] を読んでください。}}
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/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:
 
   
  +
=== ディスクリート GPU の完全な電源オフ ===
* Turn off the display
 
* Turn on the DGP
 
* Switch the multiplexer
 
* Turn off the IGP
 
* Turn on again the display
 
   
  +
バッテリー節約のために高性能なグラフィックプロセッサをオフにしたい場合があるでしょう。
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.
 
   
  +
==== BIOS/UEFI を使う ====
== 新しい動的な切り替えモデル ==
 
   
  +
一部のノート PC のメーカーは、BIOS または UEFI に専用カードのオン/オフのためのオプションを提供しています。
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.
 
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 ===
+
==== udev ルールを使う ====
   
  +
まず、ディスプレイマネージャ設定から NVIDIA に関する設定を全て取り除いてください。
[http://www.nvidia.com/object/LO_optimus_whitepapers.html Nvidia Optimus Whitepaper]
 
   
  +
以下のファイルを作成して nouveau ドライバをブラックリストに追加してください:
==== 現状の問題 ====
 
   
  +
{{hc|/etc/modprobe.d/blacklist-nouveau.conf|2=
* Switching between cards when possible.
 
  +
blacklist nouveau
* Switching on/off the discrete card.
 
  +
options nouveau modeset=0
* 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]).
 
   
  +
そして、以下のルールを追加してください:
==== ソフトウェアによるソリューション ====
 
   
  +
{{hc|/etc/udev/rules.d/00-remove-nvidia.rules|2=
* '''asus_switcheroo''' -- a solution for Intel/Nvidia switching on ASUS and other laptops with a similar hardware mux -- by Alex Williamson
 
  +
# Remove NVIDIA USB xHCI Host Controller devices, if present
* '''byo_switcheroo''' -- a solution to build your own handler (like acpi_call) to switch between cards with vga_switcheroo -- by Alex Williamson
 
  +
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{power/control}="auto", ATTR{remove}="1"
* [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
 
   
  +
# Remove NVIDIA USB Type-C UCSI devices, if present
=== ATI Dynamic Switchable Graphics ===
 
  +
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{power/control}="auto", ATTR{remove}="1"
   
  +
# Remove NVIDIA Audio devices, if present
This is a new technology similar to the one of Nvidia as it uses no hardware multiplexer.
 
  +
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{power/control}="auto", ATTR{remove}="1"
   
  +
# Remove NVIDIA VGA/3D controller devices
==== 現状の問題 ====
 
  +
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", ATTR{power/control}="auto", ATTR{remove}="1"
  +
}}
   
  +
再起動し、{{ic|lspci}} を実行して NVIDIA GPU が存在しているか確認してください。
The Dynamic Switch needs Xorg support for the discrete videocard assigned for rendering to work [http://www.x.org/wiki/RadeonFeature#fnref-e188f8b793017f6c1c15025dc3d042a1e560915e].
 
So, rendering on the discrete gpu will not work until the Xorg team adds support for it.
 
   
  +
==== bbswitch を使う ====
This means that with a muxless intel+ati design, you cannot use your discrete card by simply modprobing the radeon module.
 
   
  +
NVIDIA GPU を使っている場合、[[bbswitch]] を使うことでより安全に電源の制御が行なえます。[[bbswitch]] は、ディスクリート GPU が必要とされていない時やブート時にその GPU を無効化する適切な ACPI 呼び出しを自動的に発行するカーネルパッケージで構成されています。
As of now, there are 3 choices:
 
   
  +
{{Note|カーネル 4.8 以降、PCI-E ポート電源管理の方法では bbswitch は機能しません。詳細は [[Bumblebee#カーネル 4.8 で電源管理が機能しない]] を参照してください。}}
- Disable the discrete card and use only the intel igpu. '''This is not needed for kernels version >= 3.12 with radeon DPM enabled'''; the open source graphics driver manages the card automatically. For kernels older than 3.12, see the solution below.
 
   
  +
==== acpi_call を使う ====
- Test and improve some virtualGL based program to make the switch, like the common-amd branch of bumblebee project. Check the [https://github.com/Bumblebee-Project/Bumblebee/issues/52 project repository] and [http://forums.gentoo.org/viewtopic-t-909802.html this] useful post.
 
   
  +
bbswitch によってサポートされていない GPU においては、{{pkg|acpi_call}} パッケージで同じことを手動で行うことができます。
- Use the proprietary driver with powerxpress (a.k.a. pxp) support maintained by [[AMD_Catalyst#Installing_from_the_AUR|Vi0l0]] (remember to check for xorg compatibility).
 
   
  +
{{Tip|[[公式リポジトリ]]に含まれていないカーネルを使っている場合、代わりに {{Pkg|acpi_call-dkms}} を使ってください。[[DKMS]] も見てください。}}
==== radeon の動的電源管理を有効にしないカーネル3.12未満のソリューション ====
 
   
  +
パッケージをインストールしたら、{{ic|acpi_call}} カーネルモジュールをロードしてください:
{{Warning| This method, on a mux-less system, works only to shutdown the radeon card. This will not enable rendering on the radeon gpu. See [[#現状の問題_2|Current Problems]] section above for detail.
 
}}
 
   
  +
# modprobe acpi_call
'''This solution is not needed on kernel version >= 3.12''' because the opensource driver automatically manages the power of the radeon gpu, so there is no need to manage the cards from userspace.
 
   
  +
カーネルモジュールをロードしたら、{{ic|/usr/share/acpi_call/examples/turn_off_gpu.sh}} スクリプトを実行してください。
This means that on kernels >= 3.12, vgaswitcheroo is not needed anymore to turn off the discrete gpu, only if you wish to verify the power state.
 
   
  +
このスクリプトは、既知のデータバスを全て走査し、それらの電源を切ろうと試みます。この際、以下のように出力されます:
If you have kernel >= 3.12 with vgaswitcheroo enabled, you can verify if the driver automatically shut down the discrete gpu
 
   
  +
{{hc|# /usr/share/acpi_call/examples/turn_off_gpu.sh|
# cat /sys/kernel/debug/vgaswitcheroo/switch
 
  +
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}}
   
  +
"works" は、スクリプトが GPU に接続されているバスを発見して、チップをオフにしたことを意味します。バッテリーの残り時間が伸びていることから、これを確認できるはずです。
The output should be similar to this, where DIS is the radeon discrete gpu and IGD the intel gpu. DynOff means the radeon driver automatically powered off the discrete gpu.
 
   
  +
{{Tip|GPU を無効化した後に、システムのハイバーネートやサスペンドで問題があった場合には、適切な acpi_call を送出して有効化させてみてください。[[電源管理#サスペンド/リジュームのサービスファイル]] も参照してください。}}
0:DIS: :DynOff:0000:01:00.0
 
1:IGD:+:Pwr:0000:00:02.0
 
   
  +
===== GPU の電源を自動的にオフにする =====
If you are using kernels older than 3.12 then you can use vga_switcheroo with a combination of opensource drivers to disable the radeon card from userspace at boot.
 
   
  +
上記のままでは GPU プロセッサは再起動によって元に戻ります。これに対応するために、[[カーネルモジュール#モジュールの自動ロード|ブート時にモジュールをロード]]してください:
To do this, follow the instructions below.
 
   
  +
{{hc|/etc/modules-load.d/acpi_call.conf|
* '''Preliminaries'''
 
  +
#Load 'acpi_call.ko' at boot.
  +
acpi_call
  +
}}
   
  +
====== 起動時 ======
Make sure you have installed the drivers. Run in terminal:
 
   
  +
起動時に GPU をオフにしたい場合、[[systemd-tmpfiles]] を使うことが可能です。
$ pacman -Q | grep -E "xf86-video-ati|xf86-video-intel"
 
   
  +
{{hc|/etc/tmpfiles.d/acpi_call.conf|
In case you get output similar to this:
 
   
  +
w /proc/acpi/call - - - - ''\\_SB.PCI0.PEG0.PEGP._OFF''}}
xf86-video-ati 6.14.1-1
 
xf86-video-intel 2.15.0-2
 
   
  +
上記の設定は起動時に systemd によってロードされます。これは、特定の OFF シグナルを {{ic|/proc/acpi/call}} ファイルに書き込んで電源を切っています。もちろん、{{ic|\_SB.PCI0.PEG0.PEGP._OFF}} の部分は適当な値に置き換えてください (バックスラッシュでエスケープする必要があります)。
you are good to go. In other case install drivers:
 
   
  +
====== X サーバ初期化後 ======
# pacman -S xf86-video-ati xf86-video-intel
 
   
  +
一部のシステムでは、ディスクリート GPU を X サーバの初期化の前に電源オフにすることで、システムがハングするかもしれません。このような場合、X サーバの初期化が終わった後に GPU の電源を落すのがよいでしょう。これはいくつかのディスプレイマネージャでは可能で、例えば [[LightDM]] では、''display-setup-script'' seat configuration パラメータが root 権限で実行するスクリプトとして使えて、GPU を無効化することができます。
In order to be able to access vgaswitcheroo add this line to your fstab:
 
   
  +
=== System76 ===
none /sys/kernel/debug debugfs defaults 0 0
 
 
{{Note|{{ic|KMS}} must be activated for both cards, otherwise there will be no vgaswitcheroo in /sys/kernel/debug/ }}
 
 
* '''Automatic radeon shutdown'''
 
 
Systemd can use tmpfiles to shutdown the discrete gpu at boot.
 
 
Important: Make sure the video drivers are loaded in initramfs before systemd calls vga_switcheroo, otherwise a kernel oops/panic may occur.
 
 
First add the drivers to MODULES array in {{ic|/etc/mkinitcpio.conf}}. Adding radeon and i915 yields
 
 
{{hc|/etc/mkinitcpio.conf|
 
MODULES="radeon i915"}}
 
 
Next rebuild initramfs (details at [[initramfs]])
 
 
# mkinitcpio -p linux
 
 
Then create the systemd tmpfile at {{ic|/etc/tmpfiles.d/vgaswitcheroo.conf}}
 
 
{{hc|/etc/tmpfiles.d/vgaswitcheroo.conf|
 
w /sys/kernel/debug/vgaswitcheroo/switch - - - - OFF}}
 
 
Reboot and the discrete gpu should be off by default. It can be powered back on using the manual method described below.
 
 
* '''Manual method'''
 
 
To verify the state of the dgpu
 
 
# cat /sys/kernel/debug/vgaswitcheroo/switch
 
 
Power off the dgpu
 
 
# echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
 
 
Power on
 
 
# echo ON > /sys/kernel/debug/vgaswitcheroo/switch
 
 
=== ディスクリート GPU の完全な電源オフ ===
 
 
You may want to turn off the high-performance graphics processor to save battery power, this can be done by installing the the {{AUR|acpi_call-git}} package from the AUR.
 
 
Once installed load the kernel module:
 
modprobe acpi_call
 
 
With the kernel module loaded run the following (requires root):
 
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. Currently, the chip will turn back on with the next reboot to get around this we do the following:
 
 
{{Note| To turn the GPU back on just reboot.}}
 
 
Add the kernel module to the array of modules to load at boot:
 
 
{{hc|/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.
 
 
{{hc|/etc/tmpfiles.d/acpi_call.conf|
 
   
  +
一部の System76 ラップトップ([[System76 Oryx Pro|Oryx Pro]] など)には独自のハイブリッドグラフィックオプションがあります。これを使うには、{{AUR|system76-power}} をインストールし、{{ic|system76-power.service}} サービスを[[有効化]]して、{{ic|system76-power graphics hybrid}} を実行してください。
w /proc/acpi/call - - - - \_SB.PCI0.PEG0.PEGP._OFF}}
 
   
  +
==== ディスクリート GPU の完全な電源オフ ====
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.
 
   
  +
まず、{{ic|system76-power grahics integrated}} を実行し再起動して、統合グラフィックスモードで動作させてください。統合モードになったら、{{ic|system76-power graphics power off}} を実行してディスクリートグラフィックスカードの電源を落としてください。このコマンドは永続的ではなく、起動する度に実行する必要があります。
{{Note| After every kernel upgrade acpi_call-git will need to be reinstalled.}}
 
   
  +
{{TranslationStatus|Hybrid graphics|2023-08-24|779608}}
== 参照 ==
 
* [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]]
 

2023年8月24日 (木) 17:13時点における最新版

関連記事

ハイブリッドグラフィックスは同一のコンピュータで2つのグラフィックカードを動作させるというコンセプトです。ノート PC の製造業者たちは、性能と電力消費量の異なる2つのグラフィックカードを単一のコンピュータ上で使用する技術を開発しました。ハイブリッドグラフィックスでは、専用 GPU (ディスクリート GPU) を非アクティブにしておいて、統合 GPU よりも 3D 描画パフォーマンスが要求される場合にアクティブ化させることで、高パフォーマンスなユースケースと省電力なユースケースの両方をサポートするように開発されています。

様々なテクノロジーが存在しており、この問題を解決するために個々のメーカーによって独自の方法が開発されています。このテクノロジーは Windows ではしっかりとサポートされていますが、Linux ディストリビューションでは未だ実験的な段階です。このページでは、それぞれのアプローチとモデルについて軽く説明し、そしてベンダーによる GNU/Linux システムのサポートが無いことに対するコミュニティによるソリューションを紹介します。

ノート: あなたの環境が 2010 年より前のものでない限り、システムは動的切り替えモデルを使用している可能性が高いです。以前のハイブリッドグラフィクスのソリューションでは、効果を発揮させるために再起動か、再ログインが必要なグラフィックスタック全体の再起動が必要でした。

動的切り替え

新しいハイブリッドグラフィック技術のほとんどは2つのグラフィクカードを使用します: 専用 GPU と統合 GPU はフレームバッファに接続されていて、ハードウェアのマルチプレクサは存在しません。統合 GPU は常にオンになっており、省電力と構成のレンダリングのどちらが必要とされているのかに合わせて 専用 GPU はオン/オフが切り替えられます。ほとんどの場合、専用 GPU のみを使用するための方法は存在せず、GPU のオン/オフとレンダリングは全てソフトウェアによって制御されます。

起動時に Linux カーネルは、あるビデオモードを使って起動し、アプリケーションによって使用される低レベルなグラフィックドライバをセットアップします。そして、ほとんどの Linux ディストリビューションは X.org を使用してグラフィク環境を整えます。最後に、いくつかの他のソフトウェアが起動されます: 最初にログインマネージャで、その次にウィンドウマネージャと言った具合です。このような階層的なシステムは、単一のグラフィックカードを使用する場合を想定して設計されています。

ノート: NVIDIA のプロプライエタリドライバーを使用するハイブリッドグラフィックについては NVIDIA OptimusBumblebee を読んでください。その他 (AMD を使う場合や、nouveau で NVIDIA GPU を使う場合) については基本的に PRIME を読んでください。

ディスクリート GPU の完全な電源オフ

バッテリー節約のために高性能なグラフィックプロセッサをオフにしたい場合があるでしょう。

BIOS/UEFI を使う

一部のノート PC のメーカーは、BIOS または UEFI に専用カードのオン/オフのためのオプションを提供しています。

udev ルールを使う

まず、ディスプレイマネージャ設定から NVIDIA に関する設定を全て取り除いてください。

以下のファイルを作成して nouveau ドライバをブラックリストに追加してください:

/etc/modprobe.d/blacklist-nouveau.conf
blacklist nouveau
options nouveau modeset=0

そして、以下のルールを追加してください:

/etc/udev/rules.d/00-remove-nvidia.rules
# Remove NVIDIA USB xHCI Host Controller devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{power/control}="auto", ATTR{remove}="1"

# Remove NVIDIA USB Type-C UCSI devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{power/control}="auto", ATTR{remove}="1"

# Remove NVIDIA Audio devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{power/control}="auto", ATTR{remove}="1"

# Remove NVIDIA VGA/3D controller devices
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", ATTR{power/control}="auto", ATTR{remove}="1"

再起動し、lspci を実行して NVIDIA GPU が存在しているか確認してください。

bbswitch を使う

NVIDIA GPU を使っている場合、bbswitch を使うことでより安全に電源の制御が行なえます。bbswitch は、ディスクリート GPU が必要とされていない時やブート時にその GPU を無効化する適切な ACPI 呼び出しを自動的に発行するカーネルパッケージで構成されています。

ノート: カーネル 4.8 以降、PCI-E ポート電源管理の方法では bbswitch は機能しません。詳細は Bumblebee#カーネル 4.8 で電源管理が機能しない を参照してください。

acpi_call を使う

bbswitch によってサポートされていない GPU においては、acpi_call パッケージで同じことを手動で行うことができます。

ヒント: 公式リポジトリに含まれていないカーネルを使っている場合、代わりに acpi_call-dkms を使ってください。DKMS も見てください。

パッケージをインストールしたら、acpi_call カーネルモジュールをロードしてください:

# modprobe acpi_call

カーネルモジュールをロードしたら、/usr/share/acpi_call/examples/turn_off_gpu.sh スクリプトを実行してください。

このスクリプトは、既知のデータバスを全て走査し、それらの電源を切ろうと試みます。この際、以下のように出力されます:

# /usr/share/acpi_call/examples/turn_off_gpu.sh
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

"works" は、スクリプトが GPU に接続されているバスを発見して、チップをオフにしたことを意味します。バッテリーの残り時間が伸びていることから、これを確認できるはずです。

ヒント: GPU を無効化した後に、システムのハイバーネートやサスペンドで問題があった場合には、適切な acpi_call を送出して有効化させてみてください。電源管理#サスペンド/リジュームのサービスファイル も参照してください。
GPU の電源を自動的にオフにする

上記のままでは GPU プロセッサは再起動によって元に戻ります。これに対応するために、ブート時にモジュールをロードしてください:

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

起動時に GPU をオフにしたい場合、systemd-tmpfiles を使うことが可能です。

/etc/tmpfiles.d/acpi_call.conf

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

上記の設定は起動時に systemd によってロードされます。これは、特定の OFF シグナルを /proc/acpi/call ファイルに書き込んで電源を切っています。もちろん、\_SB.PCI0.PEG0.PEGP._OFF の部分は適当な値に置き換えてください (バックスラッシュでエスケープする必要があります)。

X サーバ初期化後

一部のシステムでは、ディスクリート GPU を X サーバの初期化の前に電源オフにすることで、システムがハングするかもしれません。このような場合、X サーバの初期化が終わった後に GPU の電源を落すのがよいでしょう。これはいくつかのディスプレイマネージャでは可能で、例えば LightDM では、display-setup-script seat configuration パラメータが root 権限で実行するスクリプトとして使えて、GPU を無効化することができます。

System76

一部の System76 ラップトップ(Oryx Pro など)には独自のハイブリッドグラフィックオプションがあります。これを使うには、system76-powerAUR をインストールし、system76-power.service サービスを有効化して、system76-power graphics hybrid を実行してください。

ディスクリート GPU の完全な電源オフ

まず、system76-power grahics integrated を実行し再起動して、統合グラフィックスモードで動作させてください。統合モードになったら、system76-power graphics power off を実行してディスクリートグラフィックスカードの電源を落としてください。このコマンドは永続的ではなく、起動する度に実行する必要があります。

翻訳ステータス: このページは en:Hybrid graphics の翻訳バージョンです。最後の翻訳日は 2023-08-24 です。もし英語版に 変更 があれば、翻訳の同期を手伝うことができます。