How to get ESXi GPU info w/PowerCLi


This article is intended to assist VDI admins who have upgraded their ESXi hosts equipped with GRID vGPU cards to vSphere version 6.5.

As specified by Jeremy Main in this NVIDIA forum, vSphere 6.5 and November 2016 GRID driver requires changing the GPU mode from Shared (vSGA) to Shared Direct (vGPU) via Web Client to enable vGPU support for VM.



Otherwise you will get below error while Powering On each vGPU configured VM.


I decided to write function that will help to retrieve and optionally set this ESXi setting.

Please meet the Get-VMHostGPU function from my PowerCLi Vi-Module module.

In addition to GPU mode (Mode property) the function supplies many other useful information (such a VM property that contains list of VM running on each GPU device).


For more details about the function, please take a look at the content based help and examples.

Get-Help Get-VMHostGPU –Examples
Get-Help Get-VMHostGPU –Full
Get-Help Get-VMHostGPU –Parameter VMHost

The function may also be useful for different query types.

  • This one will get all ESXi hosts in Inventory that equipped with any vGPU graphic device.
Get-VMHost | Get-VMHostGPU | ? {$_.VideoCard –imatch ‘grid’} | select VMHost –Unique
  • This query will return you all ESXi hosts that have GRID device but NVIDIA driver is not installed.
Get-VMHost | Get-VMHostVGPU | ? {$_.VideoCard –imatch ‘grid’ –and $_.Mode -eq 'basic'} | Format-Table -AutoSize


Unfortunately, I have not found the PowerCLi way to change GPU mode from Shared to SharedDirect and vice versa for now Emoj. I think VMware have not published this method to public API yet…

4 thoughts on “How to get ESXi GPU info w/PowerCLi

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s