Skip to main content
llama.cpp Vulkan on the RTX 3060 12GB: Setup and Measured tok/s for 2026

llama.cpp Vulkan on the RTX 3060 12GB: Setup and Measured tok/s for 2026

A portable local-LLM build that still fits 7B Q4 in 12GB with room for context.

A concrete setup path for llama.cpp with the Vulkan backend on an RTX 3060 12GB — plus community throughput bands per model size, KV cache math, and where Vulkan trails CUDA in 2026.

llama.cpp on an RTX 3060 12GB delivers roughly 40-70 tokens per second on a 7B model at Q4_K_M with all layers offloaded, according to widely referenced community benchmark threads on the ggml-org repository. The Vulkan backend gets close to that with the added benefit of one build that also runs on AMD and Intel GPUs. The CUDA build is still a few percent faster on NVIDIA, but Vulkan is the right pick if you switch cards or need a portable rig.

Why llama.cpp is the default local runtime

llama.cpp is the runtime that made local LLM inference feasible on consumer hardware. It runs anywhere, requires no framework install, and its GGUF weight format has become the de facto exchange format across the local-AI ecosystem. Every major open-weight model release now ships GGUF quantizations within days of the base weights, and every notable local runtime — Ollama, LM Studio, KoboldCpp, text-generation-webui — either wraps llama.cpp directly or shares its GGUF format.

The Vulkan backend is the newer story. Historically llama.cpp built with either CPU-only paths or vendor-specific accelerators (CUDA for NVIDIA, ROCm for AMD, Metal for Apple). Vulkan added a portable GPU backend that runs on any card with a modern Vulkan driver — NVIDIA, AMD, Intel Arc, mobile GPUs — from a single build. That is useful when you rotate cards, deploy to a mixed fleet, or want to avoid dependency hell.

The GIGABYTE RTX 3060 Gaming OC and MSI RTX 3060 12GB Ventus 3X are the two most common 12GB Ampere cards for this workload, both list under a modern midrange Ada card, and both fit the same performance envelope. What follows is a setup path plus what to expect at the other end.

Key takeaways

  • 7B Q4_K_M offloads fully into 12GB with room for a chat context.
  • CUDA build: roughly 45-70 tok/s on 7B Q4 on Ampere.
  • Vulkan build: roughly 35-60 tok/s on the same model — a few percent behind.
  • 13B fits at Q4 with less headroom; 32B partial offload only.
  • KV cache growth is the sneaky ceiling on long-context chat.

What does the Vulkan backend do differently from CUDA?

Both backends do the same work — matrix multiplies for the transformer layers, activation functions, KV cache management — but they target different low-level APIs.

The CUDA backend calls NVIDIA's cuBLAS and its own hand-tuned kernels through the CUDA runtime. It is the reference implementation on NVIDIA hardware and remains a few percent ahead in raw throughput on Ampere and Ada cards.

The Vulkan backend uses SPIR-V compute shaders through the Vulkan compute API. That layer is vendor-neutral: the same binary runs on NVIDIA, AMD, and Intel GPUs with only driver differences underneath. Historically it lagged CUDA meaningfully on NVIDIA hardware, but the gap has narrowed with each release, and on the RTX 3060 12GB the practical difference is small enough that portability wins for many builders.

Two practical trade-offs are worth knowing:

  • Vulkan avoids the CUDA toolkit install. That is a real benefit on machines where CUDA versioning is a hassle or where you swap distributions.
  • Vulkan is worse than CUDA at extremely small batch sizes on very short prompts. The overhead per compute submission is higher. It gets better at longer contexts.

Step-by-step: building llama.cpp with Vulkan for the RTX 3060

The full authoritative reference lives at the llama.cpp repository. The condensed path:

  1. Install the Vulkan SDK. On Linux, use your distribution's vulkan-tools and libvulkan-dev. On Windows, install the LunarG Vulkan SDK. Confirm with vulkaninfo — the RTX 3060 12GB should list as GeForce RTX 3060 with a full feature set.
  2. Clone and build llama.cpp. git clone https://github.com/ggerganov/llama.cpp && cd llama.cpp and then build with the Vulkan flag: cmake -B build -DGGML_VULKAN=ON && cmake --build build --config Release. On Windows, cmake --build build --config Release --parallel uses your available cores.
  3. Grab a GGUF. Any recent 7B chat model from Hugging Face at Q4_K_M is a good first target. wget it into the llama.cpp models directory.
  4. Run with all layers on the GPU. ./build/bin/llama-cli -m models/your-model.gguf -ngl 999 -p "Hello" — the -ngl 999 tells llama.cpp to offload as many layers as fit. On a 7B Q4 model with 12GB, all layers offload.

If everything is wired up, the console prints tokens per second at the end of generation. Cross-check that number against the community-published Vulkan bands below.

How many tokens per second per model size?

Public throughput bands for llama.cpp Vulkan on the RTX 3060 12GB. Numbers vary by clock, thermals, and llama.cpp release. All values are for Q4_K_M unless noted.

Model sizeLayers offloadedVulkan tok/sCUDA tok/s (reference)
7B (Llama 3-8B, Mistral 7B, Qwen 3-7B)All (~32)35-6045-70
8B (Llama 3-8B Instruct)All (~32)32-5542-65
13B (Llama 2 13B)All (~40)12-2215-27
32B (Qwen 32B)Partial (~28 of 60)4-95-12

Two calibrations for reading the table:

  • Tok/s is generation throughput, not end-to-end request latency. Prefill on a long prompt runs faster than generation on both backends.
  • Full offload matters more than the backend choice. A 7B at Q4 fully on the GPU beats a 13B partially offloaded on either backend, by a wide margin.

Quantization matrix on the RTX 3060 12GB

Quantization sets VRAM footprint and impacts quality. For a 7B model, the standard set of quants against a 12GB card:

QuantVRAM used (weights)With 8K KV cacheVulkan tok/sQuality loss vs FP16
Q2_K~2.7 GB~3.7 GB50-70Noticeable
Q3_K_M~3.5 GB~4.5 GB45-65Moderate
Q4_K_M~4.5 GB~5.7 GB35-60Small — sweet spot
Q5_K_M~5.5 GB~6.7 GB30-50Very small
Q6_K~6.2 GB~7.5 GB25-45Near-lossless
Q8_0~8.0 GB~9.5 GB22-40None measurable
FP16~14.5 GBDoesn't fitReference

Q4_K_M is the standard recommendation because it balances quality retention and VRAM footprint. Q5 or Q6 are worth it only for high-precision code or math workloads where the marginal quality improvement matters and you have the headroom.

Prefill vs generation split on the RTX 3060

Two distinct phases matter:

  • Prefill processes the input prompt in parallel. It is compute-bound and hits the tensor cores hard. On a warm 3060 12GB with a 7B Q4 model and Vulkan, prefill lands in the multi-hundred-tokens-per-second range for typical prompt lengths.
  • Generation produces new tokens one at a time. It is memory-bandwidth-bound. On the same setup it lands in the 35-60 tok/s range.

The practical consequence: a long system prompt with a short reply feels almost instant. A short prompt with a long reply — which is what a real chat session looks like — runs at generation throughput. Optimize for the phase your workload actually spends time in.

Context-length impact: how KV cache eats your 12GB

Each token in the context window contributes to the KV cache footprint. On a 7B model at Q4, the KV cache adds roughly the following per 1K tokens of context (approximate, based on model architecture):

ContextApprox. added KV VRAMTotal 7B Q4 footprintRoom left on 12GB
2K~0.25 GB~4.7 GB~7.3 GB
4K~0.5 GB~5.0 GB~7.0 GB
8K~1.0 GB~5.5 GB~6.5 GB
16K~2.0 GB~6.5 GB~5.5 GB
32K~4.0 GB~8.5 GB~3.5 GB
64K~8.0 GB~12.5 GBDoesn't fit

For a single 7B Q4 model the practical context ceiling is around 32K on a 12GB card. Push past that and you have to drop precision, reduce KV precision (llama.cpp supports quantized KV cache), or step down to a smaller model. Do not treat the model VRAM footprint at zero context as your budget — the KV cache is real and grows with the workload.

Storage: does a fast SSD help?

Model loading benefits from NVMe, but inference itself is not disk-bound. Once a GGUF file is in RAM or VRAM, disk speed no longer matters. A Samsung 970 EVO Plus 250GB NVMe is a good boot-plus-active-model drive; pair it with a larger SATA library if you swap between many multi-gigabyte models. Cold-start load time for a 4.5GB Q4 model is a few seconds on NVMe versus a few tens of seconds on a slow SATA drive.

Verdict matrix

Use the Vulkan build if...

  • You want one binary that runs on NVIDIA and AMD.
  • You are on a fresh distribution and CUDA install is friction.
  • You do not want to reinstall CUDA when you upgrade drivers.
  • You are willing to accept a small throughput trade-off.

Stick with the CUDA build if...

  • You are permanently on NVIDIA hardware.
  • You are optimizing for the last few percent of throughput.
  • You already run CUDA for other workloads and the toolkit is installed.
  • Extremely short prompts are your dominant workload shape.

Common pitfalls

  1. Vulkan driver too old. llama.cpp requires Vulkan 1.2 or newer features. On Linux, use a recent mesa or NVIDIA driver; on Windows, keep the vendor driver current.
  2. Forgetting -ngl 999. Without an offload flag, llama.cpp keeps the model on CPU. All-layer offload is the default recommendation for the 7B Q4 sweet spot on the 3060 12GB.
  3. Testing with FP16 on a 7B model. FP16 does not fit with any usable context. Use Q4_K_M as your baseline.
  4. Assuming CUDA is universally faster. The gap narrows for long contexts and vanishes for some very recent llama.cpp releases. Retest whenever you upgrade.
  5. Ignoring thermal throttling. The MSI Ventus 3X has a triple-fan cooler; the GIGABYTE Gaming OC is dual-fan. Both are fine in a case with reasonable airflow, but a poorly-vented mini-tower will cost throughput.

When NOT to use Vulkan

  • You are on Apple Silicon. Use the Metal backend.
  • You are on AMD Instinct. ROCm HIP is the tuned path.
  • You need every last percent on NVIDIA. CUDA still wins by a hair.

Related guides

Bottom line

The RTX 3060 12GB with llama.cpp Vulkan is the cheapest reliable path to real local LLM inference in 2026. You get 35-60 tokens per second on the 7B tier, comfortable 8K to 16K context, and a build that will keep working if you swap cards in the future. Pair it with a Ryzen 7 5800X for fast prefill and cold starts, a Samsung 970 EVO Plus NVMe for quick model loads, and 32 GB of DDR4 for KV overflow headroom. The result is a rig that does everything most local-AI users actually do, at a total build cost most cloud teams burn in a month.

Citations and sources

This piece is editorial synthesis based on publicly available information. No independent first-party benchmarking is reported.

Products mentioned in this article

Tap any product for full specs, live Amazon & eBay pricing, and alternatives.

SpecPicks earns a commission on qualifying purchases through both Amazon and eBay affiliate links. Prices and stock update independently.

Watch a review

Friendly Fire: AMD Ryzen 7 5800X CPU Review & Benchmarks vs. 5600X & 5900X — Gamers Nexus on YouTube

Frequently asked questions

Should I use the Vulkan or CUDA build of llama.cpp on an RTX 3060?
For NVIDIA cards the CUDA build is usually fastest, but the Vulkan backend is valuable when you want one binary that also runs on AMD or Intel GPUs, or when CUDA toolkit setup is a hassle. On the RTX 3060 12GB the Vulkan build gets close enough that portability often wins for the local-AI use case.
How many layers can I offload to 12GB of VRAM?
It depends on model size and quantization. A 7B-8B model at 4-bit typically fits fully in 12GB with room for context, so you offload all layers. Larger 13B models fit at lower quantization, and 32B-class models require partial offload with the remainder split to CPU RAM, which is far slower but still workable.
Does context length affect how much VRAM I need?
Yes — the KV cache grows with context length and consumes VRAM on top of the model weights. Pushing a long context on a 12GB card can force you to offload fewer layers or drop to a smaller quantization, so plan for KV overhead upfront when you size a workload that expects long conversations or large documents.
Do I need a fast SSD for llama.cpp?
A fast SSD like the Samsung 970 EVO Plus mainly speeds model loading, not inference — once a GGUF file is in RAM or VRAM, disk speed no longer matters. But if you swap between several multi-gigabyte models regularly, an NVMe drive turns cold-start from tens of seconds into a few seconds and is worth the small price bump.
Which quantization is the sweet spot on an RTX 3060?
For most users, q4_K_M balances quality and footprint: it keeps a 7B-8B model fully on the 12GB card at strong speeds with minimal quality loss versus higher precision. Drop to q3 only when you need to squeeze a bigger model in; move up to q5 or q6 when quality matters more than raw throughput.

Sources

— SpecPicks Editorial · Last verified 2026-07-07

More guides & deep dives from the SpecPicks archive

Browse all articles & guides →

More reviews from the SpecPicks archive

Browse all reviews →

More buying guides from SpecPicks

Browse all buying guides →