「OpenGL」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(英語版から転載)
 
(テンプレート:Expansion を削除)
 
(他の1人の利用者による、間の9版が非表示)
2行目: 2行目:
 
[[Category:開発]]
 
[[Category:開発]]
 
[[en:OpenGL]]
 
[[en:OpenGL]]
From [[wikipedia:OpenGL]]:
+
wikipedia [[wikipedia:ja:OpenGL|OpenGL]] から:
  +
: OpenGL (Open Graphics Library) は、グラフィックスハードウェア向けの2次元/3次元コンピュータグラフィックスライブラリである。SGI 社内で自社の CG ワークステーション向けにクローズドに策定された API 仕様が改良されて公開されています。
: OpenGL (Open Graphics Library) is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics.
 
   
Learn more at [https://www.khronos.org/opengl/ Khronos].
+
詳しくは、[https://www.khronos.org/opengl/ Khronos] をご覧ください。
   
== Installation ==
+
== インストール ==
   
  +
OpenGL を使うアプリケーションを実行するには、あなたのハードウェア(GPU または CPU)用のドライバを [[インストール]] する必要があります。
To run any application that uses OpenGL you will need to [[install]] driver(s) for your hardware (either GPUs or CPUs)
 
   
  +
* {{Pkg|mesa}} はオープンソースの OpenGL 実装で、最新の OpenGL 仕様をサポートするために継続的に更新されています。Intel グラフィックス]]、[[ATI]]、[[AMDGPU|AMD]]、[[AMDGPU PRO|AMD PRO]] および [[NVIDIA]] のためのオープンソースドライバが集められています。また、ソフトウェアラスタライザーも提供します。パッケージに含まれるドライバは以下の通りです。
* {{Pkg|mesa}} is an open-source OpenGL implementation, continually updated to support the latest OpenGL specification. It has a collection of open-source drivers for [[Intel graphics]], [[ATI]], [[AMDGPU|AMD]], [[AMDGPU PRO|AMD PRO]], and [[NVIDIA]] GPUs and also provides software rasterizers, The included drivers in the package are
 
** {{ic|i915}} : for GMA 916G as well as the i830, i845 and i865 integrated GPU series.
+
** {{ic|i915}} : GMA 916G および i830i845i865 統合 GPU シリーズ用です。
** {{ic|i965}} : for Intel's Gen 4 hardware and later. It is officially supported by Intel.
+
** {{ic|i965}} : Intel Gen 4 ハードウェア以降に対応。インテルにより公式にサポートされています。
  +
** {{ic|iris}} : Intel の Gen8 ハードウェア以降に対応。インテルにより公式にサポートされています。
** {{ic|iris}} : for Intel's Gen 8 hardware and later. It is officially supported by Intel.
 
** {{ic|r100}} : for AMD's Radeon R100 GPU series.
+
** {{ic|r100}} : AMD Radeon R100 GPU シリーズ用です。
** {{ic|r200}} : for AMD's Radeon R200 GPU series.
+
** {{ic|r200}} : AMD Radeon R200 GPU シリーズ用。
** {{ic|r300}} : for AMD's Radeon R300, R400, and R500 GPU series.
+
** {{ic|r300}} : AMD Radeon R300, R400, R500 GPU シリーズ用。
** {{ic|r600}} : for AMD's Radeon HD 2000 GPU series and later. It is officially supported by AMD.
+
** {{ic|r600}} : AMD Radeon HD 2000 GPU シリーズ以降に対応。AMD が公式にサポートしています。
** {{ic|radeonsi}} : for AMD's Southern Island GPUs and later. It is officially supported by AMD.
+
** {{ic|radeonsi}} : AMD Southern Island GPU 以降のシリーズ用。AMD が公式にサポートしています。
** {{ic|nouveau}} : [[Nouveau]] is the open-source driver for [[NVIDIA]] GPUs.
+
** {{ic|nouveau}} : [[Nouveau]] [[NVIDIA]] 用のオープンソースドライバです。GPU の場合。
** {{ic|virgl}} : is a virtual GPU driver for sharing a GPU with a host for virtual machines.
+
** {{ic|virgl}} : 仮想マシン用にホストと GPU を共有するための仮想 GPU ドライバです。
** {{ic|svga}} : for VMware virtual GPUs.
+
** {{ic|svga}} : VMware の仮想 GPU 用です。
** {{ic|zink}} : is a Gallium driver, it can be used to run OpenGL on vulkan.
+
** {{ic|zink}} : Gallium ライバで、vulkan 上で OpenGL を動作させることができます。
** {{ic|swrast}} : Legacy software rasterizer.
+
** {{ic|swrast}} : レガシーソフトウェア rasterizer です。
** {{ic|softpipe}} : Software rasterizer, a reference Gallium driver.
+
** {{ic|softpipe}} : ソフトウェア rasterizer、リファレンス Gallium ドライバです。
** {{ic|llvmpipe}} : Software rasterizer, uses LLVM for x86 JIT code generation and is multi-threaded.
+
** {{ic|llvmpipe}} : ソフトウェア rasterizerx86 JIT コード生成に LLVM を使用し、マルチスレッド化されています。
** {{ic|swr}} : High performance software rasterizer that uses AVX and AVX2 CPU instructions, also known as [https://www.openswr.org/ OpenSWR].
+
** {{ic|swr}} : AVX および AVX2 CPU 命令を使用する高性能ソフトウェア rasterizer [https://www.openswr.org/ OpenSWR] としても知られています。
  +
{{Note|mesa に適したドライバが自動的に選択されるはずですので、設定する必要はありません。}}
{{Note|The right driver for mesa should be selected automatically, you do not have to configure it, just install the package.}}
 
   
* {{Pkg|nvidia-utils}} is proprietary driver for [[NVIDIA]] GPUs.
+
* {{Pkg|nvidia-utils}} [[NVIDIA]] GPU 用のプロプライエタリドライバです。
   
* {{AUR|amdgpu-pro-libgl}} is proprietary driver for [[AMDGPU PRO|AMD PRO]] GPUs.
+
* {{AUR|amdgpu-pro-libgl}} [[AMDGPU PRO|AMD PRO]] GPU 用のプロプライエタリドライバです。
   
 
{{Tip|
 
{{Tip|
  +
* AMD (および ATI) では、プロプライエタリなものを使用する非常に強い理由がない限り、オープンソースのドライバを使用することをお勧めします。
* For AMD (and ATI) it is recommended to use the open-source driver unless you have a very strong reason to use proprietary one.
 
  +
* NVIDIA では、プロプライエタリドライバをインストールした方が、新しいカードや一般的なパフォーマンスが向上する場合がほとんどです。}}
* For NVIDIA installing the proprietary driver is mostly better for newer cards or better performance in general.}}
 
   
== Verification ==
+
== 検証 ==
   
To verify your OpenGL installation you can use {{Pkg|mesa-utils}} {{ic|glxinfo}} and you should get output like this :
+
OpenGL のインストールを確認するには、 {{Pkg|mesa-utils}} {{ic|glxinfo}} を使用すると、次のような出力が得られるはずです。
   
 
{{hc|1=$ glxinfo {{!}} grep OpenGL|2=
 
{{hc|1=$ glxinfo {{!}} grep OpenGL|2=
58行目: 58行目:
 
OpenGL ES profile extensions:
 
OpenGL ES profile extensions:
 
}}
 
}}
  +
(もちろん、設定によって異なる値で)
(with different values depending on your setup, of course)
 
   
  +
同じパッケージから {{ic|glxgears}} も試せます。3つの歯車が回転しているのが見えるはずです。
From the same package you can also try {{ic|glxgears}}, you should see 3 rotating gears.
 
   
  +
== ドライバの切り替え ==
== Switching between drivers ==
 
   
  +
[[ハイブリッドグラフィック]] については、[[PRIME]] を見て下さい。
For [[Hybrid graphics]] you might want to see [[PRIME]].
 
{{Note|According to a [https://www.reddit.com/r/linuxhardware/comments/he9nhe/amd_and_nvidia_gpus_in_the_same_machine_it_works/ reddit post] can have 2 GPUs from different vendors working concurrently just fine.}}
+
{{Note|[https://www.reddit.com/r/linuxhardware/comments/he9nhe/amd_and_nvidia_gpus_in_the_same_machine_it_works/ reddit post] によると、異なるベンダーの2つの GPU を同時にうまく動作させることができるそうです。}}
   
 
=== Mesa ===
 
=== Mesa ===
   
  +
以下の [[環境変数]] を使用することで、使用されているドライバーを上書きすることができます。
You can override used driver using the following [[environment variable]]:
 
   
 
MESA_LOADER_DRIVER_OVERRIDE=''driver''
 
MESA_LOADER_DRIVER_OVERRIDE=''driver''
   
By default mesa searches for drivers in {{ic|/lib/dri/}} you can see the list of drivers by
+
デフォルトでは、mesa {{ic|/lib/dri/}} にあるドライバを検索します。
   
 
$ ls /lib/dri/
 
$ ls /lib/dri/
   
  +
{{ic|''driver''}} は {{ic|_dri.so}} を除いたドライバ名です。もし失敗したら、llvmpipe にフォールバックします。
{{ic|''driver''}} is the name of the driver without {{ic|_dri.so}}. If it failed it will fallback to llvmpipe.
 
   
  +
また、以下の [[環境変数]] を設定することで、OpenGL ソフトウェアラスタライザードライバを使用することができます。
You can also use OpenGL software rasterizer drivers by setting the following [[environment variables]]:
 
   
 
LIBGL_ALWAYS_SOFTWARE=true
 
LIBGL_ALWAYS_SOFTWARE=true
 
GALLIUM_DRIVER=''driver''
 
GALLIUM_DRIVER=''driver''
   
{{ic|''driver''}} is one of {{ic|softpipe}}, {{ic|llvmpipe}}, or {{ic|swr}}.
+
{{ic|''driver''}} {{ic|softpipe}}, {{ic|llvmpipe}}, {{ic|swr}} のどれか1つです。
   
{{Tip|As of the time of writing this llvmpipe & swr are faster than softpipe.}}
+
{{Tip|これを書いている時点では、llvmpipe swr softpipe より高速です。}}
   
 
== OpenGL over Vulkan (Zink) ==
 
== OpenGL over Vulkan (Zink) ==
   
  +
もし、何らかの問題(RadeonSI や Iris のバグなど)が発生した場合は、Zink を使用してみてください。
If you experience some issues (a bug in RadeonSI, Iris, etc.), you may try using Zink.
 
   
On AMD RX 6700 XT the FPS is 58-105% depending on a game compared to RadeonSI according to [https://www.phoronix.com/scan.php?page=article&item=zink-ends-2021&num=1].
+
AMD RX 6700 XT では、[https://www.phoronix.com/scan.php?page=article&item=zink-ends-2021&num=1] によると、RadeonSI と比較してゲームによって FPS が 58-105% になるそうです。
   
  +
2021-11-30 現在、最新のドライバ 495.44 と {{AUR|mesa-git}} の master ブランチでも多くのアプリケーションが NVIDIA GPU で動きません。Copper DRI 拡張(アップストリーム未対応)と組み合わせると、RTX 2070 では Tomb Raider の平均 FPS が 20% 高くなります。
As of 2021-11-30, many applications do not work on NVIDIA GPUs even with the latest driver 495.44 and {{AUR|mesa-git}}'s master branch. When paired with Copper DRI extension (not yet upstreamed), the average FPS in Tomb Raider is 20% higher on a RTX 2070.
 
   
 
$ env __GLX_VENDOR_LIBRARY_NAME=mesa MESA_LOADER_DRIVER_OVERRIDE=zink GALLIUM_DRIVER=zink %app%
 
$ env __GLX_VENDOR_LIBRARY_NAME=mesa MESA_LOADER_DRIVER_OVERRIDE=zink GALLIUM_DRIVER=zink %app%
   
== Development ==
+
== 開発 ==
   
  +
{{Note|このセクションは、OpenGL を使いたい開発者のためのものです。エンドユーザはこのセクションの内容は必要ありません。}}
{{Note|This section is for developers who wants to use OpenGL. End users do not need any thing from this section.}}
 
Using OpenGL in code requires functions loader, read more at [https://www.khronos.org/opengl/wiki/OpenGL_Loading_Library Khronos].
+
OpenGL をコードで使うには、関数ローダーが必要です。詳しくは、[https://www.khronos.org/opengl/wiki/OpenGL_Loading_Library Khronos] を参照してください。
   
  +
=== OpenGL ハードウェアデータベース ===
{{Expansion|Put list of packages relevant to OpenGL and in Arch repo}}
 
   
  +
[https://www.gpuinfo.org/ GPUInfo] は、ユーザーが報告した GPU/ドライバ の組み合わせ、サポートされる拡張機能、能力などを提供します。
=== OpenGL Hardware Database ===
 
 
[https://www.gpuinfo.org/ GPUInfo] provides user reported GPU/driver combinations, supported extensions, capabilities, etc.
 

2023年4月5日 (水) 16:39時点における最新版

wikipedia OpenGL から:

OpenGL (Open Graphics Library) は、グラフィックスハードウェア向けの2次元/3次元コンピュータグラフィックスライブラリである。SGI 社内で自社の CG ワークステーション向けにクローズドに策定された API 仕様が改良されて公開されています。

詳しくは、Khronos をご覧ください。

インストール

OpenGL を使うアプリケーションを実行するには、あなたのハードウェア(GPU または CPU)用のドライバを インストール する必要があります。

  • mesa はオープンソースの OpenGL 実装で、最新の OpenGL 仕様をサポートするために継続的に更新されています。Intel グラフィックス]]、ATIAMDAMD PRO および NVIDIA のためのオープンソースドライバが集められています。また、ソフトウェアラスタライザーも提供します。パッケージに含まれるドライバは以下の通りです。
    • i915 : GMA 916G および i830、i845、i865 統合 GPU シリーズ用です。
    • i965 : Intel の Gen 4 ハードウェア以降に対応。インテルにより公式にサポートされています。
    • iris : Intel の Gen8 ハードウェア以降に対応。インテルにより公式にサポートされています。
    • r100 : AMD Radeon R100 GPU シリーズ用です。
    • r200 : AMD Radeon R200 GPU シリーズ用。
    • r300 : AMD Radeon R300, R400, R500 GPU シリーズ用。
    • r600 : AMD Radeon HD 2000 GPU シリーズ以降に対応。AMD が公式にサポートしています。
    • radeonsi : AMD の Southern Island GPU 以降のシリーズ用。AMD が公式にサポートしています。
    • nouveau : NouveauNVIDIA 用のオープンソースドライバです。GPU の場合。
    • virgl : 仮想マシン用にホストと GPU を共有するための仮想 GPU ドライバです。
    • svga : VMware の仮想 GPU 用です。
    • zink : Gallium ライバで、vulkan 上で OpenGL を動作させることができます。
    • swrast : レガシーソフトウェア rasterizer です。
    • softpipe : ソフトウェア rasterizer、リファレンス Gallium ドライバです。
    • llvmpipe : ソフトウェア rasterizer、x86 JIT コード生成に LLVM を使用し、マルチスレッド化されています。
    • swr : AVX および AVX2 CPU 命令を使用する高性能ソフトウェア rasterizer OpenSWR としても知られています。
ノート: mesa に適したドライバが自動的に選択されるはずですので、設定する必要はありません。
ヒント:
  • AMD (および ATI) では、プロプライエタリなものを使用する非常に強い理由がない限り、オープンソースのドライバを使用することをお勧めします。
  • NVIDIA では、プロプライエタリドライバをインストールした方が、新しいカードや一般的なパフォーマンスが向上する場合がほとんどです。

検証

OpenGL のインストールを確認するには、 mesa-utils glxinfo を使用すると、次のような出力が得られるはずです。

$ glxinfo | grep OpenGL
OpenGL vendor string: X.Org
OpenGL renderer string: AMD RV620 (DRM 2.50.0 / 5.10.12-arch1-1, LLVM 11.0.1)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 20.3.4
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 20.3.4
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 20.3.4
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
OpenGL ES profile extensions:

(もちろん、設定によって異なる値で)

同じパッケージから glxgears も試せます。3つの歯車が回転しているのが見えるはずです。

ドライバの切り替え

ハイブリッドグラフィック については、PRIME を見て下さい。

ノート: reddit post によると、異なるベンダーの2つの GPU を同時にうまく動作させることができるそうです。

Mesa

以下の 環境変数 を使用することで、使用されているドライバーを上書きすることができます。

MESA_LOADER_DRIVER_OVERRIDE=driver

デフォルトでは、mesa は /lib/dri/ にあるドライバを検索します。

$ ls /lib/dri/

driver_dri.so を除いたドライバ名です。もし失敗したら、llvmpipe にフォールバックします。

また、以下の 環境変数 を設定することで、OpenGL ソフトウェアラスタライザードライバを使用することができます。

LIBGL_ALWAYS_SOFTWARE=true
GALLIUM_DRIVER=driver

driversoftpipe, llvmpipe, swr のどれか1つです。

ヒント: これを書いている時点では、llvmpipe と swr は softpipe より高速です。

OpenGL over Vulkan (Zink)

もし、何らかの問題(RadeonSI や Iris のバグなど)が発生した場合は、Zink を使用してみてください。

AMD RX 6700 XT では、[1] によると、RadeonSI と比較してゲームによって FPS が 58-105% になるそうです。

2021-11-30 現在、最新のドライバ 495.44 と mesa-gitAUR の master ブランチでも多くのアプリケーションが NVIDIA GPU で動きません。Copper DRI 拡張(アップストリーム未対応)と組み合わせると、RTX 2070 では Tomb Raider の平均 FPS が 20% 高くなります。

$ env __GLX_VENDOR_LIBRARY_NAME=mesa MESA_LOADER_DRIVER_OVERRIDE=zink GALLIUM_DRIVER=zink %app%

開発

ノート: このセクションは、OpenGL を使いたい開発者のためのものです。エンドユーザはこのセクションの内容は必要ありません。

OpenGL をコードで使うには、関数ローダーが必要です。詳しくは、Khronos を参照してください。

OpenGL ハードウェアデータベース

GPUInfo は、ユーザーが報告した GPU/ドライバ の組み合わせ、サポートされる拡張機能、能力などを提供します。