Building the ML SDK for Vulkan®

The ML SDK for Vulkan® consists of the following components:

These can be built from the ML SDK for Vulkan® root repository or individually from their respective repositories.

The build system must have:

  • C/C++ 17 compiler: GCC or Clang on Linux, Clang on Darwin, or MSVC on Windows®.

  • CMake 3.25 or later.

  • Ninja 1.8.2 or later.

  • Python 3.10 through 3.14 and uv 0.9.26 (the CI version). Python development dependencies are locked in uv.lock and declared in pyproject.toml.

  • Doxygen 1.9.1 or later. (When building documentation)

  • PlantUML, a compatible Java runtime, and Graphviz. (When building documentation)

Building and running on Darwin also requires the LunarG Vulkan® SDK. The ML SDK’s current Darwin support is experimental. See the Darwin support guide to select either MoltenVK or KosmicKrisp through the Vulkan® Loader.

The following dependencies are also needed:

For building the ML SDK for Vulkan® components, run the following commands:

uv sync --locked --only-group sdk
uv run --no-sync python scripts/build.py

SPIR-V™ modules are supported by the base ML Workload Library for Vulkan® build. Pass --enable-glsl-support to enable GLSL source modules, or --enable-hlsl-support to enable HLSL source modules in the ML Workload Library for Vulkan® and in Scenario Runner where supported. Pass --disable-workload-lib-vgf-support to build the library for standalone workloads without VGF Library support.

If the ML SDK for Vulkan® components are installed in custom locations, specify their paths by adding the following command line option:

./scripts/build.py --$COMPONENT_NAME $PATH_TO_COMPONENT

COMPONENT_NAME can be one of the following (with its default relative location in parentheses):

  • vgf-lib (sw/vgf-lib)

  • model-converter (sw/model-converter)

  • scenario-runner (sw/scenario-runner)

  • emulation-layer (sw/emulation-layer)

  • workload-lib (sw/workload-lib)

Similarly, dependencies with custom install locations need to be specified. For instance if glslang was installed at $GLSLANG_REPO_PATH, use the following:

./scripts/build.py --glslang-path $GLSLANG_REPO_PATH

Upon a sparse checkout, missing components will be skipped during building. Note that some components have dependencies on each other. VGF Library is required by Scenario Runner and Model Converter, and for VGF support in Workload Library.

The build artifacts can be installed into a specified location by passing the option --install with the required path.

To create an archive with the build artifacts, add --package-type zip or --package-type tgz. The archive is stored in the build directory by default; use --package-dir to select another location.

Build the documentation

To build the documentation, run the following command:

./scripts/build.py --doc

More command line options

For more command line options, consult the program help:

./scripts/build.py --help

For more information about building the ML SDK for Vulkan®, see the following build instructions: