Build for Windows

Step-by-step instructions for enabling embedded inference on Windows (x64) with GenAI Llama.


Option A: Download Prebuilt Libraries (Easiest)

The llama.cpp project publishes prebuilt shared libraries for every release. No compilation required.

1. Download

Go to the llama.cpp GitHub Releases page and download the archive for your GPU:

GPU Archive to Download
NVIDIA llama-b*-bin-win-cuda-cu*.*.zip
AMD / Intel llama-b*-bin-win-vulkan-*.zip
CPU only llama-b*-bin-win-cpu-*.zip

2. Extract and Copy

Extract the archive and copy all .dll files into:

<YourProject>/Plugins/GenAILlama/ThirdParty/LlamaCpp/lib/Win64/

Typical files include llama.dll, ggml.dll, ggml-base.dll, ggml-cpu.dll, and backend-specific libraries like ggml-cuda.dll or ggml-vulkan.dll.

3. Rebuild Your Unreal Project

Check the build log for:

GenAILlama: llama.cpp shared libraries found at <path>. Embedded inference enabled (dynamic loading).

That’s it! The plugin loads the DLLs automatically at runtime.

CUDA Runtime

If you download CUDA-enabled libraries, your system needs the CUDA runtime installed (the NVIDIA GPU driver usually includes it). If CUDA is not available at runtime, the CUDA backend library simply won't load — the plugin will still work with CPU inference.


Option B: Compile From Source (Advanced)

Compile llama.cpp yourself for maximum control over GPU backends and optimizations.

Prerequisites

Choose Your GPU Backend

Backend Best For Flag
CUDA NVIDIA GPUs (best performance) -DGGML_CUDA=ON
Vulkan AMD, Intel, or NVIDIA GPUs (cross-vendor) -DGGML_VULKAN=ON
CPU Testing, or no discrete GPU (no GPU flag)

Build Steps

1. Clone llama.cpp

git clone https://github.com/ggml-org/llama.cpp.git
cd llama.cpp
git checkout b3600  # or any later release tag

2. Configure and Build

CUDA (NVIDIA)

cmake -B build -DBUILD_SHARED_LIBS=OFF -DGGML_CUDA=ON
cmake --build build --config Release

Vulkan (AMD/Intel/NVIDIA)

cmake -B build -DBUILD_SHARED_LIBS=OFF -DGGML_VULKAN=ON
cmake --build build --config Release

CPU Only

cmake -B build -DBUILD_SHARED_LIBS=OFF
cmake --build build --config Release

3. Copy Libraries

Copy all .lib files from build/Release/ into your plugin directory:

<YourProject>/Plugins/GenAILlama/ThirdParty/LlamaCpp/lib/Win64/

Typical files include:

  • llama.lib
  • ggml.lib
  • ggml-base.lib
  • ggml-cpu.lib
  • ggml-cuda.lib (CUDA only)
  • ggml-vulkan.lib (Vulkan only)

Shared Builds (Optional)

If you built with BUILD_SHARED_LIBS=ON, also copy the .dll files into the same lib/Win64/ folder. The plugin will pick them up at runtime in the Editor and ship them with your game when you package — no extra setup needed.

4. Rebuild Your Unreal Project

After placing the files, rebuild your Unreal project. Check the build log for:

GenAILlama: llama.cpp libraries found at <path>. Embedded inference enabled.

Verification

  1. Open your project in Unreal Editor.
  2. Add an Is Embedded Inference Available node in a Blueprint — it should return true.
  3. Use Load Embedded Model with a GGUF file to confirm everything works.

Troubleshooting

“Libraries not found” in build log

  • Check that .lib files are in ThirdParty/LlamaCpp/lib/Win64/, not in a subdirectory.
  • Make sure you built with BUILD_SHARED_LIBS=OFF.

CUDA build fails

  • Verify the CUDA Toolkit is installed and nvcc is in your PATH.
  • Check that your Visual Studio version is supported by your CUDA Toolkit version.

Vulkan build fails

  • Verify the Vulkan SDK is installed and VULKAN_SDK environment variable is set.

See Also

× Full-size image