Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Choose a GPU for Local LLM Inference

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Choosing a GPU for local LLM inference and model development comes down to matching the GPU's memory capacity, memory bandwidth, and compute power to the size of the models you want to run and the type of work you do. This guide walks you through the decision process, from estimating your VRAM needs to picking between NVIDIA, AMD, and Intel options, and avoiding common pitfalls.

What You'll Need

  • A clear idea of the largest model you plan to run (e.g., 7B, 13B, 70B parameters).
  • Knowledge of your current PC's power supply wattage and available PCIe slots.
  • Basic familiarity with model quantization (e.g., 4-bit, 8-bit) and how it affects VRAM.
  • Optional: a list of software you intend to use (e.g., llama.cpp, Hugging Face Transformers, LoRA training).

Step-by-Step

  1. Estimate your VRAM requirement. Start with the model size in parameters. A rough rule: for a 7B model in 4-bit quantization, you need about 4–5 GB VRAM; for 13B, about 8–10 GB; for 70B, about 35–40 GB. Add 1–2 GB for context window and overhead. For training or fine-tuning, multiply the inference requirement by 2–4 depending on batch size and optimizer.
  2. Determine your primary use case. If you only run inference, prioritize VRAM and memory bandwidth. If you train or fine-tune, you also need high compute throughput (TFLOPS) and often more VRAM for gradients and optimizer states.
  3. Check memory bandwidth. LLM inference is heavily memory-bound; tokens per second scale with bandwidth. Look for GPUs with high GDDR6/HBM bandwidth (e.g., 300+ GB/s for decent 7B performance, 500+ GB/s for 13B).
  4. Choose the right brand. NVIDIA is the safest choice because CUDA and cuDNN are the de facto standard for LLM frameworks (PyTorch, TensorFlow, llama.cpp). AMD (ROCm) and Intel (oneAPI) have improved but still require extra setup and may lag in support for some libraries.
  5. Match the GPU to your model size. For 7B models: an RTX 3060 12GB, RTX 4060 Ti 16GB, or used RTX 2080 Ti 11GB work. For 13B: RTX 4070 Ti 12GB or better; for 70B, you need 2× 24GB GPUs (e.g., 3090/4090) or a 48GB+ workstation card like the A6000.
  6. Check your power supply and physical space. High-end GPUs draw 300–450W. Ensure your PSU has enough wattage and the correct PCIe power connectors. Measure your case clearance for length and thickness.
  7. Consider used or older flagship GPUs. For budget builds, a used RTX 3090 (24GB) often outperforms a new mid-range card for LLM work due to its VRAM and bandwidth.
  8. Verify software compatibility. Before buying, check that the GPU is supported by your chosen inference engine (e.g., llama.cpp, Ollama, vLLM) and that the required drivers are available for your OS.
  9. Plan for multi-GPU if necessary. If you need more VRAM than one card provides, consider two GPUs with NVLink (if supported) or simply use model parallelism (e.g., tensor parallelism in vLLM).

Common Mistakes

  • Buying too little VRAM. Many people get a 8GB card and then find they can't run even a 13B model at reasonable quality.
  • Ignoring memory bandwidth. A GPU with high compute but low bandwidth (e.g., some gaming cards) will produce slow token generation.
  • Overlooking power requirements. A 450W PSU cannot handle a 3090; you'll need at least 750W.
  • Assuming AMD works seamlessly. While ROCm has improved, many tutorials assume CUDA; you may spend hours on driver setup.
  • Buying a GPU with too much compute but not enough VRAM for training. Training a 7B model with LoRA still needs ~12-16GB VRAM.

Tips

  • Use quantization to fit larger models into less VRAM. 4-bit quantization (e.g., GGUF Q4_K_M) is a good balance of quality and size.
  • For development, start with a smaller model (e.g., 7B) to iterate faster, then scale up.
  • Check the GPU's FP16/BF16 performance if you plan to train; TFLOPS matter more for training than inference.
  • If you're on a laptop, consider an external GPU (eGPU) – but note the bandwidth loss over Thunderbolt.
  • Look for GPUs with at least 16GB VRAM if you want to future-proof for larger context windows.

Troubleshooting

  • Out of memory errors: Reduce batch size, use a smaller quantization, or offload part of the model to CPU (slower but works).
  • Slow inference: Check if you're using the GPU at all (nvidia-smi). If not, ensure your software is compiled with CUDA support.
  • Driver issues: Uninstall old drivers with DDU (Display Driver Uninstaller) and install the latest stable driver for your GPU.
  • Power shutdowns: Your PSU may be insufficient; upgrade to a higher wattage unit with enough PCIe connectors.
  • AMD GPU not recognized: Install ROCm correctly; for some cards, you may need to set the HSA_OVERRIDE_GFX_VERSION environment variable.

Frequently Asked Questions

How much VRAM do I need for a 7B model?

For 4-bit quantization, about 4-5 GB is enough for inference. For full precision (FP16), you'd need around 14 GB, so quantization is recommended.

Can I run LLMs on a gaming GPU?

Yes, most gaming GPUs work fine. The main limitation is VRAM size; a 12GB RTX 3060 can run 7B models well.

Is NVIDIA really necessary?

Not strictly, but NVIDIA is the most compatible. AMD and Intel are viable if you're willing to troubleshoot; check software support first.

Can I use multiple GPUs to run a large model?

Yes, with model parallelism (e.g., tensor parallelism in vLLM or llama.cpp's --tensor-split). You need enough VRAM combined across GPUs.

What is the difference between inference and training VRAM needs?

Training requires extra memory for gradients and optimizer states. A rule of thumb: training needs 2-4 times the VRAM of inference for the same model.

Should I buy a used GPU?

Used GPUs can be cost-effective, especially for high-VRAM cards like the RTX 3090. Ensure the card has not been mined excessively and check thermals.