Setting up VDI machines with virtual Nvidia graphics card
Home > VMWare platform > VMWare Horizon > Setting up VDI machines with virtual Nvidia graphics card
In case of VDI the physical server can have graphics card such as Nvidia A40 and then we can associate smaller virtual slices of this Graphics card with VMs to give small amount of graphics memory + CPU to the VM. This can help with 3D applications performance in the VDI environment.
Downloading Nvidia software from site
To download Nvidia software from site use:
- Enable SSH on ESXi host
- SSH to ESXi host and run
- lspci | grep -i nvidia
- Example output
- 0000:3b:00.0 3D controller: NVIDIA Corporation GA102GL [A40]
- As per https://www.nvidia.com/en-us/drivers/vgpu-software-driver/ go to https://www.nvidia.com/en-us/data-center/resources/vgpu-evaluation/ to get 90 day evaulation license and software download links
- The trial email may take 24-48 hours to arrive
- Go to https://nvid.nvidia.com and login with partner ID
- Go to Entitlements and you should see the required entitlements
- Go to Softwarae Downloads and download
- VMWare vSphere 7.0 - Product 14.1 - NVIDIA vGPU for vSphere 7.0
- 2022.02 64-bit license manager for windows
Setup Nvidia license server
- Create a VM to work as license server.
- Copy Java 8 RE on that VM and install
- Set System level Environment Variable
- JAVA_HOME
- C:\Program Files\Java\jre1.8.0_333 (or other appropriate path as per enviroment)
- Set System level Environment Variable
- Copy Java 8 RE on that VM and install
- Copy "2022.02 64-bit license manager for windows" on VM and install
- Enable only port 7070 via firewall
- Do not select 8080 port used for license management in firewall exception list
- The server is accessible at http://localhost:8080/licserver
- Go to https://nvid.nvidia.com and login with partner ID
- Go to license servers -> Create server
- Enable create legacy server option
- Get the MAC ID of license server from http://localhost:8080/licserver -> Configuration page -> Server Host ID (The one with (Ethernet))
- Ignore failover server related details
- Choose the license quantity
- Create server
- Again on nvidia portal go to License Servers -> List servers
- Click on the server created now
- Go to Actions menu and download the license file
- Go to http://localhost:8080/licserver on the license server.
- Go to License Management
- Upload the downlaoded bin file
- After successful license activation go to "Licensed Feature usage", to validate the count.
Install Driver in ESXi host for the GPU
- Extract "NVIDIA-GRID-vSphere-7.0-510.73.06-510.73.08-512.78.zip" downloaded for "VMWare vSphere 7.0 - Product 14.1 - NVIDIA vGPU for vSphere 7.0"
- Among extracted file there is vGPU file such as NVD-VGPU_510.73.06-1OEM.702.0.0.17630552_19796074.zip, extract that as
well
- Finally we should get a vib file such as NVIDIA_bootbank_NVIDIA-VMware_ESXi_7.0.2_Driver_510.73.06-1OEM.702.0.0.17630552.vib
- Copy VIB to ESXi host
- Put the host in maintenance mode
- Install VIB using:
- cd /vmfs/volumes/vsan:52baf28e60d3aa90-4fd7fd59a4538bf7/ISO #Change path appropriately based on environment
- esxcli software vib install -v $PWD/NVIDIA_bootbank_NVIDIA-VMware_ESXi_7.0.2_Driver_510.73.06-1OEM.702.0.0.17630552.vib
- nvidia-smi
- See whether reboot is required or not. If not, remove host from maintenance mode and perform the same on all other ESXi hosts
Install Required drivers in the Windows VM
- Go to *all* ESXi hosts in vCenter -> Configure
- Go to Graphics
- Select the graphics card and click edit
- Change Type to "Shared Direct"
- Create VM with virtual graphics
- Edit settings -> Add PCI device
- Select Nvidia Grid vGPU and select appropriate GPU profile
- Login into VM and install the drivers downloaded from https://nvid.nvidia.com/ - "VMWare vSphere 7.0 - Product 14.1 - NVIDIA vGPU for vSphere 7.0". The zip file has drivers for Linux and Windows VMs also along with ESXi vib.
- After that reboot machine. After reboot right click on Desktop gives Nvidia control panel option.
- In Nvidia control panel give license server IP/FQDN and port 7070
- After license is acquired go to task manager -> Performance -> GPU. We can see GPU with 1 GB memory.
Adding VM to Horizon
In Horizon Nvidia VGPU based machines can only be added if 3D renderer is set to "Nvidia GPU" instead of default Disabled value
Enable vMotion for vGPU based machines
By default machines with vGPU will not live migrate to other hosts even if the same graphics card with same vGPU profile is available on the target host. To enable that use:
- Login into vCenter
- Select vCenter on the left "Hosts and clusters" page. Go to Configure -> Advanced Settings
- Change value of 'vgpu.hotmigrate.enabled' from default false to true
- The change is applied immediately. After this change vMotion should work.
Refer:
Home > VMWare platform > VMWare Horizon > Setting up VDI machines with virtual Nvidia graphics card