Utility

Here we describe some tools that can assist the development of Vulkan applications.

Feel free to check out the official Vulkan website for a more complete list of resources.

External tools

NVIDIA Nsight Systems

NVIDIA Nsight Systems is a tool developed by NVIDIA to profile applications, showing both CPU and GPU usage. It can be very useful for analyzing the balance between CPU and GPU usage, as well as troubleshoot general performance bottlenecks. However, it only outputs high-level information regarding GPU tasks. Therefore, to catch GPU bottlenecks in a fine-grained manner (such as inside shaders) one should instead use a dedicated profiler such as Nsight Graphics.

NVIDIA Nsight Graphics

Nsight Graphics dives deeper into the execution details of an application and provides detailed information regarding graphics pipelines, shaders and so on. This is a tool of choice to consider for NVIDIA GPUs once the GPU is identified as a bottleneck with Nsight Systems.

RenderDoc

RenderDoc plays a similar role to Nsight Graphics for a wider range of GPUs. It is open-source and community-maintained.

RenderDoc is not supported with Vulkan.jl; see this issue for more details on the matter.

CPU implementation of Vulkan

SwiftShader

SwiftShader is a CPU implementation of Vulkan primarily designed to extend the portability of Vulkan applications. It can be used wherever there is a lack of proper driver support, including public continuous integration services. This allows for example to evaluate code when generating a documentation in CI with Documenter.jl, like this one.

SwiftShader is available as a JLL package. You can add it with

julia> ]add SwiftShader_jll

Load it before creating the first Vulkan instance:

using SwiftShader_jll, Vulkan

Its software device is enumerated alongside the system's hardware devices.

The published Linux SwiftShader binary requests an executable stack and may fail to load on newer glibc. This binary packaging issue is separate from discovery.

Lavapipe

Lavapipe is another CPU implementation of Vulkan, developed by Mesa as part of its Gallium stack.

Install and load its JLL before creating the first Vulkan instance:

julia> ]add Lavapipe_jll

julia> using Lavapipe_jll, Vulkan

Loading the JLL adds its ICD manifest to the Vulkan loader's discovery. It does not hide system drivers, so hardware devices and Lavapipe can be enumerated and used in the same process.

Both software drivers can be loaded together:

using Lavapipe_jll, SwiftShader_jll, Vulkan

Choose the physical device returned by enumerate_physical_devices(instance). No set_driver call or restart is needed. If an earlier set_driver(:SwiftShader) saved a library preference, reset it once with set_driver(:System) and restart.