Skip to content

Tips for Vulkan Build #475

Closed
Closed

Description

@Dev0Lab1

Note that I use a custom toolchain, the following tips may or may not be the case for your builds.
My custom build for Vulkan produces fully functional executables that are slightly faster than the executables in the official Vulkan release.

Anyway, in my build I add the following preprocessor directives to avoid build errors (undefined etc.):

  • #include <atomic> to external/ggml/src/ggml-vulkan/ggml-vulkan.cpp
  • #include <algorithm> to src/community_models/kroko_asr/encoder.cpp
  • #include <algorithm> to src/models/seed_vc/v2_cfm.cpp

Enjoy

Activity

  1. 0xShug0 commented on Sep 7, 2026

    @0xShug0
    Owner

    @Dev0Lab1 Thanks!

  2. Dev0Lab1 commented on Sep 7, 2026

    @Dev0Lab1
    Author

    I provide full details of my Vulkan build including custom toolchain info and more just in case one may find such information useful. The entire build, zero to end, takes about 4m:25s which includes compiling/building 1092 files.

    This personal setup works for me like a charm. I keep things simple. Modify/enhance as per your taste and desire.

    On Windows 11 (x64)
    ( Step - - 1 - - )
    Here DEV is your desired path, where you have the following folders:

    • cmake
    • gcc
    • ninja
    • openssl
    • audio.cpp-dev......................<--- this is your source code folder for audio.cpp
    • vulkan

    The version of the tools used:

    • clang 23.1.0
    • cmake 4.4.3
    • ninja 1.13.2
    • openssl 4.0.2
    • vulkan 1.4.341

    ( Step - - 2 - - )
    Inside your source code folder of audio.cpp find CMakeLists.txt within which you turn ON the following items, like:

    set(ENGINE_DEFAULT_ENABLE_VULKAN ON)
    option(AUDIOCPP_BUILD_NATIVE_MODEL_MANAGER
        "Build native model-manager tools and server download/install support"
        ON)
    option(AUDIOCPP_USE_SYSTEM_OPENSSL
        "Use system OpenSSL for native model management instead of bundled BoringSSL"
        ON)
    

    ( Step - - 3 - - )
    I use this custom build.bat file; note to use it you should pass the source code folder like: >build.bat audio.cpp-dev
    ----------------- DEV/build.bat ------------------:

    @echo off
    set "GGML_VK_VISIBLE_DEVICES=1,0"
    set pth=DEV\%1\build
    echo build destination: %pth%
    mkdir %pth%
    cd %pth%
    set path=%path%;DEV\cmake\bin;DEV\gcc\bin;DEV\ninja;DEV\vulkan\bin;DEV\openssl\bin
    
    cmake -S .. -B . -G Ninja ^
      -DCMAKE_BUILD_TYPE=Release ^
      -DCMAKE_C_COMPILER=gcc ^
      -DCMAKE_CXX_COMPILER=g++ ^
      -DCMAKE_MAKE_PROGRAM=ninja ^
      -DGGML_VULKAN=ON ^
      -DGGML_NATIVE=ON ^
      -DGGML_OPENMP=ON ^
      -DCMAKE_C_FLAGS="-O3 -march=native -fopenmp -w" ^
      -DCMAKE_CXX_FLAGS="-O3 -march=native -fopenmp -w" ^
      -DENGINE_ENABLE_VULKAN=ON ^
      -DENGINE_ENABLE_OPENMP=ON ^
      -DENGINE_ENABLE_NATIVE_CPU=ON ^
      -DENGINE_ENABLE_LLAMAFILE=ON ^
      -DVulkan_LIBRARY=DEV\vulkan\Lib\vulkan-1.lib ^
      -DVulkan_INCLUDE_DIR=DEV\vulkan\Include ^
      -DOPENSSL_ROOT_DIR=DEV\openssl ^
      -DOPENSSL_INCLUDE_DIR=DEV\openssl\include ^
      -DOPENSSL_CRYPTO_LIBRARY=DEV\openssl\lib\libcrypto.lib ^
      -DOPENSSL_SSL_LIBRARY=DEV\openssl\lib\libssl.lib
    echo -------------- Ninja
    ninja
    cd DEV
    pause
    

    ( Step - - 4 - - )
    Here I provide the build log.
    ----------------- log ------------------:

    DEV>build.bat audio.cpp-dev
    build destination: DEV\audio.cpp-dev\build
    -- The C compiler identification is Clang 23.1.0
    -- The CXX compiler identification is Clang 23.1.0
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working C compiler: DEV/gcc/bin/gcc.exe - skipped
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Check for working CXX compiler: DEV/gcc/bin/g++.exe - skipped
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Found OpenMP_CXX: -fopenmp=libomp (found version "5.1")
    -- Found OpenMP: TRUE (found version "5.1") found components: CXX
    -- Using ggml source: DEV/audio.cpp-dev/external/ggml
    -- The ASM compiler identification is Clang with GNU-like command-line
    -- Found assembler: DEV/gcc/bin/gcc.exe
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
    -- Check if compiler accepts -pthread
    -- Check if compiler accepts -pthread - yes
    -- Found Threads: TRUE
    -- CMAKE_SYSTEM_PROCESSOR: AMD64
    -- GGML_SYSTEM_ARCH: x86
    -- Including CPU backend
    -- Found OpenMP_C: -fopenmp=libomp (found version "5.1")
    -- Found OpenMP: TRUE (found version "5.1")
    -- x86 detected
    -- Adding CPU backend variant ggml-cpu: -march=native
    -- Found Vulkan: DEV/vulkan/lib/vulkan-1.lib (found version "1.4.357") found components: glslc glslangValidator
    -- Vulkan found
    -- GL_KHR_cooperative_matrix supported by glslc
    -- GL_NV_cooperative_matrix2 supported by glslc
    -- GL_EXT_integer_dot_product supported by glslc
    -- GL_EXT_bfloat16 supported by glslc
    -- Including Vulkan backend
    -- ggml version: 0.12.0
    -- ggml commit:  unknown
    -- VERSION: 0.2.1
    -- Looking for pthread_create in pthreads
    -- Looking for pthread_create in pthreads - not found
    -- Looking for pthread_create in pthread
    -- Looking for pthread_create in pthread - found
    -- audio.cpp model composite: full selected [roformer;demucs;omnivoice;glm_tts;kroko_asr;outetts;parakeet_tdt;personaplex;inflect_v2;f5_tts;minimax_h3;minimax_music3;neutts;echo_tts;pocket_tts;miocodec;miotts;moss;moss_voicegen;muscriptor;voxcpm2;voxcpm1;vibevoice;vibevoice_asr;voxtral_realtime;fish_audio;audio8_tts;magpie_tts;confucius4_tts;dots_tts;dramabox;fun_asr_nano;sense_asr;heartmula;higgs_audio_stt;higgs_audio_tts;hviske_asr;irodori_tts;index_tts2;nemotron_asr;qwen3_tts;vietneu_tts;qwen3_asr;qwen3_forced_aligner;mms_forced_aligner;sortformer_diar;stable_audio;supertonic;citrinet_asr;granite5asr;audio8_asr;vevo2;seed_vc;meanvc2;rvc;chatterbox;ace_step;soprano_tts;midashenglm_gen;audiosr;controlfoley;fireredtts3;firered_audio;cosyvoice3;breeze_tts] linked [roformer;demucs;omnivoice;glm_tts;kroko_asr;outetts;parakeet_tdt;personaplex;inflect_v2;f5_tts;minimax_h3;minimax_music3;neutts;echo_tts;pocket_tts;miocodec;miotts;moss;moss_voicegen;muscriptor;voxcpm2;voxcpm1;vibevoice;vibevoice_asr;voxtral_realtime;fish_audio;audio8_tts;magpie_tts;confucius4_tts;dots_tts;dramabox;fun_asr_nano;sense_asr;heartmula;higgs_audio_stt;higgs_audio_tts;hviske_asr;irodori_tts;index_tts2;nemotron_asr;qwen3_tts;vietneu_tts;qwen3_asr;qwen3_forced_aligner;mms_forced_aligner;sortformer_diar;stable_audio;supertonic;citrinet_asr;granite5asr;audio8_asr;vevo2;seed_vc;meanvc2;rvc;chatterbox;ace_step;soprano_tts;midashenglm_gen;audiosr;controlfoley;fireredtts3;firered_audio;cosyvoice3;breeze_tts]
    -- Found OpenSSL: DEV/openssl/lib/libcrypto.lib (found version "4.0.2")
    -- Configuring done (20.4s)
    -- Generating done (0.4s)
    -- Build files have been written to: DEV/audio.cpp-dev/build
    -------------- Ninja
    [0/2] Re-checking globbed directories...
    [13/1092] Performing configure step for 'vulkan-shaders-gen'
    -- The C compiler identification is Clang 23.1.0
    -- The CXX compiler identification is Clang 23.1.0
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working C compiler: DEV/gcc/bin/cc.exe - skipped
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Check for working CXX compiler: DEV/gcc/bin/c++.exe - skipped
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
    -- Looking for pthread_create in pthreads
    -- Looking for pthread_create in pthreads - not found
    -- Looking for pthread_create in pthread
    -- Looking for pthread_create in pthread - found
    -- Found Threads: TRUE
    -- Enabling coopmat glslc support
    -- Enabling coopmat2 glslc support
    -- Enabling dot glslc support
    -- Enabling bfloat16 glslc support
    -- Configuring done (3.4s)
    -- Generating done (0.1s)
    -- Build files have been written to: DEV/audio.cpp-dev/build/ggml/src/ggml-vulkan/vulkan-shaders-gen-prefix/src/vulkan-shaders-gen-build
    [81/1092] Performing build step for 'vulkan-shaders-gen'
    [1/2] Building CXX object CMakeFiles/vulkan-shaders-gen.dir/vulkan-shaders-gen.cpp.obj
    [2/2] Linking CXX executable vulkan-shaders-gen.exe
    [82/1092] Performing install step for 'vulkan-shaders-gen'
    -- Installing: DEV/audio.cpp-dev/build/Release/vulkan-shaders-gen.exe
    [1091/1092] Linking CXX executable bin\audiocpp_server.exe
    

    ( Step - - 5 - - )
    Once build done successfully you will find the following *.exe files inside DEV/audio.cpp-dev/build/bin folder:

    • audiocpp_cli.exe 84,079,616
    • audiocpp_gguf.exe 1,960,960
    • audiocpp_model_manager.exe 2,075,648
    • audiocpp_server.exe 91,792,896
    • model_perf.exe 83,799,552

    ( Step - - 6 - - )
    You will need to copy the following *.dll next to the above *.exe:

    • libc++.dll 2,009,088 <- from DEV/gcc/bin
    • libomp.dll 954,880 <- from DEV/gcc/bin
    • libunwind.dll 190,976 <- from DEV/gcc/bin
    • libcrypto-4-x64.dll 7,144,960 <- from DEV/openssl/bin
    • libssl-4-x64.dll 1,398,784 <- from DEV/openssl/bin

    All set.
    Enjoy

  3. 0xShug0 commented on Sep 11, 2026

    @0xShug0
    Owner

    Moved to FAQ!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions