Before Assigning a GPU to a VM

Before you assign a GPU to a VM, you need to put the appropriate physical GPU(s) in your XenServer host and then restart the machine. Upon restart, XenServer automatically detects any physical GPU(s). To view all physical GPU(s) across hosts in the pool, use the xe pgpu-listcommand.

Ensure that the IOMMU chipset feature is enabled on the host. To do so, enter the following:

xe host-param-get uuid=<uuid_of_host> param-name=chipset-info param-key=iommu

If the value printed is false, IOMMU is not enabled, and GPU Pass-Through is not available using the specified XenServer host.

To assign a GPU to a Windows VM using XenCenter:

1.Shut down the VM that you wish to assign a GPU.

2.Open the VM properties: right-click the VM and select Properties.

3.Assign a GPU to the VM: Select GPU from the list of VM properties, and then select a GPU type. Click OK.

4.Start the VM.

To assign a GPU to a Windows VM using xe CLI:

1.Shut down the VM that you wish to assign a GPU group by using the xe vm-shutdowncommand.

2.Find the UUID of the GPU group by entering the following:

xe gpu-group-list

This command prints all GPU groups in the pool. Note the UUID of the appropriate GPU group.

3.Attach the VM to a GPU group by entering the following:

xe vpgu-create gpu-group-uuid=<uuid_of_gpu_group>vm-uuid=<uuid_of_vm>

To ensure that the GPU group has been attached, run the xe vgpu-listcommand.

4.Start the VM by using the xe vm-startcommand.

5.Once the VM starts, install the graphics card drivers on the VM.

Installing the drivers is essential, as the VM has direct access to the hardware on the host. Drivers are provided by your hardware vendor.

Note:

If you try to start a VM with GPU Pass-Through on a XenServer host without an available GPU in the appropriate GPU group, XenServer prints an error message.

To detach a Windows VM from a GPU using XenCenter:

1.Shut down the VM.

2.Open the VM properties: right-click the VM and select Properties.

3.Detach the GPU from the VM: Select GPU from the list of VM properties, and then select None as the GPU type. Click OK.

4.Start the VM.

To detach a Windows VM from a GPU using the xe CLI:

1.Shut down the VM by using the xe vm-shutdowncommand.

2.Find the UUID of the vGPU attached to the VM by entering the following:

38

Page 45
Image 45
Citrix Systems 6.2.0 manual To assign a GPU to a Windows VM using XenCenter, To assign a GPU to a Windows VM using xe CLI