This guide provides detailed instructions for building VulkanModule on different platforms.
- macOS (Intel/Apple Silicon) with MoltenVK
- Windows (x64) with native Vulkan support
- Linux (x64/ARM64) with native Vulkan support
- Raspberry Pi 5 (ARM64) with native Vulkan support
Requirements:
- macOS 10.15+ (Catalina)
- Xcode Command Line Tools
- Homebrew package manager
Installation:
# Install Xcode Command Line Tools
xcode-select --install
# Install dependencies via Homebrew
brew install cmake vulkan-headers vulkan-loader molten-vk
brew install sdl2 sdl2_image glm pkg-configBuild:
cd TestHarness
mkdir build && cd build
cmake ..
make -j$(sysctl -n hw.ncpu)Notes:
- Uses MoltenVK for Vulkan-to-Metal translation
- Automatically enables portability extensions for MoltenVK compatibility
- Debug validation layers may not be available on some macOS versions
Requirements:
- Windows 10/11 (x64)
- Visual Studio 2019/2022 or Build Tools
- Vulkan SDK from LunarG
Installation:
- Install Visual Studio Community 2022 with C++ development tools
- Install Vulkan SDK:
- Download from https://vulkan.lunarg.com/
- Install to default location (usually
C:\VulkanSDK\<version>)
- Install vcpkg for dependencies:
git clone https://github.com/Microsoft/vcpkg.git cd vcpkg .\bootstrap-vcpkg.bat .\vcpkg integrate install # Install dependencies .\vcpkg install sdl2:x64-windows sdl2-image:x64-windows glm:x64-windows
Build (Command Line):
cd TestHarness
mkdir build && cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build . --config Release -j %NUMBER_OF_PROCESSORS%Build (Visual Studio):
cd TestHarness
mkdir build && cd build
cmake .. -G "Visual Studio 17 2022" -A x64 -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
# Open VulkanModule.sln in Visual Studio and buildNotes:
- Executable will be in
build/Release/VulkanTester.exe - Requires VULKAN_SDK environment variable (set by Vulkan SDK installer)
- Uses Win32 platform extensions for native Vulkan support
Requirements:
- Ubuntu 20.04+ or equivalent
- GCC 9+ or Clang 10+
- Vulkan drivers for your GPU
Installation:
# Update package manager
sudo apt update
# Install build tools
sudo apt install build-essential cmake pkg-config git
# Install Vulkan development packages
sudo apt install vulkan-tools libvulkan-dev vulkan-validationlayers-dev spirv-tools
# Install dependencies
sudo apt install libsdl2-dev libsdl2-image-dev libglm-dev
# For NVIDIA users (optional)
sudo apt install nvidia-driver-535 vulkan-utilsBuild:
cd TestHarness
mkdir build && cd build
cmake ..
make -j$(nproc)GPU Driver Notes:
- NVIDIA: Install proprietary drivers (nvidia-driver-XXX)
- AMD: Install mesa-vulkan-drivers or amdvlk-drivers
- Intel: Install intel-media-va-driver-non-free mesa-vulkan-drivers
Verification:
# Test Vulkan installation
vulkaninfo --summary
vkcube # Should display a spinning cubeRequirements:
- Raspberry Pi OS 64-bit (Bookworm or newer)
- 8GB RAM recommended for compilation
- Updated GPU firmware with Vulkan support
Installation:
# Update system
sudo apt update && sudo apt upgrade -y
# Install build tools
sudo apt install build-essential cmake pkg-config git
# Install Vulkan packages
sudo apt install vulkan-tools libvulkan-dev vulkan-validationlayers-dev
# Install dependencies
sudo apt install libsdl2-dev libsdl2-image-dev libglm-dev
# ARM64 cross-compilation tools (if needed)
sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnuEnable Vulkan on Pi 5:
# Add to /boot/config.txt
echo "dtoverlay=vc4-kms-v3d-pi5" | sudo tee -a /boot/config.txt
echo "gpu_mem=128" | sudo tee -a /boot/config.txt
# Reboot to apply changes
sudo rebootBuild:
cd TestHarness
mkdir build && cd build
# Native ARM64 build
cmake ..
make -j$(nproc)
# Or with explicit ARM64 optimizations
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)Performance Notes:
- ARM64 Cortex-A76 optimizations automatically enabled
- Vulkan 1.2+ supported on Pi 5 with recent firmware
- Consider using
-j2or-j3for compilation if RAM is limited
Verification:
# Check Vulkan support
vulkaninfo --summary
# Should show "V3D 7.1.x" or similar VideoCore drivermacOS: "VK_ERROR_INCOMPATIBLE_DRIVER"
# Reinstall MoltenVK
brew reinstall molten-vkWindows: "vulkan-1.dll not found"
- Ensure Vulkan SDK is installed
- Check PATH includes
%VULKAN_SDK%/bin
Linux: "libvulkan.so.1 not found"
sudo apt install vulkan-loaderRaspberry Pi: "No Vulkan devices found"
# Update firmware
sudo rpi-update
# Ensure vc4-kms-v3d-pi5 overlay is enabledEnable verbose CMake output:
cmake .. -DCMAKE_VERBOSE_MAKEFILE=ONDebug library linking:
ldd ./build/VulkanTester # Linux/macOS
objdump -p ./build/VulkanTester.exe # WindowsCheck Vulkan validation layers:
export VK_LAYER_PATH=$VULKAN_SDK/etc/vulkan/explicit_layer.d
export VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation
./VulkanTesterThe CMakeLists.txt supports cross-compilation with appropriate toolchain files:
Windows from Linux:
cmake .. -DCMAKE_TOOLCHAIN_FILE=mingw-w64-toolchain.cmakeARM64 from x64:
cmake .. -DCMAKE_TOOLCHAIN_FILE=aarch64-linux-gnu-toolchain.cmake| Platform | Vulkan Implementation | Platform Extensions | Validation Layers |
|---|---|---|---|
| macOS | MoltenVK (Vulkan→Metal) | VK_KHR_portability_enumeration | Limited |
| Windows | Native | VK_KHR_win32_surface | Full support |
| Linux | Native | VK_KHR_xcb_surface | Full support |
| Raspberry Pi | V3D driver | VK_KHR_xcb_surface | Full support |
The build system automatically detects the platform and configures appropriate extensions and optimizations.