请教关于获取NVIDIA独显硬件ID问题
NVIDIA官方提供的demo code编译运行后不能读出NVIDIA独显,当EnumDisplayDevices枚举index为0,读出Intel集显ID,当index为3,debug中可以读出NVIDIA显卡信息,但是此时StateFlags 为0,函数fail,这是为什么?怎样才可以读出电脑上所有显卡的ID?而不是读出第一个就停止了。
// Example code to retrieve vendor and device ID's for the primary display
// device.
//
// NOTE: Visual Studio 6 does not ship with a winuser.h that defines the
// EnumDisplayDevices function so in order to compile this code, you'll
// need to install the Platform SDK.
#include "stdafx.h"
#include <windows.h>
#include <string>
#include <iostream>
using namespace std;
bool GetDeviceIdentification(string &vendorID, string &deviceID)
{
DISPLAY_DEVICE dd;
dd.cb = sizeof(DISPLAY_DEVICE);
int i = 0;
string id;
// locate primary display device
while (EnumDisplayDevices(NULL, i, &dd, 0))
{
if (dd.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE)
{
id = dd.DeviceID;
break;
}
i++;
}
if (id == "") return false;
// get vendor ID
vendorID = id.substr(8, 4);
// get device ID
deviceID = id.substr(17, 4);
return true;
}
int main(void)
{
string vendorID;
string deviceID;
if (GetDeviceIdentification(vendorID, deviceID))
{
cout << "Vendor ID: " << vendorID << endl;
cout << "Device ID: " << deviceID << endl;
}
else
cout << "Unable to locate device information" << endl;
cin.get();
return 0;
}
...全文
相关推荐
Nvidia显卡兼容性问题解决
因为我的笔记本厂商(现在绝大数厂商都如此)不提供xp系统的驱动程序、所以以前装xp系统后用驱动精灵下载显卡驱动、并且都能成功安装、但坑爹的这次下下来的驱动却安装不了、提示什么此图形驱动程序无法找到兼容的图形硬件、换成win7系统用随机赠送的驱动光盘就能装起来、于是苦苦找寻、有幸找到了这篇文章(http://www.vistapc.cn/pid/1333)通过这篇文章修改了驱动程序之后成功驱动、谨在此表示对这位作者的衷心感谢、但由于其中有些内容不详、故作此教程。
英伟达此图形驱动程序无法找到兼容的图形硬件问题完美解决.doc
英伟达此图形驱动程序无法找到兼容的图形硬件问题完美解决.doc
nvidia-smi的简介、安装使用的安装包
nvidia-smi的简介、安装使用的安装包
Nvidia GT 525M xp显卡驱动解决办法
解决NVIDIA geforce GT 525 系列显卡在xp系统上无法安装解决办法,淘宝有出售,本人好奇心特强,亲自试过此办法,绝对好用!
The PCI ID Repository v2.0(显卡型号十六进制代码列表)
PCI ID(显卡型号十六进制代码列表),linux下查看显卡型号,有时会返回十六进制代码,这个列表是The PCI ID Repository网站的列表,可以根据十六进制代码查询到相应显卡型号。


