VMware Cloud Community
jclapis
Contributor
Contributor

GPU Utilization in vSphere API?

Hi everyone,

I have a host running ESXi 5.5 with some Nvidia GRID cards. I'd like to be able to pull utilization statistics from them with the vSphere API. I see that there is a HostGraphicsInfo object (http://pubs.vmware.com/vsphere-55/index.jsp#com.vmware.wssdk.apiref.doc/vim.host.GraphicsInfo.html) which lists some basic information, but I'd like to see the actual GPU usage there as well. My current solution is to SSH into the service console programmatically and periodically poll nvidia-smi with the XML flag turned on. Is there any way I can get this information from the vSphere 5.5 API?

Thanks!

Reply
0 Kudos
5 Replies
Aiden1
Enthusiast
Enthusiast

Hi

Welcome to the communities.

Could you please conform if you are looking graphics card memory usage or anything else? .

Confidence is preparation. Everything else is beyond your control
Reply
0 Kudos
jclapis
Contributor
Contributor

I'm looking for both graphics memory usage and volatile GPU utilization (i.e the load that the GPU is currently under).

Reply
0 Kudos
Linjo
Leadership
Leadership

jclapis would you mind to share the SSH-script you use currently to monitor the GPU?

Best regards, Linjo Please follow me on twitter: @viewgeek If you find this information useful, please award points for "correct" or "helpful".
Reply
0 Kudos
jclapis
Contributor
Contributor

It's not a script, I am using an SSH library within my application, but here's what it does.

First it calls nvidia-smi:

     ~ # nvidia-smi -q -d UTILIZATION

Which provides this output:

==============NVSMI LOG==============

Timestamp                           : Fri Nov 22 14:49:21 2013

Driver Version                      : 319.65

Attached GPUs                       : 8

GPU 0000:08:00.0

    Utilization

        Gpu                         : 0 %

        Memory                      : 0 %

GPU 0000:09:00.0

    Utilization

        Gpu                         : 0 %

        Memory                      : 0 %

GPU 0000:0A:00.0

    Utilization

        Gpu                         : 0 %

        Memory                      : 0 %

GPU 0000:0B:00.0

    Utilization

        Gpu                         : 0 %

        Memory                      : 0 %

GPU 0000:86:00.0

    Utilization

        Gpu                         : 0 %

        Memory                      : 0 %

GPU 0000:87:00.0

    Utilization

        Gpu                         : 0 %

        Memory                      : 0 %

GPU 0000:88:00.0

    Utilization

        Gpu                         : 0 %

        Memory                      : 0 %

GPU 0000:89:00.0

    Utilization

        Gpu                         : 0 %

        Memory                      : 0 %


I take that output and parse out each GPU ID with its two utilization metrics, for use in my application. I can enumerate the GPUs through the vSphere API and get their IDs, but the "Gpu" and "Memory" consumption stats are not included.

Reply
0 Kudos
Linjo
Leadership
Leadership

Ok, thanks!

Best regards, Linjo Please follow me on twitter: @viewgeek If you find this information useful, please award points for "correct" or "helpful".
Reply
0 Kudos