• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.
  • The forums have been upgraded with support for dark mode. By default it will follow the setting on your system/browser. You may override it by scrolling to the end of the page and clicking the gears icon.

How does GPU-Z obtain data?

Joined
Oct 3, 2008
Messages
13 (0.00/day)
Location
Kharkov, Ukraine
I'm currently writing a very primitive program that displays in console window some info about the computer it's running on, like CPU and GPU model. I'm currenetly using WMI, and I have a problem identifying GPU. I can get a string saying "ATI Radeon HD 4800 Series", so I can't even tell 4850/70 from 4890.
Can someone tell me how does GPU-Z obtain this info?

Sorry if I posted in wrong subforum...
 
get the pci device id of the device, that lets you identify the gpu (if you build a large list of device id vs. gpu)
 
Thanks for a hint.
Can you give me an idea of what API or library can I use to get the ID?
Thanks again.

Hm. Can I use IN asm instruction to access the PCI address space?..
 
WMI should give you the device id, it's the second number after 1002 in device id in gpuz

no you can't use IN (PCI config space doesnt live on a IO port anyway), need a kernel mode driver that accesses the data and passes it on to your app in userspace, or a kernel mode driver that maps the physical memory into kernel space and then maps it into user space, or kernel mode functions halgetbusdata*

there might even be a copy of pci config space accessible from usermode somewhere, but no idea.
 
You're right! PnPDeviceID parameter provides a string containing vendor and device IDs. I must have overlooked this when I discovered WMI properties.
 
that's up to you to figure out which device id corresponds to which product(s) and how to treat them, internally gpuz has a loooong list of device ids
 
That's not a problem to determine videoprocessor's ID. The problem is this ID may be common for several different GPUs. My GPU's ID is 9442h, and by this ID I can't tel whether it is 4850 or 4870...
 
that may be the case, then you can't tell them apart
 
Back
Top