cloudstack-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (CLOUDSTACK-10106) GPU/vGPU Support on VMWare
Date Tue, 28 Nov 2017 15:09:00 GMT


ASF GitHub Bot commented on CLOUDSTACK-10106:

rafaelweingartner commented on a change in pull request #2340: CLOUDSTACK-10106: GPU/vGPU
Support on VMWare

 File path: plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/
 @@ -2254,6 +2270,46 @@ protected void configureVideoCard(VirtualMachineMO vmMo, VirtualMachineTO
+    /**
+     * Sets GPU card details to the one provided in detail vgpu.type (if provided) on {@code
+     * @param vmMo
+     * @param vmSpec
+     * @param vmConfigSpec
+     * @throws RuntimeFaultFaultMsg
+     * @throws Exception
+     */
+    protected void configureGpuCard(final VirtualMachineMO vmMo, final VirtualMachineTO vmSpec,
final VirtualMachineConfigSpec vmConfigSpec) throws Exception {
+        final String vGpuProfile = vmSpec.getGpuDevice().getVgpuType();
+        VirtualDevice pciPassthroughDevice = null;
+        HostMO hostMo = new HostMO(vmMo.getContext(), getHyperHost(vmMo.getContext()).getMor());
+        if (vGpuProfile.equalsIgnoreCase(GPU.GPUType.passthrough.toString())) {
+            // Fetch the available direct PCI graphics card available for allocation
+            String pciDeviceId = hostMo.getPciIdForAvailableDirectPciPassthroughDevice();
+            VirtualMachinePciPassthroughInfo hostPciDeviceInfo = hostMo.getHostPciDeviceInfo(pciDeviceId);
+            if (hostPciDeviceInfo == null) {
+                final String msg = "Unable to find free passthrough GPU to be allocated to
VM. Please check the host hardware configuration.";
+                s_logger.error(msg);
+                throw new Exception(msg);
+            }
+            pciPassthroughDevice = hostMo.prepareDirectPciPassthroughDevice(hostPciDeviceInfo);
+        } else {
+            pciPassthroughDevice = hostMo.prepareSharedPciPassthroughDevice(vGpuProfile);
+        }
+        if (pciPassthroughDevice != null) {
 Review comment:
   Well, I understand the idea to code avoiding/deflecting null pointer exceptions. However,
cases like this when it is not possible to happen a null pointer exception. I would not do
the check/conditional; otherwise, it feels that for every time we use an object we would have
to add a conditional checking if that object is a null value or not.
   I would not force (suggest strongly) you to remove this because it does not harm the code,
but I called your attention to this matter. I know that it might seem nice that we are deflecting
null pointers, but if they do not happen at all, we are not deflecting anything ;)
   It is a personal choice (so the power is yours here). 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

> GPU/vGPU Support on VMWare
> --------------------------
>                 Key: CLOUDSTACK-10106
>                 URL:
>             Project: CloudStack
>          Issue Type: New Feature
>      Security Level: Public(Anyone can view this level - this is the default.) 
>          Components: API, UI, VMware
>    Affects Versions:
>            Reporter: Nitin Kumar Maharana
>              Labels: VMWARE
>             Fix For:
> VMware has added support for NVIDIA GRID K1 and NVIDIA GRID K2 cards as well as NVIDIA
Tesla M6 and Tesla M60 cards. This feature allows CloudStack VMs on ESXi hosts to use the
GPU cards connected to it. Currently, it supports only NVIDIA GRID K1 and K2 cards for CloudStack
> Feature Specification:

This message was sent by Atlassian JIRA

View raw message