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.
Environment
Section titled “Environment”- OS: Windows 11 (32 GB RAM, NVIDIA GeForce RTX 3060 12 GB VRAM)
- Tools:
garakv0.12.0 upgraded tov0.13.1.pre1, Python 3.11, LM Studio,llama.cppbuildb6360(win-cuda-12.4-x64) - Models:
gemma3-270m-instruct,Meta-Llama-3-8B-Instruct
Isolation Chronology
Section titled “Isolation Chronology”Phase 1: LM Studio OpenAI-compatible bridge stalled at 0%
Section titled “Phase 1: LM Studio OpenAI-compatible bridge stalled at 0%”$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 danResult: 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”$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 danResult: 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:
./llama-cli.exe -m "C:\path\to\model.gguf" -ngl 35Result: all layers loaded into RTX 3060 VRAM and inference ran on CUDA cores as expected.
Root Cause & Operational Options
Section titled “Root Cause & Operational Options”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.