Skip to content

Enable Vulkan cross-compilation for Windows via MinGW#1

Closed
Copilot wants to merge 27 commits into
feat/build-infra-refinementfrom
copilot/build-windows-binary
Closed

Enable Vulkan cross-compilation for Windows via MinGW#1
Copilot wants to merge 27 commits into
feat/build-infra-refinementfrom
copilot/build-windows-binary

Conversation

Copy link
Copy Markdown

Copilot AI commented Jan 29, 2026

Cross-compiling Windows binaries with Vulkan backend was failing due to missing Windows Vulkan SDK and incorrect linker configuration.

Changes

Build script (scripts/build_windows_mingw.sh):

  • Generate Windows import library for vulkan-1.dll using dlltool
  • Configure Vulkan paths: headers from Vulkan-Headers submodule, library from generated stub
  • Validate glslc availability for shader compilation

CMake configuration (src/native/CMakeLists.txt):

  • Extend --whole-archive linker flag to Windows system name (MinGW cross-compilation)
  • Without this, only the llama target was linked, excluding the ggml-vulkan static library

Documentation:

  • Updated build instructions with required dependencies (mingw-w64, glslc, libvulkan-dev)
  • Clarified that Vulkan runtime is required on target Windows system

Result

Backend Size Status
CPU 89KB Working (before)
Vulkan 47MB Now working

Shaders compile at build time using host glslc. Runtime loads vulkan-1.dll from target system.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https /usr/lib/apt/methods/https (dns block)
  • sdk.lunarg.com
    • Triggering command: /usr/bin/wget wget -q REDACTED --timeout=10 --tries=1 k/llamadart/llam-I rn m_cm2.comp.cpp.d-o _WARNINGS @CMakeFiles/llama.dir/includes_CXX.rsp -D_WIN32_WINNT=0x0601 -O3 -DNDEBUG -Wmissing-d m_cm2.comp.cpp.o-E -DACC_TYPE=floatcmake_echo_color 0x0601 -O3 -DNDE--switch= s rogress-dir=/hom--progress-dir=/home/REDACTED/work/llamadart/llamadart/build-windows-vulkan/CMakeF/usr/lib/gcc/x86_64-w64-mingw32/13-win32/collect2 /home/REDACTED/wor--progress-num=91 w64-mingw32-g++ dart/build-windo/usr/bin/x86_64-w64-mingw32-g++ -DACC_TYPE=float-DGGML_USE_CPU ma.dir/llama-qua-DGGML_USE_VULKAN w64-mingw32-g++ (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

leehack and others added 22 commits January 28, 2026 13:15
- Created platform-specific scripts: build_android.sh, build_apple.sh, build_linux.sh, build_windows.ps1
- Added verify_linux_docker.sh for container-based validation
- Updated .github/workflows/build_native.yml to use modular scripts
- Removed obsolete scripts and tool/build_ios.dart
- Updated podspecs to link with new build scripts
…onfig

- Adopted official llama.cpp build patterns for Windows, Android, Linux, and macOS.
- Enabled runtime CPU detection (GGML_CPU_ALL_VARIANTS) and dynamic backend loading (GGML_BACKEND_DL).
- Enhanced macOS build with Metal BF16 and embedded library support.
- Streamlined iOS XCFramework generation via official llama.cpp scripts.
- Configured .pubignore for zero-config pub.dev distribution.
- Cleaned up build artifacts and temporary workspace files.
…clean artifacts

- Removed source-build fallbacks from Android, Linux, macOS, and Windows build configurations.
- Updated build scripts to clean destination directories and filter redundant versioned binaries.
- Standardized use of pre-built binaries in 'jniLibs', 'Frameworks', and 'lib' directories.
- Refined Windows loader logic to support multiple DLL naming conventions.
- Optimize Android GPU offloading by increasing gpuLayers to 99
- Refactor application startup to disable automatic model loading
- Remove default model paths to ensure manual selection
- Implement auto-popup for model selection when no path is set
- Refactor Android build scripts and add Zero-Patch CMake wrapper
- Fix backend display reporting for BLAS/CPU
- Linux/Windows: Switch to static backend linking via top-level CMake
- Refactor loader.dart to remove fallbacks and enforce strict path resolution
- Add Linux verification scripts (Docker)
- Renamed package to llamadart across all platforms and metadata.
- Removed CUDA support from documentation, scripts, and API.
- Implemented Zero-Patch Strategy documentation.
- Clarified supported architectures and web support (wllama).
- Updated version to 0.2.0 in pubspec.yaml and CHANGELOG.md.
- Performed final repository cleanup of stale binaries and logs.
- Updated README to highlight zero-config usage without local compilation.
- Adjusted .pubignore to include Android jniLibs and exclude root src/.
Copilot AI and others added 2 commits January 29, 2026 03:56
Co-authored-by: leehack <1233094+leehack@users.noreply.github.com>
Co-authored-by: leehack <1233094+leehack@users.noreply.github.com>
@leehack
Copy link
Copy Markdown
Owner

leehack commented Jan 29, 2026

Need vulkan support

Co-authored-by: leehack <1233094+leehack@users.noreply.github.com>
Copilot AI changed the title [WIP] Add build script for Windows binary Add Windows binary build support via MinGW cross-compilation Jan 29, 2026
Copilot AI and others added 2 commits January 29, 2026 04:24
Co-authored-by: leehack <1233094+leehack@users.noreply.github.com>
Co-authored-by: leehack <1233094+leehack@users.noreply.github.com>
Copilot AI changed the title Add Windows binary build support via MinGW cross-compilation Enable Vulkan cross-compilation for Windows via MinGW Jan 29, 2026
@leehack leehack force-pushed the feat/build-infra-refinement branch from fb82e18 to cbb8fc3 Compare January 29, 2026 19:11
@leehack leehack closed this Jan 29, 2026
@leehack leehack deleted the copilot/build-windows-binary branch January 31, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants