This is a draft document that was built and uploaded automatically. It may document beta software and be incomplete or even incorrect. Use this document at your own risk.

Jump to contentJump to page navigation: previous page [access key p]/next page [access key n]
Configuring GPU pass-through for NVIDIA Cards

Configuring GPU pass-through for NVIDIA Cards

Publication Date: 14 Sep 2026

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

  1. 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/O
    1. If VT-d is not enabled in the firmware, enable it.

    2. Reboot the host.

  2. 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 nvidia
      
      03: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-40GB

      • L4: 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.

  1. 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"
  2. When you save the modified /etc/default/grub file, re-generate the main GRUB 2 configuration file /boot/grub2/grub.cfg:

    > sudo grub2-mkconfig -o /boot/grub2/grub.cfg
  3. Reboot 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

  1. 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.0
    
    03:00.0 3D controller [0302]: NVIDIA Corporation GV100 [Tesla V100 PCIe] [10de:1db4] (rev a1)
  2. Create the file /etc/modprobe.d/vfio.conf with the following content:

    options vfio-pci ids=10de:1db4
    Note
    Note: Cards requiring an additional device ID

    Some cards expose a separate audio function on the same bus and slot, for example, 03:00.1. Check for one with lspci -nn | grep 03:00: if an audio device shows up alongside the GPU, add its ID to the ids= parameter too, otherwise you cannot use the card.

1.5 Load the VFIO driver

There are three ways you can load the VFIO driver.

Note
Note: IOMMUFD in kernel 6.12

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

  1. Create the file /etc/dracut.conf.d/gpu-passthrough.conf with the following content (mind the leading whitespace):

    add_drivers+=" vfio vfio_iommu_type1 vfio_pci vfio_virqfd"
  2. Re-generate the initrd file:

    > sudo dracut --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:

> sudo modprobe 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:

> sudo zypper 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:

> sudo shutdown -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 Customize configuration before install 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

  1. Download the driver RPM package from the official NVIDIA driver download page at https://www.nvidia.com/Download/index.aspx.

  2. Install the downloaded RPM package:

    > sudo rpm -i nvidia-diag-driver-local-repo-sles*.rpm
  3. Refresh repositories and install cuda-drivers:

    > sudo zypper refresh && zypper install cuda-drivers
  4. Reboot the guest VM:

    > sudo shutdown -r now
Note
Note: Minimum driver version for CUDA

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

  1. Because the installer needs to compile the NVIDIA driver modules, install the gcc-c++ and kernel-devel packages.

  2. NVIDIA driver modules are unsigned, so disable Secure Boot on the guest. Either disable it in the UEFI firmware setup, or use mokutil to enroll a Machine Owner Key. Find more information about UEFI Secure Boot in Using UEFI Secure Boot.

  3. 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-*.run
  4. Run the script to complete the driver installation:

    > sudo ./NVIDIA-Linux-x86_64-*.run
  5. Download 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.

Note
Note: Display issues

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:

> sudo systemctl stop display-manager && systemctl disable display-manager
  1. Verify the installation with the NVIDIA System Management Interface:

    > nvidia-smi
  2. Change to the directory of a CUDA sample. For example, the deviceQuery sample:

    > cd /usr/local/cuda/samples/1_Utilities/deviceQuery
  3. Compile the sample:

    > sudo make
  4. Run the compiled sample:

    > ./deviceQuery

2.2.4 Microsoft Windows guest

Important
Important: Hide the hypervisor from the guest drivers

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>
  1. Download and install the NVIDIA driver from https://www.nvidia.com/Download/index.aspx.

  2. Download and install the CUDA toolkit from https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64.

  3. Find several NVIDIA demo samples in the directory Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.x\extras\demo_suite on the guest.

Note
Note: Microsoft Windows driver no longer bundled with the CUDA Toolkit

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: