「OpenGL」の版間の差分
(英語版から転載) |
(同期) |
||
| (2人の利用者による、間の15版が非表示) | |||
| 1行目: | 1行目: | ||
| − | [[Category:グラフィック]] |
+ | [[Category:グラフィックス]] |
[[Category:開発]] |
[[Category:開発]] |
||
[[en:OpenGL]] |
[[en: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. |
||
| − | + | 詳しくは、[https://www.khronos.org/opengl/ Khronos] をご覧ください。 |
|
| + | OpenGL の開発は 2017 年に終了し、より新しいハードウェアで高いパフォーマンスを提供する "次世代" API である [[Vulkan]] に移行しました。 |
||
| − | == Installation == |
||
| + | == インストール == |
||
| − | To run any application that uses OpenGL you will need to [[install]] driver(s) for your hardware (either GPUs or CPUs) |
||
| + | OpenGL を使用するアプリケーションを実行するには、ハードウェア (GPU または CPU) に適したドライバを[[インストール]]する必要があります。 |
||
| − | * {{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|i965}} : for Intel's Gen 4 hardware and later. It is officially supported by Intel. |
||
| − | ** {{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|r200}} : for AMD's Radeon R200 GPU series. |
||
| − | ** {{ic|r300}} : for AMD's Radeon R300, R400, and R500 GPU series. |
||
| − | ** {{ic|r600}} : for AMD's Radeon HD 2000 GPU series and later. It is officially supported by AMD. |
||
| − | ** {{ic|radeonsi}} : for AMD's Southern Island GPUs and later. It is officially supported by AMD. |
||
| − | ** {{ic|nouveau}} : [[Nouveau]] is the open-source driver for [[NVIDIA]] GPUs. |
||
| − | ** {{ic|virgl}} : is a virtual GPU driver for sharing a GPU with a host for virtual machines. |
||
| − | ** {{ic|svga}} : for VMware virtual GPUs. |
||
| − | ** {{ic|zink}} : is a Gallium driver, it can be used to run OpenGL on vulkan. |
||
| − | ** {{ic|swrast}} : Legacy software rasterizer. |
||
| − | ** {{ic|softpipe}} : Software rasterizer, a reference Gallium driver. |
||
| − | ** {{ic|llvmpipe}} : Software rasterizer, uses LLVM for x86 JIT code generation and is multi-threaded. |
||
| − | ** {{ic|swr}} : High performance software rasterizer that uses AVX and AVX2 CPU instructions, also known as [https://www.openswr.org/ OpenSWR]. |
||
| − | {{Note|The right driver for mesa should be selected automatically, you do not have to configure it, just install the package.}} |
||
| + | {{Tip| |
||
| − | * {{Pkg|nvidia-utils}} is proprietary driver for [[NVIDIA]] GPUs. |
||
| + | * AMD(および ATI)の場合、特別な理由がない限りオープンソースドライバーの使用が推奨されます。 |
||
| + | * NVIDIA の場合、[https://nouveau.freedesktop.org/CodeNames.html#NVE0 Kepler(NVE0/GK''XXX'')] シリーズより新しいカードではプロプライエタリ (独自) ドライバーを使用するのが推奨されます。一般的にパフォーマンスも向上します。 |
||
| + | }} |
||
| + | {{Note| |
||
| − | * {{AUR|amdgpu-pro-libgl}} is proprietary driver for [[AMDGPU PRO|AMD PRO]] GPUs. |
||
| + | * Intel の Gen''N'' ハードウェアは CPU の世代ではなく、[[Wikipedia:List of Intel graphics processing units|GPU の世代]]を指します。 |
||
| + | * AMD (および ATI) GPU のファミリーを調べるには、[[Wikipedia:List of AMD graphics processing units#Features overview]] を参照してください。 |
||
| + | * NVIDIA GPU のコードネームを調べるには、[https://nouveau.freedesktop.org/CodeNames.html Nouveau プロジェクトのコードネームリスト] を確認してください。 |
||
| + | }} |
||
| + | [https://mesa3d.org/ Mesa] は、最新の OpenGL 仕様をサポートするオープンソースの OpenGL 実装です。Intel、AMD (旧 ATI)、NVIDIA の GPU 向けのオープンソースドライバを提供し、ソフトウェア [[Wikipedia:Rasterisation|ラスタライザ]](llvmpipe など)も備えています。 |
||
| − | {{Tip| |
||
| − | * For AMD (and ATI) it is recommended to use the open-source driver unless you have a very strong reason to use proprietary one. |
||
| − | * For NVIDIA installing the proprietary driver is mostly better for newer cards or better performance in general.}} |
||
| + | Mesa には 2 つのパッケージがあり、それぞれ異なるドライバを含んでいます。 |
||
| − | == Verification == |
||
| + | * {{Pkg|mesa}} は、最新のハードウェア向けの Mesa パッケージで、以下のようなモダンなドライバーを含みます。 |
||
| − | To verify your OpenGL installation you can use {{Pkg|mesa-utils}} {{ic|glxinfo}} and you should get output like this : |
||
| + | ** {{ic|r300}} : AMD Radeon R300、R400、R500 GPU 向け。 |
||
| + | ** {{ic|r600}} : AMD Radeon R600 から Northern Islands までの GPU 向け (AMD 公式サポート) |
||
| + | ** {{ic|radeonsi}} : AMD Southern Island 以降の GPU 向け (AMD 公式サポート) |
||
| + | ** {{ic|nouveau}} : NVIDIA 向けオープンソースドライバー [[Nouveau]] |
||
| + | ** {{ic|virtio_gpu}} : [[QEMU]] ベースの VMM ([[KVM]] や [[Xen]] など) 向けの仮想 GPU ドライバ。 |
||
| + | ** {{ic|vmwgfx}} : [[VMware]] の仮想 GPU 向け。 |
||
| + | ** {{ic|i915}} : Intel Gen 3 GPU 向け。 |
||
| + | ** {{ic|crocus}} : Intel Gen 4 Gen 7 GPU 向け。 |
||
| + | ** {{ic|iris}} : Intel Gen 8 以降の GPU 向け (Intel 公式サポート) |
||
| + | ** {{ic|zink}} : [[Vulkan]] 上で OpenGL を実行するための Gallium ドライバー。 |
||
| + | ** {{ic|d3d12}} : [[WSL]] など、D3D12 のみをサポートするデバイス向けの OpenGL 3.3 ドライバー。 |
||
| + | ** {{ic|swrast}} : レガシーなソフトウェアラスタライザ。Mesa 22.0.0 で廃止されたが、ソースコードには残存 (ArchLinux では 24.1.1 で依然利用可能[https://gitlab.archlinux.org/archlinux/packaging/packages/mesa/-/blob/main/PKGBUILD?ref_type=heads#L140]) |
||
| + | ** {{ic|softpipe}} : ソフトウェアラスタライザかつ Gallium のリファレンスドライバ。 |
||
| + | ** {{ic|llvmpipe}} : LLVM を使用した x86 JIT コード生成によるマルチスレッド対応のソフトウェアラスタライザ。 |
||
| + | * {{Pkg|mesa-amber}} は、古いハードウェア向けのクラシック(Gallium3D 非対応)ドライバーを含むパッケージです。 |
||
| − | {{hc|1=$ glxinfo {{!}} grep OpenGL|2= |
||
| + | ** {{ic|i830}} : Intel Gen 2 GPU 向け({{ic|i965}} と同じバイナリ) |
||
| − | OpenGL vendor string: X.Org |
||
| + | ** {{ic|i915}} : Intel Gen 3 GPU 向け({{ic|i965}} と同じバイナリ) |
||
| − | OpenGL renderer string: AMD RV620 (DRM 2.50.0 / 5.10.12-arch1-1, LLVM 11.0.1) |
||
| + | ** {{ic|i965}} : Intel Gen 4 Gen 11 GPU 向け(Intel 公式サポート) |
||
| − | OpenGL core profile version string: 3.3 (Core Profile) Mesa 20.3.4 |
||
| + | ** {{ic|radeon}} : AMD Radeon R100 GPU 向け({{ic|r200}} と同じバイナリ) |
||
| − | OpenGL core profile shading language version string: 3.30 |
||
| + | ** {{ic|r200}} : AMD Radeon R200 GPU 向け。 |
||
| − | OpenGL core profile context flags: (none) |
||
| + | ** {{ic|nouveau_vieux}} : NVIDIA NV04(Fahrenheit)NV20(Kelvin)GPU 向け。 |
||
| − | OpenGL core profile profile mask: core profile |
||
| + | ** {{ic|swrast}} : レガシーなソフトウェアラスタライザ。 |
||
| − | OpenGL core profile extensions: |
||
| + | |||
| − | OpenGL version string: 3.0 Mesa 20.3.4 |
||
| + | {{Note|Mesa を使用する場合、適切なドライバーは自動的に選択されるため、パッケージをインストールするだけで追加設定は不要です。}} |
||
| − | OpenGL shading language version string: 1.30 |
||
| + | |||
| − | OpenGL context flags: (none) |
||
| + | * {{Pkg|nvidia-utils}} : NVIDIA GPU 向けのプロプライエタリ (独自) ドライバ (OpenGL 実装を含む) |
||
| − | OpenGL extensions: |
||
| + | |||
| − | OpenGL ES profile version string: OpenGL ES 3.0 Mesa 20.3.4 |
||
| + | * {{AUR|amdgpu-pro-oglp}} : AMD GPU 向けの [[AMDGPU PRO|プロプライエタリドライバ]] |
||
| − | OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00 |
||
| + | |||
| − | OpenGL ES profile extensions: |
||
| + | == 検証 == |
||
| + | |||
| + | OpenGL のインストールを確認するには、{{Pkg|mesa-utils}} の {{ic|eglinfo}} を使用できます。実行すると、環境に応じた異なる値を含む以下のような出力が表示されるはずです。 |
||
| + | |||
| + | {{hc|1=$ eglinfo -B|2= |
||
| + | |||
| + | Wayland platform: |
||
| + | EGL API version: 1.4 |
||
| + | EGL vendor string: Mesa Project |
||
| + | EGL version string: 1.4 |
||
| + | EGL client APIs: OpenGL OpenGL_ES |
||
| + | OpenGL compatibility profile vendor: Mesa Project |
||
| + | OpenGL compatibility profile renderer: i915 (chipset: Pineview M) |
||
| + | OpenGL compatibility profile version: 2.1 Mesa 23.1.5 |
||
| + | OpenGL compatibility profile shading language version: 1.20 |
||
| + | OpenGL ES profile vendor: Mesa Project |
||
| + | OpenGL ES profile renderer: i915 (chipset: Pineview M) |
||
| + | OpenGL ES profile version: OpenGL ES 2.0 Mesa 23.1.5 |
||
| + | OpenGL ES profile shading language version: OpenGL ES GLSL ES 1.0.16 |
||
| + | |||
| + | X11 platform: |
||
| + | EGL API version: 1.5 |
||
| + | EGL vendor string: Mesa Project |
||
| + | EGL version string: 1.5 |
||
| + | EGL client APIs: OpenGL OpenGL_ES |
||
| + | OpenGL core profile vendor: Mesa |
||
| + | OpenGL core profile renderer: llvmpipe (LLVM 15.0.7, 128 bits) |
||
| + | OpenGL core profile version: 4.5 (Core Profile) Mesa 23.1.5 |
||
| + | OpenGL core profile shading language version: 4.50 |
||
| + | OpenGL compatibility profile vendor: Mesa |
||
| + | OpenGL compatibility profile renderer: llvmpipe (LLVM 15.0.7, 128 bits) |
||
| + | OpenGL compatibility profile version: 4.5 (Compatibility Profile) Mesa 23.1.5 |
||
| + | OpenGL compatibility profile shading language version: 4.50 |
||
| + | OpenGL ES profile vendor: Mesa |
||
| + | OpenGL ES profile renderer: llvmpipe (LLVM 15.0.7, 128 bits) |
||
| + | OpenGL ES profile version: OpenGL ES 3.2 Mesa 23.1.5 |
||
| + | OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20 |
||
}} |
}} |
||
| − | (with different values depending on your setup, of course) |
||
| + | X11プラットフォームでは、{{ic|glxinfo}} も使用できます。 |
||
| − | From the same package you can also try {{ic|glxgears}}, you should see 3 rotating gears. |
||
| + | 同じパッケージには、基本的な OpenGL テストとして {{ic|eglgears_x11}} や {{ic|glxgears}}(X11上)、または {{ic|eglgears_wayland}}(Wayland 上)を使用することもできます。プログラムを実行すると、3つの回転するギアが表示されるはずです。 |
||
| − | == Switching between drivers == |
||
| + | == ドライバの切り替え == |
||
| − | 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.}} |
||
| + | [[ハイブリッドグラフィック]] については、[[PRIME]] を見て下さい。 |
||
| + | {{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'' |
||
| − | + | デフォルトでは、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''}} |
+ | {{ic|''driver''}} は {{ic|softpipe}}, {{ic|llvmpipe}}, {{ic|swr}} のどれか1つです。 |
| − | {{Tip| |
+ | {{Tip|これを書いている時点では、llvmpipe と swr は softpipe より高速です。}} |
== OpenGL over Vulkan (Zink) == |
== OpenGL over Vulkan (Zink) == |
||
| + | [https://docs.mesa3d.org/drivers/zink.html Mesa ドキュメント]より: |
||
| − | If you experience some issues (a bug in RadeonSI, Iris, etc.), you may try using Zink. |
||
| + | |||
| + | Zink ドライバーは、特定の GPU アーキテクチャをターゲットとするのではなく、Vulkan API 呼び出しを発行する Gallium ドライバです。これを使用すると、Vulkan のみをサポートするデバイスでも完全なデスクトップ OpenGL サポートを得ることができます。 |
||
| + | デフォルトの OpenGL ドライバ (RadeonSI や Iris など) に問題がある場合は、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]. |
||
| + | [https://www.phoronix.com/review/radeon-zink-summer23 この Phoronix ベンチマーク]によると、一部のアプリケーションでは RadeonSI と比較して平均 FPS が低下する可能性があります。 |
||
| − | 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. |
||
| + | NVIDIA ドライバで Zink を使用するには、以下のコマンドまたは類似のコマンドを実行してください: |
||
| − | $ env __GLX_VENDOR_LIBRARY_NAME=mesa MESA_LOADER_DRIVER_OVERRIDE=zink GALLIUM_DRIVER=zink %app% |
||
| + | $ env __GLX_VENDOR_LIBRARY_NAME=mesa __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json MESA_LOADER_DRIVER_OVERRIDE=zink GALLIUM_DRIVER=zink ''application'' |
||
| − | == Development == |
||
| + | == 開発 == |
||
| − | {{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]. |
||
| + | {{Note|このセクションは、OpenGL を使いたい開発者のためのものです。エンドユーザはこのセクションの内容は必要ありません。}} |
||
| − | {{Expansion|Put list of packages relevant to OpenGL and in Arch repo}} |
||
| + | OpenGL をコードで使うには、関数ローダーが必要です。詳しくは、[https://www.khronos.org/opengl/wiki/OpenGL_Loading_Library Khronos] を参照してください。 |
||
| − | === OpenGL |
+ | === OpenGL ハードウェアデータベース === |
| + | [https://www.gpuinfo.org/ GPUInfo] は、ユーザーが報告した GPU とドライバの組み合わせ、サポートされている拡張機能、機能などの情報を提供します。 この情報は、特定のハードウェアが OpenGL および Vulkan の両方で互換性や準拠性を満たしているかを確認するのに役立ちます。 |
||
| − | [https://www.gpuinfo.org/ GPUInfo] provides user reported GPU/driver combinations, supported extensions, capabilities, etc. |
||
2025年3月18日 (火) 09:41時点における最新版
wikipedia OpenGL から:
- OpenGL (Open Graphics Library) は、グラフィックスハードウェア向けの2次元/3次元コンピュータグラフィックスライブラリである。SGI 社内で自社の CG ワークステーション向けにクローズドに策定された API 仕様が改良されて公開されています。
詳しくは、Khronos をご覧ください。
OpenGL の開発は 2017 年に終了し、より新しいハードウェアで高いパフォーマンスを提供する "次世代" API である Vulkan に移行しました。
インストール
OpenGL を使用するアプリケーションを実行するには、ハードウェア (GPU または CPU) に適したドライバをインストールする必要があります。
Mesa は、最新の OpenGL 仕様をサポートするオープンソースの OpenGL 実装です。Intel、AMD (旧 ATI)、NVIDIA の GPU 向けのオープンソースドライバを提供し、ソフトウェア ラスタライザ(llvmpipe など)も備えています。
Mesa には 2 つのパッケージがあり、それぞれ異なるドライバを含んでいます。
- mesa は、最新のハードウェア向けの Mesa パッケージで、以下のようなモダンなドライバーを含みます。
r300: AMD Radeon R300、R400、R500 GPU 向け。r600: AMD Radeon R600 から Northern Islands までの GPU 向け (AMD 公式サポート)radeonsi: AMD Southern Island 以降の GPU 向け (AMD 公式サポート)nouveau: NVIDIA 向けオープンソースドライバー Nouveauvirtio_gpu: QEMU ベースの VMM (KVM や Xen など) 向けの仮想 GPU ドライバ。vmwgfx: VMware の仮想 GPU 向け。i915: Intel Gen 3 GPU 向け。crocus: Intel Gen 4 Gen 7 GPU 向け。iris: Intel Gen 8 以降の GPU 向け (Intel 公式サポート)zink: Vulkan 上で OpenGL を実行するための Gallium ドライバー。d3d12: WSL など、D3D12 のみをサポートするデバイス向けの OpenGL 3.3 ドライバー。swrast: レガシーなソフトウェアラスタライザ。Mesa 22.0.0 で廃止されたが、ソースコードには残存 (ArchLinux では 24.1.1 で依然利用可能[1])softpipe: ソフトウェアラスタライザかつ Gallium のリファレンスドライバ。llvmpipe: LLVM を使用した x86 JIT コード生成によるマルチスレッド対応のソフトウェアラスタライザ。
- mesa-amber は、古いハードウェア向けのクラシック(Gallium3D 非対応)ドライバーを含むパッケージです。
i830: Intel Gen 2 GPU 向け(i965と同じバイナリ)i915: Intel Gen 3 GPU 向け(i965と同じバイナリ)i965: Intel Gen 4 Gen 11 GPU 向け(Intel 公式サポート)radeon: AMD Radeon R100 GPU 向け(r200と同じバイナリ)r200: AMD Radeon R200 GPU 向け。nouveau_vieux: NVIDIA NV04(Fahrenheit)NV20(Kelvin)GPU 向け。swrast: レガシーなソフトウェアラスタライザ。
- nvidia-utils : NVIDIA GPU 向けのプロプライエタリ (独自) ドライバ (OpenGL 実装を含む)
- amdgpu-pro-oglpAUR : AMD GPU 向けの プロプライエタリドライバ
検証
OpenGL のインストールを確認するには、mesa-utils の eglinfo を使用できます。実行すると、環境に応じた異なる値を含む以下のような出力が表示されるはずです。
$ eglinfo -B
Wayland platform: EGL API version: 1.4 EGL vendor string: Mesa Project EGL version string: 1.4 EGL client APIs: OpenGL OpenGL_ES OpenGL compatibility profile vendor: Mesa Project OpenGL compatibility profile renderer: i915 (chipset: Pineview M) OpenGL compatibility profile version: 2.1 Mesa 23.1.5 OpenGL compatibility profile shading language version: 1.20 OpenGL ES profile vendor: Mesa Project OpenGL ES profile renderer: i915 (chipset: Pineview M) OpenGL ES profile version: OpenGL ES 2.0 Mesa 23.1.5 OpenGL ES profile shading language version: OpenGL ES GLSL ES 1.0.16 X11 platform: EGL API version: 1.5 EGL vendor string: Mesa Project EGL version string: 1.5 EGL client APIs: OpenGL OpenGL_ES OpenGL core profile vendor: Mesa OpenGL core profile renderer: llvmpipe (LLVM 15.0.7, 128 bits) OpenGL core profile version: 4.5 (Core Profile) Mesa 23.1.5 OpenGL core profile shading language version: 4.50 OpenGL compatibility profile vendor: Mesa OpenGL compatibility profile renderer: llvmpipe (LLVM 15.0.7, 128 bits) OpenGL compatibility profile version: 4.5 (Compatibility Profile) Mesa 23.1.5 OpenGL compatibility profile shading language version: 4.50 OpenGL ES profile vendor: Mesa OpenGL ES profile renderer: llvmpipe (LLVM 15.0.7, 128 bits) OpenGL ES profile version: OpenGL ES 3.2 Mesa 23.1.5 OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20
X11プラットフォームでは、glxinfo も使用できます。
同じパッケージには、基本的な OpenGL テストとして eglgears_x11 や glxgears(X11上)、または eglgears_wayland(Wayland 上)を使用することもできます。プログラムを実行すると、3つの回転するギアが表示されるはずです。
ドライバの切り替え
ハイブリッドグラフィック については、PRIME を見て下さい。
Mesa
以下の 環境変数 を使用することで、使用されているドライバーを上書きすることができます。
MESA_LOADER_DRIVER_OVERRIDE=driver
デフォルトでは、mesa は /lib/dri/ にあるドライバを検索します。
$ ls /lib/dri/
driver は _dri.so を除いたドライバ名です。もし失敗したら、llvmpipe にフォールバックします。
また、以下の 環境変数 を設定することで、OpenGL ソフトウェアラスタライザードライバを使用することができます。
LIBGL_ALWAYS_SOFTWARE=true GALLIUM_DRIVER=driver
driver は softpipe, llvmpipe, swr のどれか1つです。
OpenGL over Vulkan (Zink)
Mesa ドキュメントより:
Zink ドライバーは、特定の GPU アーキテクチャをターゲットとするのではなく、Vulkan API 呼び出しを発行する Gallium ドライバです。これを使用すると、Vulkan のみをサポートするデバイスでも完全なデスクトップ OpenGL サポートを得ることができます。
デフォルトの OpenGL ドライバ (RadeonSI や Iris など) に問題がある場合は、Zink ドライバーを試すことができます。
この Phoronix ベンチマークによると、一部のアプリケーションでは RadeonSI と比較して平均 FPS が低下する可能性があります。
NVIDIA ドライバで Zink を使用するには、以下のコマンドまたは類似のコマンドを実行してください:
$ env __GLX_VENDOR_LIBRARY_NAME=mesa __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json MESA_LOADER_DRIVER_OVERRIDE=zink GALLIUM_DRIVER=zink application
開発
OpenGL をコードで使うには、関数ローダーが必要です。詳しくは、Khronos を参照してください。
OpenGL ハードウェアデータベース
GPUInfo は、ユーザーが報告した GPU とドライバの組み合わせ、サポートされている拡張機能、機能などの情報を提供します。 この情報は、特定のハードウェアが OpenGL および Vulkan の両方で互換性や準拠性を満たしているかを確認するのに役立ちます。