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.