Installing Ubuntu and vGPU Configuration#

Important

This page provides the end-to-end deployment workflow. Some steps link to detailed procedures in other NVIDIA or Ubuntu documentation. After completing a linked procedure, return to this page to continue with the next step.

Before You Begin#

Review and complete the requirements in the Overview before starting this workflow. In particular, confirm that the NVIDIA GPU, server platform, Ubuntu host release, guest operating system, and NVIDIA vGPU software release are supported together. Also verify that all the necessary Server BIOS Settings are enabled.

Record the following information before you begin. You will use it throughout the deployment:

  • Ubuntu host release

  • NVIDIA vGPU software release

  • Physical GPU model

  • Guest operating system

  • Intended workload and application requirements

Note

Use a virtual GPU Manager and guest driver combination that is supported by your NVIDIA vGPU software release. Refer to the Ubuntu release notes linked from the Overview for compatible versions.

Downloading Ubuntu#

The instructions from this guide target Ubuntu Server 24.04 LTS. Download the installation image from the Ubuntu 24.04 LTS release page.

The Ubuntu download site might offer a newer LTS release. Before using a different release, confirm that it is supported by the NVIDIA vGPU software release that you are deploying in the Ubuntu validated platforms documentation.

Installation and Configuration for Ubuntu with KVM#

Complete these hypervisor-specific steps in order:

  1. Create bootable installation media: Follow the Ubuntu instructions to create a bootable USB drive from the downloaded ISO image.

  2. Install Ubuntu Server: Follow the Ubuntu Server installation tutorial to install the operating system.

  3. Update Ubuntu: After installation, update the system:

    sudo apt update
    sudo apt upgrade
    
  4. Install and configure KVM and libvirt: Follow the Ubuntu libvirt instructions.

  5. Enable IOMMU on the kernel command line: Enabling VT-d/IOMMU in the BIOS makes the hardware available, but the kernel must also be instructed to use it. Confirm that IOMMU is active:

    ls /sys/kernel/iommu_groups
    

    If the command lists one or more groups, continue to the next step. If it returns nothing, add intel_iommu=on for an Intel CPU, or amd_iommu=on for an AMD CPU, to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub, then apply the change and reboot:

    sudo update-grub
    sudo reboot
    

    After the host restarts, run the ls command again and continue only when IOMMU groups are listed.

Before continuing, install the cpu-checker package and verify that KVM acceleration is available:

sudo apt install cpu-checker
kvm-ok

Continue only if the command reports that KVM acceleration can be used.

NVIDIA vGPU Configuration#

NVIDIA vGPU Manager#

The NVIDIA vGPU Manager runs on the Ubuntu KVM host and enables the physical GPU to provide vGPU devices to guest VMs.

  1. Download the Ubuntu virtual GPU Manager package for your selected NVIDIA vGPU software release from the NVIDIA Licensing Portal. The package contains the NVIDIA virtual GPU Manager and the guest drivers. For download instructions, see Downloading NVIDIA vGPU Software.

  2. Follow Installing the NVIDIA vGPU Manager Package for Ubuntu.

  3. Complete Verifying the Installation of the NVIDIA vGPU Manager for Ubuntu.

Continue only when the verification procedure confirms that the required driver modules are loaded, libvirt is active, and nvidia-smi on the host lists all expected physical GPUs.

Setting Up and Managing vGPU VMs#

The following sections guide you through selecting a vGPU type, creating the base VM, preparing the GPU, attaching the vGPU, installing the guest driver, and configuring licensing. Complete the steps in this order and skip only those explicitly marked as optional or conditional.

Selecting the Correct vGPU Profiles#

  1. Use the vGPU Sizing and Selection Guides to select a vGPU profile based on the user’s needs and application requirements.

  2. Confirm that the selected vGPU type is available for your physical GPU in the Virtual GPU Types Reference.

  3. Record the selected vGPU type. Its series determines the required license edition: Q-series vGPU types require a vWS license, B-series vGPU types require a vPC license, and A-series vGPU types require a vApps license.

Creating the Virtual Machine#

Install Virtual Machine Manager and use it to create and manage virtual machines on the Ubuntu KVM host.

  1. Launch Virtual Machine Manager. In the upper-left corner, click the computer icon with the play symbol. Follow the step-by-step wizard to create the VM.

  2. Install a supported 64-bit guest operating system.

  3. Start the VM and verify that the guest operating system boots successfully.

  4. Shut down the VM.

  5. On the Ubuntu KVM host, run the following command:

    virsh -c qemu:///system list --all
    

    Confirm that the VM’s state is shut off. Record the value in the Name column for your VM. This value is the libvirt domain name that you will use when adding the vGPU.

Initial Setup for vGPU Configuration:#

  1. Optional — Configure MIG-backed vGPUs: MIG-backed vGPU is currently supported on the NVIDIA RTX PRO 6000 Blackwell Server Edition and the NVIDIA RTX PRO 4500 Blackwell Server Edition GPUs. If you do not plan to use MIG-backed vGPUs, skip this step. Otherwise, follow Configuring a GPU for MIG-Backed vGPUs.

  2. Identify the GPU: Get the BDF and domain of the GPU by following Getting the BDF and Domain of a GPU. Record the values for the physical GPU that will host the vGPU.

  3. Conditional — Prepare the virtual function: Complete this step only if the selected GPU supports SR-IOV. Supported GPUs based on the NVIDIA Blackwell, Ada Lovelace, and Ampere architectures support SR-IOV. Skip this step for Turing and earlier GPUs that do not support SR-IOV. Before continuing, ensure that the physical GPU is not being used by another process, such as a CUDA application, a monitoring application, or an active nvidia-smi command.

    1. Enable the virtual functions for the physical GPU by using the NVIDIA sriov-manage script:

      /usr/lib/nvidia/sriov-manage -e <domain>:<bus>:<slot>.<function>
      

      Use the domain, bus, slot, and function recorded in the previous step, without the 0x prefixes.

      For example, if the values recorded in the previous step were:

      • Domain: 0x0000

      • Bus: 0x41

      • Slot: 0x00

      • Function: 0x0

      Run:

      /usr/lib/nvidia/sriov-manage -e 0000:41:00.0
      
    2. Obtain the domain, bus, slot, and function of the virtual functions enabled on the physical GPU:

      ls -l /sys/bus/pci/devices/<domain>:<bus>:<slot>.<function>/ | grep virtfn
      

      In this command, use the address of the physical GPU. For example, if the physical GPU address from the previous step is 0000:41:00.0, run:

      ls -l /sys/bus/pci/devices/0000:41:00.0/ | grep virtfn
      

      The output includes entries similar to the following:

      virtfn0 -> ../0000:41:00.4
      virtfn1 -> ../0000:41:00.5
      

      Choose the virtual function on which you want to create the vGPU and record its full PCI address. In this example, the address of virtfn0 is 0000:41:00.4.

    Virtual functions are disabled after the Ubuntu KVM host is rebooted or the NVIDIA driver is reloaded or upgraded. Run sriov-manage script again after any of these events.

    For additional information, see Preparing the Virtual Function for an NVIDIA vGPU that Supports SR-IOV.

  4. Optional — Enable heterogeneous vGPU: Complete this step only if you want vGPUs with different amounts of frame buffer on the same physical GPU or GPU instance. Follow Putting a GPU or GPU Instance into Mixed-Size Mode. Otherwise, keep the default homogeneous mode.

Creating and Managing vGPUs:#

The procedure for creating a vGPU depends on whether the physical GPU supports SR-IOV and the Ubuntu release. The mdev and vendor-specific VFIO frameworks are alternative implementation methods; they are not user-selectable options.

If you completed the Prepare the virtual function step, select one of the SR-IOV rows. If you skipped that step because the GPU does not support SR-IOV, select the legacy row.

Table 1 NVIDIA vGPU Creation Procedures#

Physical GPU capability

Ubuntu host release

VFIO framework

Creation procedure

SR-IOV not supported (legacy)

Any supported Ubuntu release

mdev

Creating a Legacy NVIDIA vGPU on a Linux with KVM Hypervisor

SR-IOV supported

Ubuntu 20.04 or 22.04

mdev

Creating an NVIDIA vGPU that Supports SR-IOV on a Linux with KVM Hypervisor

SR-IOV supported

Ubuntu 24.04

Vendor-specific VFIO

Creating an NVIDIA vGPU on a Linux with KVM Hypervisor that Uses a Vendor-Specific VFIO Framework

Important

Follow only the creation procedure that matches your configuration. Do not combine instructions from the mdev and vendor-specific VFIO procedures.

  1. Use the table above to select and complete the vGPU creation procedure that applies to your configuration.

Tip

If an echo command that writes to a file returns a Permission denied error, use sudo tee instead. For example, replace:

echo <value> > <target-file>

with:

echo <value> | sudo tee <target-file>

  1. Add one or more vGPUs to the powered-off VM by following Adding One or More vGPUs. Use the device configuration that matches the VFIO framework identified in the previous step. This workflow uses virsh because the VM is managed by libvirt and Virtual Machine Manager.

Important

Before disabling the default video device, configure and test an alternative method for accessing the VM, such as SSH for a Linux VM or RDP for a Windows VM. Record the VM IP address and confirm that you can reconnect after restarting the VM. After the default video device is disabled, the graphical console in Virtual Machine Manager is no longer available.

  1. Optional — Control vGPU placement: If you need to control where the vGPU is placed on a physical GPU or GPU instance, follow Placing a vGPU on a Physical GPU or GPU Instance. Otherwise, allow the virtual GPU Manager to determine the placement. Within the selected procedure, use the device configuration that matches the VFIO framework identified in the previous step.

  2. Optional — Set vGPU plugin parameters: If your workload requires non-default vGPU behavior, follow Setting vGPU Plugin Parameters on a Linux with KVM Hypervisor. Otherwise, skip this step. Within the selected procedure, use the device configuration that matches the VFIO framework identified in the previous step.

Before installing the guest driver, confirm that the VM starts successfully. On the Ubuntu KVM host, run:

sudo nvidia-smi vgpu -q

Confirm that the output lists an active vGPU for the VM and shows the expected physical GPU and vGPU type. The guest driver version and license status might be reported as N/A until the guest driver is installed and licensed.

Installing the Graphics Driver#

Install a guest driver that is compatible with the virtual GPU Manager release on the host. Follow the procedure for the operating system in the VM:

After installing the driver and restarting the VM if required, run nvidia-smi inside the guest. Continue only when it lists the assigned vGPU and does not report a driver communication error.

Configuring Licensing#

The NVIDIA License System serves licenses to NVIDIA software clients through a Cloud License Service (CLS) or Delegated License Service (DLS) instance. For information about configuring and managing the service instance, see the NVIDIA License System Documentation.

Configure licensing from inside the guest VM:

  1. Generate a client configuration token for the CLS or DLS instance.

  2. Configure the client by following the procedure for its operating system:

  3. From the licensed client, run:

    nvidia-smi -q
    

    Under vGPU Software Licensed Product, confirm that Product Name displays the expected licensed product and License Status displays Licensed with an expiration date.

    You can also verify the license status through the NVIDIA Control Panel under Licensing → Manage License.

    For troubleshooting issues, you can check the log files.

Manage the vGPU Enabled VM#

The following tasks are optional operations. They are not required to complete the initial deployment.

GPU Pass-through:

vGPU Information and System Monitoring:

Modifying and Migrating:

MIG-Backed vGPU: