Skip to content
Herrius / Enrique Ubaldo

Isolating garak GPU Offload Failure on Windows

Root-cause debugging of garak CPU fallback against RTX 3060 12GB VRAM and llama.cpp b6360.

Running automated LLM vulnerability scanners like garak against local GGUF models requires GPU offloading to stay practical. This debugging note isolates why garak stalled at 0% via LM Studio and fell back to CPU under ggml on Windows 11.

  • OS: Windows 11 (32 GB RAM, NVIDIA GeForce RTX 3060 12 GB VRAM)
  • Tools: garak v0.12.0 upgraded to v0.13.1.pre1, Python 3.11, LM Studio, llama.cpp build b6360 (win-cuda-12.4-x64)
  • Models: gemma3-270m-instruct, Meta-Llama-3-8B-Instruct

Phase 1: LM Studio OpenAI-compatible bridge stalled at 0%

Section titled “Phase 1: LM Studio OpenAI-compatible bridge stalled at 0%”
Terminal window
$env:OPENAICOMPATIBLE_API_KEY="lm-studio"
$env:OPENAI_BASE_URL="http://localhost:1234/v1"
python -m garak --model_type openai.OpenAICompatible --model_name gemma3-270m-instruct --probes dan

Result: the process initialized and hung indefinitely at 0% with zero GPU activity or server logs.

Phase 2: Direct ggml generator fell back to CPU

Section titled “Phase 2: Direct ggml generator fell back to CPU”
Terminal window
$env:GGML_MAIN_PATH="E:\llama-b6360-bin-win-cuda-12.4-x64\llama-cli.exe"
python -m garak --model_type ggml --model_name "C:\path\to\model.gguf" --probes dan

Result: scanning completed, but Task Manager confirmed 100% CPU execution. Passing -ngl through --generator_options and configuration files was ignored in every attempt.

Phase 3: Direct llama-cli.exe control test

Section titled “Phase 3: Direct llama-cli.exe control test”

To prove whether CUDA binaries or driver setup were at fault, llama-cli.exe was executed directly:

Terminal window
./llama-cli.exe -m "C:\path\to\model.gguf" -ngl 35

Result: all layers loaded into RTX 3060 VRAM and inference ran on CUDA cores as expected.

The failure was isolated inside garak (v0.13.1.pre1): its ggml generator fails to forward GPU offload flags (-ngl) properly to the Windows subprocess. Recommended path for local GPU scanning: run garak under WSL2 or patch/track the subprocess generator upstream rather than debugging CUDA drivers unnecessarily.