How to Choose a GPU for Local LLMs: VRAM First
In this article
Selecting the right graphics card for running large language models locally requires prioritizing video RAM (VRAM) above all other specifications. While core clock speeds and CUDA cores matter for inference speed, VRAM is the hard constraint that determines whether a model can load at all. If your GPU lacks sufficient memory to hold the model weights and context window, no amount of processing power will help you run the AI. This guide provides a practical framework for choosing hardware based on this critical bottleneck.
What You'll Need
- A clear understanding of the specific LLM architecture you intend to run (e.g., Llama 3, Mistral, Qwen).
- The desired quantization format (typically 4-bit or 8-bit for consumer hardware).
- The maximum context length (number of tokens) you wish to support in memory.
- Access to a PC with PCIe slots compatible with modern GPUs.
Step-by-Step
- Determine Your Model Size Requirements: Identify the parameter count of the models you want to run. A 7B (billion parameter) model is the entry-level standard, while 13B, 34B, and 70B models offer significantly better reasoning but require exponentially more resources. Start by listing the smallest model that meets your quality needs.
- Calculate Minimum VRAM Based on Quantization: Raw model weights consume significant space. To make these feasible on consumer hardware, you must use "quantization," which reduces precision. For 4-bit quantization (commonly used via GGUF formats), a 7B model requires approximately 5-6 GB of VRAM. A 13B model needs roughly 10-12 GB. A 34B model requires about 20-22 GB. A 70B model typically needs 40+ GB even at 4-bit quantization.
- Add Overhead for Context Window: Loading the model is only half the battle. The GPU must also store the "KV cache" (Key-Value cache) for the conversation history and input prompts. This overhead scales with the number of tokens. For a comfortable experience with long documents, add 2-4 GB of VRAM buffer. If you plan to process very long contexts, this requirement grows rapidly.
- Select GPUs That Meet the Threshold: Compare your calculated total against available hardware. For example, an NVIDIA RTX 3060 with 12 GB VRAM can comfortably run a 7B-8B model with moderate context. An RTX 4090 with 24 GB can handle larger 13B-14B models or heavily optimized smaller models with extensive context. Cards like the RTX 3090/4090 (24GB) are currently the sweet spot for enthusiasts due to their high capacity relative to price.
- Evaluate Memory Bandwidth and Bus Width: Once you have enough VRAM, look at how fast that data moves. Higher bandwidth results in faster token generation (tokens per second). NVIDIA’s GDDR6X memory (found in RTX 30-series and 40-series) generally outperforms older GDDR6. AMD cards often offer more VRAM for the price but may suffer from lower bandwidth or less optimized software stacks, impacting actual speed.
- Check System Compatibility: Ensure your CPU has enough PCIe lanes if using multiple GPUs, though most users start with one. Verify your Power Supply Unit (PSU) has adequate wattage and the correct connectors (usually 8-pin or 12VHPWR for newer cards). Do not attempt to open the PSU casing; ensure it is rated for the load from reputable manufacturers.
Common Mistakes
Many buyers fall into the trap of buying the fastest GPU they can afford without checking memory size first. A top-tier GPU with only 8 GB of VRAM cannot run most modern large models effectively, rendering its speed irrelevant. Another common error is ignoring the context window limit. Users often buy a card that fits the base model weight but find it crashes when trying to load a document or chat history because the KV cache exceeds the remaining free VRAM. Additionally, assuming all GPUs work equally well with local LLMs is misleading. NVIDIA’s CUDA ecosystem remains the most mature and widely supported platform, while AMD ROCm support is improving but can be more complex to configure on Windows.
Tips
Consider buying a used enterprise GPU if budget allows. Older Tesla or Quadro cards with 24 GB or 48 GB of VRAM can sometimes be found cheaply, offering massive capacity for the price, though they lack video outputs and may require cooling modifications. Always check community benchmarks for specific models, as optimization techniques vary. Using efficient loaders like llama.cpp or Ollama simplifies the deployment process significantly compared to raw Python scripts. Finally, remember that system RAM acts as a fallback; if VRAM fills up, the system will swap to your main memory, which is much slower but allows the model to run rather than crash.
Troubleshooting
If your application crashes with an "Out of Memory" error, you have exceeded your VRAM capacity. Try reducing the context length (max tokens) in your settings. Switch to a more aggressive quantization format (e.g., from Q4_0 to Q3_M or Q2_K), though this may slightly reduce intelligence. Close other GPU-intensive applications like games or video editors. If using Linux, ensure your drivers are correctly installed for your specific GPU brand. On Windows, verify that your GPU is actually being utilized by the AI software and not falling back to CPU-only mode due to configuration errors. If performance is sluggish despite having enough VRAM, your memory bandwidth may be the bottleneck; consider lowering the batch size or sequence length to improve throughput.
Frequently Asked Questions
Can I run a 70B model on a single consumer GPU?
No. A 70B model at 4-bit quantization requires approximately 40 GB of VRAM. Most consumer GPUs max out at 24 GB. You would need two high-end GPUs (like dual RTX 3090s/4090s) or specialized server hardware to run this efficiently.
Is AMD or NVIDIA better for local LLMs?
NVIDIA is currently superior due to widespread CUDA support and optimized libraries. AMD offers more VRAM per dollar, but setup can be more difficult, and some tools lack full feature parity with NVIDIA equivalents.
Does more VRAM always mean faster generation?
No. VRAM determines capacity (what you can run), while memory bandwidth and compute cores determine speed (how fast it runs). A card with 24 GB of slower memory might generate tokens slower than a card with 12 GB of faster memory, provided both fit the model.
Do I need a dedicated GPU for small models?
For very small models (under 3B parameters), modern CPUs can sometimes handle them adequately, especially with AVX-512 instructions. However, a GPU will still provide significantly faster response times and smoother interaction.
What is the best budget GPU for starting out?
The NVIDIA RTX 3060 12GB is widely regarded as the best entry-level card. Its 12 GB of VRAM allows it to run 7B-8B models comfortably, making it an affordable gateway to local AI.