Can an RX 7900 XTX run Gemma 4 31B Instruct?
Yes
At Q4_K_M it needs 21.31 GB of the 23.2 GB available and generates around 28.7 tokens per second at an 8k context window.
In practice
Gemma 4 31B Instruct sits comfortably on RX 7900 XTX. At Q4_K_M it takes 21.31 GB of the 23.2 GB available, which leaves 1.89 GB spare, enough for the 8k window we assumed and for a window of up to about 8k tokens before memory runs out. Generation runs at about 28.7 tokens per second, well past the speed anyone reads at, so a 500-token answer takes about 15 seconds.
Of the memory in use, 82% is the weights and 15% is the attention cache. With this much room the question is quality, not fit. The next step up, Q5_K_M, needs 24.44 GB and does not fit, so Q4_K_M is where we would stay.
Reading a 4,000-token prompt, roughly a long email or a few pages of text, takes about 7 seconds before the first word appears. That part is limited by compute and not by bandwidth, so it follows a different spec from the writing speed.
The numbers
Gemma 4 31B Instruct has 31.27 billion parameters across 60 layers. The Radeon RX 7900 XTX has 24 GB of VRAM at 960 GB/s, of which about 23.2 GB is left for a model once the operating system has taken its share.
| Quantization | Total needed | Fits | Speed |
|---|---|---|---|
| Q8_0 | 34.67 GB | partial | 2.3 t/s |
| Q6_K | 27.61 GB | partial | 5.3 t/s |
| Q5_K_M | 24.44 GB | partial | 11.0 t/s |
| Q4_K_M | 21.31 GB | yes | 28.7 t/s |
| IQ4_XS | 19.2 GB | yes | 31.9 t/s |
| Q3_K_M | 17.96 GB | yes | 34.2 t/s |
| IQ3_XXS degraded | 14.87 GB | yes | 41.5 t/s |
| Q2_K degraded | 15.93 GB | yes | 38.7 t/s |
| IQ2_XXS degraded | 11.23 GB | yes | 55.6 t/s |
6 of the 9 levels fit entirely. Levels marked degraded are listed for completeness, not as advice. Rows marked partial or experts in RAM run with part of the model in system RAM, at the speed shown.
How long a conversation it holds
Memory rises with the length of the conversation because the attention cache keeps a key and a value for every token. At Q4_K_M, the longest window that still fits on this device is 8k tokens. Setting the window to what you need and no more is the cheapest way to buy back memory.
| Context | Cache | Total | Fits |
|---|---|---|---|
| 4k | 2.03 GB | 20.06 GB | yes |
| 8k | 3.28 GB | 21.31 GB | yes |
| 16k | 5.78 GB | 23.81 GB | no |
| 32k | 10.78 GB | 28.81 GB | no |
| 64k | 20.78 GB | 38.81 GB | no |
| 128k | 40.78 GB | 58.81 GB | no |
The settings we would use
llama-server -m <model>.gguf -ngl all -c 8192 -fa on
In Ollama, set OLLAMA_CONTEXT_LENGTH to the window you want, run ollama ps while the model is loaded and check that
the processor column reads 100% GPU. If it shows a split on a model that fits, the Ollama guide shows how to fix it.
The llama.cpp flags guide explains each option above.
What else an RX 7900 XTX runs well
For comparison, these are the other popular models that fit this device at a sound quantization, best pairings first.
| Model | Quantization | Memory | Speed |
|---|---|---|---|
| Qwen3.5 27B | Q6_K | 21.33 GB | 28.7 t/s |
| Qwen3 32B | Q4_K_M | 20.42 GB | 30.0 t/s |
| Gemma 4 12B Instruct | Q8_0 | 13.55 GB | 45.6 t/s |
| Qwen3 14B | Q8_0 | 15.54 GB | 39.7 t/s |
The same model on nearby hardware
Memory decides whether Gemma 4 31B Instruct loads and bandwidth decides how quickly it answers. Here is what a step down, a card with the same memory and a step up do with it.
| Device | Memory | Bandwidth | Result |
|---|---|---|---|
| GeForce RTX 5080 | 16 GB | 960 GB/s | does not fit |
| GeForce RTX 4090 | 24 GB | 1008 GB/s | Q4_K_M, 35.5 t/s |
| GeForce RTX 5090 | 32 GB | 1792 GB/s | Q6_K, 48.5 t/s |
See how fast it feels
Radeon RX 7900 XTX running Gemma 4 31B Instruct at Q4_K_M
YouWhy does my model use more memory when the conversation gets longer?
Reading your question
Simulated from our estimate at a 512-token question, not a recording. Assumes nothing else is competing for the GPU.
Questions people ask
How much VRAM does Gemma 4 31B Instruct need on RX 7900 XTX?
At Q4_K_M with an 8k context window it needs 21.31 GB in total: 17.58 GB of weights, 3.28 GB of KV cache and 0.45 GB of runtime overhead. The Radeon RX 7900 XTX makes about 23.2 GB available once the operating system has taken its share.
What context length can RX 7900 XTX handle with Gemma 4 31B Instruct?
At Q4_K_M the longest window that still fits is about 8k tokens. Memory grows with the window, so a shorter one leaves room for a higher quantization.
How fast is Gemma 4 31B Instruct on RX 7900 XTX?
We estimate about 28.7 tokens per second at Q4_K_M, which is faster than most people read. A 500-token answer takes about 15 seconds. Memory bandwidth of 960 GB/s sets that ceiling, and the estimate is good to about 10 to 30 percent.
Keep going
Everything the Radeon RX 7900 XTX runs, the full breakdown for Gemma 4 31B Instruct, how the numbers are made in the methodology, or a different pairing in the calculator.