Skip to main content

Guides

Unified Memory for Local LLMs

A 16 GiB Mac shares memory between the CPU, GPU and macOS. A PC with dedicated VRAM has two budgets. Follow the same model through both estimates.

By Updated 4 min read

On an Apple Silicon Mac, the CPU and GPU draw from the same physical pool of unified memory. On a typical desktop with a dedicated graphics card, the CPU uses system memory (RAM) and the graphics card has its own dedicated graphics memory (VRAM). When choosing a model, first identify which pool has to hold its weights and working data.

Shared memory and dedicated VRAM

Apple Silicon lets the CPU and GPU access data in the same physical memory, which can avoid making separate copies for each processor. The operating system, open apps and model still compete for that memory. Integrated graphics on supported Windows and Linux PCs also draw from system RAM. A shared graphics memory figure is part of that pool. The amount available to a model depends on the hardware, driver and whether the model runner can use the integrated GPU.

On a PC with a dedicated GPU, check system RAM and VRAM separately. With GPU offload, the model runner places some or all of the model on the GPU. If the GPU portion needs more VRAM than is available, moving some work to the CPU can let it run in system RAM, often at a speed cost.

NVIDIA uses CUDA Unified Memory to describe a programming feature. When the software uses CUDA managed memory, the CPU and GPU can access the same allocation. On a desktop with separate RAM and VRAM, CUDA can migrate pages between those pools on supported configurations. The pools remain physically separate, and repeated transfers can slow generation. Whether this can help depends on the runner and hardware.

What needs room

  • Model weights are the learned numbers in the model file. Quantization, such as Q4_K_M, compresses them. File size helps estimate weight memory, and the running model needs room for more than its weights.
  • Conversation memory (KV cache) holds information the model reuses while processing context. It grows as context length increases. Context includes instructions, conversation, any supplied document text and room for the reply.
  • Model-runner memory and temporary calculation memory cover the software and buffers needed to load and run the model.
  • The operating system and open apps use part of the installed memory. On a shared-memory system they compete with both the CPU and GPU portions of the workload.

Capacity tells you how much can fit. Bandwidth tells you how quickly the processor can read and write that memory. Two computers can fit the same model and generate text at different speeds. A fit estimate helps you choose what to try. The speed you experience also depends on the processor, model runner and how much work stays on the GPU.

Compare the same model on a Mac and a desktop

Open the RAM and VRAM calculator and run the same example twice. Keep the model, compression, and conversation length the same in both runs. Under Your computer, open Use an example computer to select each setup below. Start with Allow CPU offload off so the desktop run shows what fits on the GPU.

Calculator inputApple Silicon MacDesktop with a dedicated GPU
Example computerMac, 16 GB unified memoryDesktop GPU, 12 GB VRAM
Memory entered by the example16 GiB unified memory32 GiB system RAM and 12 GiB dedicated VRAM
Model and model compressionQwen3 8B, Q4 - compactQwen3 8B, Q4 - compact
App or model runnerLM StudioLM Studio
Conversation length (context)4,096 tokens4,096 tokens
Conversation memory format (KV cache)AutoAuto

This Q4 setting represents the Q4_K_M model file. Read the calculator's estimated memory remaining or shortfall for each setup. On the Mac, read the result against the shared pool. On the desktop, check whether the GPU workload fits in 12 GiB of VRAM and read the system RAM estimate separately. If the desktop needs more VRAM, try a shorter conversation or a smaller model. Recalculate with CPU offload only if your runner supports it and you intend to use it.

The desktop GPU and driver are unspecified, so check that LM Studio can use them. On the Mac, inspect Memory Pressure while the model and your normal apps are open. On the desktop, inspect GPU placement and dedicated VRAM under load. If its GPU runs out while RAM remains free, recalculate an explicit offload configuration before trying again.

For other sizes and context settings, see local LLM RAM and VRAM requirements. If you're choosing software for a Mac, compare local AI setups for Mac.

Sources