Vulkan

From Gentoo Wiki
Jump to:navigation Jump to:search
Resources

Vulkan is a next-generation graphics API created by The Khronos Group. It's designed to be used across a variety of platforms, from desktop to mobile computers.

Compared to OpenGL, Vulkan is a much lower-level API and enables developers to squeeze more performance out of a video card.

Installation

Prerequisites

ICDs

To use Vulkan in any useful capacity, at least one ICD or "Installable Client Driver" is required. ICDs may already be installed on the system, depending on the value(s) assigned to the VIDEO_CARDS variable. The current Vulkan support table is provided below:

Driver name VIDEO_CARDS value Package Supported
RADV amdgpu media-libs/mesa Yes1
AMDVLK amdgpu media-libs/amdvlk or media-libs/amdvlk-bin via ::guru Almost5
radeon/r600 N/A N/A No
RADV radeonsi media-libs/mesa Yes1
ANV intel media-libs/mesa Yes2
NVK nouveau nvk x11-drivers/xf86-video-nouveau media-libs/mesa Yes4
NVIDIA nvidia x11-drivers/nvidia-drivers Yes3
1 Uses the RADV Vulkan driver included in Mesa.
2 Uses the ANV Vulkan driver included in Mesa. Partial support begins on Ivy Bridge and up, more information can be found on intel.
3 Uses the NVIDIA Vulkan driver included in NVIDIA/nvidia-drivers.
4 Requires Mesa version >=24.1.0[1] and kernel version >=6.6. Supported on Turing and later.[2]
5 Uses the AMDVLK aka AMD Open Source Driver for Vulkan and maintained by User:RarogCmex in GURU. Therefore it have not placed in main gentoo tree yet.

It may be useful to check the Vulkan Hardware Database which has detailed GPU hardware capabilities for Vulkan-capable GPUs.

Mesa

To enable the Vulkan drivers in media-libs/mesa, set the vulkan USE flag.

Loader

Applications don't interact with these ICDs directly, but use the Vulkan Loader provided by the package media-libs/vulkan-loader. This loader picks the correct ICD for the application and handles inserting Vulkan layers.

Any packages that are built with Vulkan support will pull in media-libs/vulkan-loader, but it can also be installed manually:

root #emerge --ask media-libs/vulkan-loader

USE flags for media-libs/vulkan-loader Vulkan Installable Client Driver (ICD) Loader

X Add support for X11
layers Include the vulkan layers
wayland Enable dev-libs/wayland backend

Development

To use Vulkan Validation layers, set the layers USE flag on media-libs/vulkan-loader. This will pull in media-libs/vulkan-layers automatically.

To use vulkaninfo or vkcube for verifying if Vulkan works, install dev-util/vulkan-tools:

root #emerge --ask dev-util/vulkan-tools

This is not related with VulkanTools, part of the LunarG Vulkan SDK and currently not packaged on Gentoo.

Usage

Support for Vulkan in Gentoo packages can be controlled by setting the vulkan USE flag. For example, media-libs/libsdl2 can optionally enable Vulkan support support if set.

Troubleshooting

Wrong ELF class

This error that may appear when running vulkaninfo diagnostic tool from dev-util/vulkan-tools and used for Vulkan debugging.

 ERROR: [Loader Message] Code 0 : /usr/lib32/libvulkan_intel.so: wrong ELF class: ELFCLASS32
 ERROR: [Loader Message] Code 0 : /usr/lib32/libvulkan_radeon.so: wrong ELF class: ELFCLASS32

This error can be ignored as both 32-bit and 64-bit drivers are attempted to be loaded on a multilib system.

For more information please see https://github.com/KhronosGroup/Vulkan-Loader/issues/108

See also

  • Xorg/Hardware_3D_acceleration_guide — a guide to getting 3D acceleration working using the DRM with Xorg in Gentoo.
  • OpenGL — a graphics API created by The Khronos Group.
  • OpenCL — a framework for writing programs that execute across heterogeneous computing platforms (CPUs, GPUs, DSPs, FPGAs, ASICs, etc.).

Pages about vendor-specific drivers on Gentoo Wiki:

References