Configuring GPU pass-through for NVIDIA Cards
GPU pass-through assigns a physical NVIDIA* GPU directly to a virtual machine, giving it near-native graphics and compute performance instead of a shared, virtualized device. Use it for machine learning, AI workloads, 3D rendering, and other compute-intensive tasks that need direct hardware access. After configuring pass-through on the host and installing the guest driver, the virtual machine can use the GPU as if it were installed locally.
Prerequisites:
GPU pass-through is supported on the AMD64/Intel 64 architecture only.
The host operating system needs to be SUSE Linux Enterprise Server 16 or newer.
This article covers GPU pass-through for NVIDIA Tesla, Data Center, and RTX series cards, for GPU computation purposes only.
For optimal CUDA compute performance with System-Allocated Memory (SAM) migration, kernel 6.12 or newer is recommended to include required HMM fixes.
To manage the host system after configuring GPU pass-through, you need either an additional display card on the host or a functional SSH connection.
1 Configuring the host #
Complete the following steps on the host to prepare an NVIDIA GPU for pass-through to a virtualized guest.
1.1 Verify the host environment #
Verify that the host supports VT-d technology and that it is already enabled in the firmware settings:
>dmesg | grep -e "Directed I/O"[ 12.819760] DMAR: Intel(R) Virtualization Technology for Directed I/OIf VT-d is not enabled in the firmware, enable it.
Reboot the host.
Verify that the host has an extra GPU or VGA card:
Check for a generic VGA-compatible controller:
>lspci | grep -i "vga"07:00.0 VGA compatible controller: Matrox Electronics Systems Ltd. \ MGA G200e [Pilot] ServerEngines (SEP1) (rev 05)Check for an NVIDIA card directly, for example with a Tesla V100 card:
>lspci | grep -i nvidia03:00.0 3D controller: NVIDIA Corporation GV100 [Tesla V100 PCIe] (rev a1)The output varies by card model, for example:
Tesla V100:
NVIDIA Corporation GV100 [Tesla V100 PCIe]A100:
NVIDIA Corporation A100-SXM4-40GBL4:
NVIDIA Corporation L4
1.2 Enable IOMMU #
IOMMU is disabled by default. You
need to enable it at boot time in the
/etc/default/grub configuration file.
For Intel-based hosts:
GRUB_CMDLINE_LINUX="intel_iommu=on iommu=pt rd.driver.pre=vfio-pci"
For AMD-based hosts:
GRUB_CMDLINE_LINUX="iommu=pt amd_iommu=on rd.driver.pre=vfio-pci"
When you save the modified
/etc/default/grubfile, re-generate the main GRUB 2 configuration file/boot/grub2/grub.cfg:>sudogrub2-mkconfig -o /boot/grub2/grub.cfgReboot the host and verify that IOMMU is enabled:
>dmesg | grep -e DMAR -e IOMMU
1.3 Blacklist the Nouveau driver #
To assign the NVIDIA card to a VM guest, prevent the host OS from
loading the built-in nouveau driver for NVIDIA
GPUs. Create the file
/etc/modprobe.d/60-blacklist-nouveau.conf with the
following content:
blacklist nouveau
1.4 Configure VFIO and isolate the GPU used for pass-through #
Find the card vendor and model IDs. Use the bus number identified in the host verification step, for example,
03:00.0:>lspci -nn | grep 03:00.003:00.0 3D controller [0302]: NVIDIA Corporation GV100 [Tesla V100 PCIe] [10de:1db4] (rev a1)Create the file
/etc/modprobe.d/vfio.confwith the following content:options vfio-pci ids=10de:1db4
Note: Cards requiring an additional device IDSome cards expose a separate audio function on the same bus and slot, for example,
03:00.1. Check for one withlspci -nn | grep 03:00: if an audio device shows up alongside the GPU, add its ID to theids=parameter too, otherwise you cannot use the card.
1.5 Load the VFIO driver #
There are three ways you can load the VFIO driver.
Kernel 6.12 introduces IOMMUFD as the new user API for VFIO. The legacy vfio_iommu_type1 container/group model is still supported but gradually being superseded. For libvirt-based passthrough (virt-manager, virt-install), no changes are required as libvirt abstracts the VFIO interface.
1.5.1 Including the driver in the initrd file #
Create the file
/etc/dracut.conf.d/gpu-passthrough.confwith the following content (mind the leading whitespace):add_drivers+=" vfio vfio_iommu_type1 vfio_pci vfio_virqfd"
Re-generate the initrd file:
>sudodracut --force /boot/initrd $(uname -r)
1.5.2 Adding the driver to the list of auto-loaded modules #
Create the file
/etc/modules-load.d/vfio-pci.conf and add the
following content:
vfio vfio_iommu_type1 vfio_pci kvm kvm_intel
1.5.3 Loading the driver manually #
To load the driver manually at runtime, execute the following command:
>sudomodprobe vfio-pci
1.6 Disable MSR for Microsoft Windows guests #
For Microsoft Windows guests, we recommend disabling MSR (model-specific
register) to avoid the guest crashing. Create the file
/etc/modprobe.d/kvm.conf and add the following
content:
options kvm ignore_msrs=1
1.7 Install UEFI firmware #
For proper GPU pass-through functionality, the host needs to boot using UEFI firmware, not a legacy-style BIOS boot sequence. Install the qemu-ovmf package if not already installed:
>sudozypper install qemu-ovmf
1.8 Reboot the host machine #
For most of the changes in the above steps to take effect, you need to reboot the host machine:
>sudoshutdown -r now
2 Configuring the guest #
This section describes how to configure the guest virtual machine so that
it can use the host's NVIDIA GPU. Use virt-manager or
virt-install to install the guest VM. Find more
details in Guest installation.
2.1 Requirements for the guest configuration #
During the guest VM installation, select and configure the following devices:
Use Q35 chipset for proper PCIe passthrough with modern GPUs.
Install the guest VM using UEFI firmware.
Add the following emulated devices:
Graphic: VNC
Device: virtio-gpu, VGA or Virtio
Find more information in Configuring Virtual Machines with Virtual Machine Manager.
Add the host PCI device (for example,
03:00.0) to the guest. Find more information in Assigning Host Devices to Virtual Machines.For the best performance, we recommend using virtio drivers for the network card and storage.
2.2 Install the graphic card driver #
2.2.1 RPM-based Linux distributions #
Download the driver RPM package from the official NVIDIA driver download page at https://www.nvidia.com/Download/index.aspx.
Install the downloaded RPM package:
>sudorpm -i nvidia-diag-driver-local-repo-sles*.rpmRefresh repositories and install cuda-drivers:
>sudozypper refresh && zypper install cuda-driversReboot the guest VM:
>sudoshutdown -r now
CUDA 13.3 requires driver version 610.43.02 or newer. The minimum driver version for CUDA 13.x is 580.
2.2.2 Generic Linux installer #
Because the installer needs to compile the NVIDIA driver modules, install the gcc-c++ and kernel-devel packages.
NVIDIA driver modules are unsigned, so disable Secure Boot on the guest. Either disable it in the UEFI firmware setup, or use
mokutilto enroll a Machine Owner Key. Find more information about UEFI Secure Boot in Using UEFI Secure Boot.Download the driver installation script from https://www.nvidia.com/Download/index.aspx?lang=en-us and make it executable:
>chmod +x NVIDIA-Linux-x86_64-*.runRun the script to complete the driver installation:
>sudo./NVIDIA-Linux-x86_64-*.runDownload CUDA drivers from https://developer.nvidia.com/cuda-downloads and install following the on-screen instructions.
2.2.3 Testing the Linux driver installation #
Regardless of which installation method you used, verify the driver installation as follows.
After you have installed the NVIDIA drivers, the virt-manager display
loses its connection to the guest OS. To access the guest VM, you
must either login via ssh, change to the console
interface, or install a dedicated VNC server in the guest. To avoid
a flickering screen, stop and disable the display manager:
>sudosystemctl stop display-manager && systemctl disable display-manager
Verify the installation with the NVIDIA System Management Interface:
>nvidia-smiChange to the directory of a CUDA sample. For example, the deviceQuery sample:
>cd /usr/local/cuda/samples/1_Utilities/deviceQueryCompile the sample:
>sudo makeRun the compiled sample:
>./deviceQuery
2.2.4 Microsoft Windows guest #
Before you install the NVIDIA drivers, you need to hide the
hypervisor from the drivers by using the <hidden
state='on'/> directive in the guest's libvirt
definition, for example:
<features> <acpi/> <apic/> <kvm> <hidden state='on'/> </kvm> </features>
Download and install the NVIDIA driver from https://www.nvidia.com/Download/index.aspx.
Download and install the CUDA toolkit from https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64.
Find several NVIDIA demo samples in the directory
Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.x\extras\demo_suiteon the guest.
Starting with CUDA 13.1, the Microsoft Windows display driver is no longer bundled with the CUDA Toolkit. You must download and install the appropriate NVIDIA driver separately from the official NVIDIA driver download page.
3 For more information #
For further steps in virtualization, refer to the following sources:
Converting VMware Virtual Machines to KVM with virt-v2v
4 Legal Notice #
Copyright© 2006– 2026 SUSE LLC and contributors. All rights reserved.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or (at your option) version 1.3; with the Invariant Section being this copyright notice and license. A copy of the license version 1.2 is included in the section entitled “GNU Free Documentation License”.
For SUSE trademarks, see https://www.suse.com/company/legal/. All other third-party trademarks are the property of their respective owners. Trademark symbols (®, ™ etc.) denote trademarks of SUSE and its affiliates. Asterisks (*) denote third-party trademarks.
All information found in this book has been compiled with utmost attention to detail. However, this does not guarantee complete accuracy. Neither SUSE LLC, its affiliates, the authors, nor the translators shall be held liable for possible errors or the consequences thereof.