In this article
Near-native throughput is possible, but small differences between changed configurations do not isolate virtualization overhead or establish a universal penalty.
A virtual machine with a dedicated graphics card can run a local language model at a speed close to native execution. Several individual experiments demonstrate this possibility, without establishing a universal virtualization adjustment. A 1–2% difference needs particular care: interpreting it requires repeated measurements under matching conditions, rather than two final numbers alone.
Two public AMD GPU experiments prompted this discussion. One author compared Ollama running directly on Ubuntu with a virtual-machine deployment; another moved the graphics card to a different computer altogether. Both reports are useful to home-server owners who want an isolated guest system and administrators weighing VM management against native operation.
What two graphics-card reports measured
In a June 2025 Reddit post, the author describes testing a Radeon RX 9060 XT with 16 GB VRAM. Both environments used Ubuntu 24.04, once directly on the computer and once inside a VM receiving the GPU through vfio-pci. Listed models include Mistral 7B, Gemma 2 9B, Phi-4 14B and DeepSeek-R1 14B. The author reports that the VM was 1–2% slower.
That observation is not a verified constant even for this card: the post lacks a per-model table, repetition counts and variability. The linked README-GPU-PASSTHROUGH-BENCHMARK.md returned 404 when checked. No verifiable historical revision was found. The numerical claim remains attributable only to the original Reddit post; stability of the results and the exact measurement procedure remain unknown.
In a separate 23 September 2026 report, Orkun Soylu describes moving a Radeon Pro W7800 with 48 GB VRAM from a workstation to a Proxmox VM. The previous machine had a Ryzen 5 7600 and 64 GB DDR5-6400; the new host had a Core i5-13400 and 64 GB DDR5-4800. The main Ubuntu 26.04 guest test received 8 virtual CPUs and 40 GB RAM. He specifies Ollama 0.34 with ROCm, Qwen3.8-27B Q8_0 with MTP, and the same script for both runs; he says the model files matched byte for byte.
Average generation throughput across four prompts was 43.0 tokens/s on bare metal and 42.1 tokens/s in the VM, approximately 2.1% lower relative to the first result. Individual prompts differed in direction: Python code generated at 53.1 versus 49.4 tokens/s, while a Bash script reached 47.0 versus 48.6. Cold processing of a 20-thousand-token prompt reached 554–557 versus 600 tokens/s, and model loading took approximately 60 versus 20 seconds. These measure entire configurations, rather than isolated VM overhead: the processor, memory and platform also changed. The author calls the generation difference noise, but the page supplies no repetition counts or statistical spread to verify that interpretation.
What another comparison adds
A 22 July 2025 dstack publication compares a server scenario: one AMD Instinct MI300X, vLLM and Llama 3.3 70B Instruct. Workloads ran containerized inside a VM and on bare metal. The latter was restricted to 13 Xeon Platinum 8470 cores and 224 GiB RAM to match the guest. Random requests used 1024 input and 1024 output tokens at several concurrency levels.
The authors report similar results at 16–64 concurrent requests, with a small bare-metal advantage at some other loads. This is additional evidence, but Hot Aisle supported the comparison by providing infrastructure and sells AMD GPU servers and VMs. A server GPU under concurrent serving also does not reproduce interactive home use; the result cannot be extended to every card or model.
Why a VM can be fast
With PCIe passthrough, the hypervisor assigns a physical graphics card to a guest, where a driver uses it. Linux VFIO exposes direct device access with IOMMU protection, limiting device access to memory. Isolation can require assigning an entire IOMMU group rather than one logical device, depending on system topology. The mechanism is described in the Linux kernel documentation.
If model computation largely stays on the GPU, direct assignment avoids emulating every graphics-card operation. It does not imply zero virtualization cost: guest CPU and RAM, transfers, memory placement, drivers and competing processes can affect performance. A separate VM also consumes resources and requires configuration. This differs from dividing a GPU among containers or virtual GPUs.
The W7800 experiment encountered problems before speed comparisons began. The author enlarged the guest firmware’s PCIe address-space window and installed AMD firmware. With 24 GB guest RAM, an SVM mapping limit prevented loading; 40 GB worked. In the same setup, llama-bench silently fell back to the CPU and reported 2.4 tokens/s with no GPU utilization, while Ollama’s runner used the card. These are specific problems from one installation, rather than mandatory properties of every VM. Source.
Comparing on the actual computer
A fair comparison uses the same physical computer and GPU, matching model files, quantization, context, engine version, drivers and request settings. Verify actual GPU activity and allocated VRAM, then perform warm-up and repeated runs, alternating modes where possible. Publish individual results and variability alongside averages.
Measure prompt processing separately from answer generation: the former matters especially for long documents, while the latter shapes interactive conversation. The Ollama API returns processed input and output token counts and durations in nanoseconds; prefill calculations need to account for cached tokens. Model-loading time and first-token latency answer different questions and cannot be replaced by one tokens-per-second figure.
Small differences require especially careful protocols. An October 2026 Microsoft Research study using A100 and vLLM reduced average coefficient of variation from 15.2% to 2.2% for repetition-level median TTFT values through a more controlled method. This studies reproducibility, rather than VM versus bare metal. The practical choice depends on the workload: if VM isolation and management are useful, test passthrough while measuring the actual system’s speed and stability.
GPU containers and VMs explains deployment differences. The inference benchmarking method provides a repeatable measurement framework that helps separate an environment change from a changed workload.
Sources
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.