Here's C code to print out this on NVIDIA cards. A little sloppy but you get the point.
Graphics Bus: PCI Express x16
VRAM: 256M
GPU Count: 1
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <stdio.h>
// TODO: reference additional headers your program requires here
#include <windows.h>
#include <conio.h>
#define NVCPL_API_AGP_BUS_MODE 1 // Graphics card connection to system
// Values are:
// 1 = PCI
// 4 = AGP
// 8 = PCI Express
#define NVCPL_API_VIDEO_RAM_SIZE 2 // Graphics card video RAM in megabytes
#define NVCPL_API_TX_RATE 3 // Graphics card AGP bus rate (1X, 2X, ...)
#define NVCPL_API_NUMBER_OF_GPUS 7 // Graphics card number of GPUs.
#define NVCPL_API_NUMBER_OF_SLI_GPUS 8 // Graphics card number of SLI GPU clusters available.
typedef BOOL (__cdecl* fNvCplGetDataInt)(IN DWORD dwSettingIndex, IN DWORD* pdwValue);
char* bus[] = { "", "PCI", "", "", "AGP", "", "", "", "PCI Express" };
int main(int argc, char* argv[])
{
HINSTANCE hDLL; // Handle to DLL
fNvCplGetDataInt NvCplGetDataInt; // Function pointer
DWORD dwParam, dwParam2;
BOOL bReturnVal;
hDLL = LoadLibrary("nvcpl.dll");
if (hDLL != NULL)
{
NvCplGetDataInt = (fNvCplGetDataInt)GetProcAddress(hDLL,"NvCplGetDataInt");
if (!NvCplGetDataInt)
{
// handle the error
FreeLibrary(hDLL);
return 0;
}
else
{
// call the function
bReturnVal = NvCplGetDataInt(NVCPL_API_AGP_BUS_MODE, &dwParam);
bReturnVal = NvCplGetDataInt(NVCPL_API_TX_RATE, &dwParam2);
if (dwParam == 4) {
printf("Graphics Bus: %s %dx\n", bus[dwParam], dwParam2);
}
else {
printf("Graphics Bus: %s x%d\n", bus[dwParam], dwParam2);
}
bReturnVal = NvCplGetDataInt(NVCPL_API_VIDEO_RAM_SIZE, &dwParam);
printf("VRAM: %dM\n", dwParam);
bReturnVal = NvCplGetDataInt(NVCPL_API_NUMBER_OF_GPUS, &dwParam);
printf("GPU Count: %d\n", dwParam);
getch();
}
}
return 0;
}