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:
Create bootable installation media: Follow the Ubuntu instructions to create a bootable USB drive from the downloaded ISO image.
Install Ubuntu Server: Follow the Ubuntu Server installation tutorial to install the operating system.
Update Ubuntu: After installation, update the system:
sudo apt update sudo apt upgrade
Install and configure KVM and libvirt: Follow the Ubuntu libvirt instructions.
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_groupsIf the command lists one or more groups, continue to the next step. If it returns nothing, add
intel_iommu=onfor an Intel CPU, oramd_iommu=onfor an AMD CPU, toGRUB_CMDLINE_LINUX_DEFAULTin/etc/default/grub, then apply the change and reboot:sudo update-grub sudo reboot
After the host restarts, run the
lscommand 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.
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.
Follow Installing the NVIDIA vGPU Manager Package for Ubuntu.
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#
Use the vGPU Sizing and Selection Guides to select a vGPU profile based on the user’s needs and application requirements.
Confirm that the selected vGPU type is available for your physical GPU in the Virtual GPU Types Reference.
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.
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.
Install a supported 64-bit guest operating system.
Start the VM and verify that the guest operating system boots successfully.
Shut down the VM.
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:#
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.
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.
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-smicommand.Enable the virtual functions for the physical GPU by using the NVIDIA
sriov-managescript:/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
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
virtfn0is0000:41:00.4.
Virtual functions are disabled after the Ubuntu KVM host is rebooted or the NVIDIA driver is reloaded or upgraded. Run
sriov-managescript again after any of these events.For additional information, see Preparing the Virtual Function for an NVIDIA vGPU that Supports SR-IOV.
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.
Physical GPU capability |
Ubuntu host release |
VFIO framework |
Creation procedure |
|---|---|---|---|
SR-IOV not supported (legacy) |
Any supported Ubuntu release |
|
Creating a Legacy NVIDIA vGPU on a Linux with KVM Hypervisor |
SR-IOV supported |
Ubuntu 20.04 or 22.04 |
|
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.
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>
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
virshbecause 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.
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.
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:
Installing the NVIDIA vGPU Software Graphics Driver on Windows
Installing the NVIDIA vGPU Software Graphics Driver on Linux
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:
Generate a client configuration token for the CLS or DLS instance.
Configure the client by following the procedure for its operating system:
From the licensed client, run:
nvidia-smi -qUnder 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:
To use a GPU directly in pass-through mode instead of as a vGPU, refer to Using GPU Pass-Through on a Linux with KVM Hypervisor.
To change a GPU from pass-through mode to vGPU mode, follow Preparing a GPU Configured for Pass-Through for Use with vGPU.
To change a GPU from vGPU mode to pass-through mode, follow Preparing a GPU Configured for vGPU for Use in Pass-Through Mode.
vGPU Information and System Monitoring:
View and manage vGPU information stored in sysfs by following NVIDIA vGPU Information in the sysfs File System.
To monitor GPU performance using
nvidia-smi, see Using nvidia-smi to Monitor GPU Performance from a Hypervisor.
Modifying and Migrating:
If you need to remove a vGPU or change the profile assigned to a VM, follow Deleting a vGPU.
If you need to migrate a VM configured with vGPU, refer to Migrating a VM Configured with vGPU.
For suspending and resuming VMs, follow Suspending and Resuming a VM Configured with vGPU.
MIG-Backed vGPU:
To disable MIG mode on one or more GPUs, see Disabling MIG Mode for One or More GPUs.
To modify a MIG-backed vGPU’s configuration from within a guest VM, follow Modifying a MIG-Backed vGPU’s Configuration from a Guest VM.
To monitor MIG-backed vGPU activity, refer to Monitoring MIG-Backed vGPU Activity.