# Gpu and CPU information



## smartali89 (Jul 19, 2008)

How do I get GPU and CPU information in Visual C#??


----------



## Kreij (Jul 19, 2008)

Inside the *System.Management* and *System.Management.Instrumentation* namespaces are all the APIs for retrieving system hardware infromation.

Here is the main page from the MSDN library that lists all of the classes. You can access tons of system properties depending on what hardware you possess.

Make sure you put a good amount of exception handling in your code, or you are going to be feeling a lot of pain


----------



## smartali89 (Jul 19, 2008)

can I get GPU clocks


----------



## Kreij (Jul 19, 2008)

GPU-Z does it using C++ (If I recall correctly).  I don't see why not. 

I have not tried it myself, though.


----------



## smartali89 (Jul 19, 2008)

do you have any example using C++? or may be C#?


----------



## Kreij (Jul 19, 2008)

Google *How to get hardware information C#*.

There are tons of examples of code. Maybe not GPU specifically, but it should start you in the right direction! 

If you run into problems, let me know. I'll try to help you out.


----------



## Deleted member 3 (Jul 19, 2008)

Search for WMI, I use it to do the same in vb.NET.


----------



## smartali89 (Jul 19, 2008)

I found GPU information in WMI Class but not its Clock and Memory


----------



## Deleted member 3 (Jul 19, 2008)

smartali89 said:


> I found GPU information in WMI Class but not its Clock and Memory



Not sure if there is an easy way of reading that. From what I understand from W1z GPU-Z reads everything directly from the GPU via a driver he wrote. Isn't exporting from GPU-Z an option?


----------



## Kreij (Jul 19, 2008)

You may have to access internal GPU registers directly. I'm not sure.
W1zz may be able to shed a little light on the subject.


----------



## smartali89 (Jul 19, 2008)

can some one ask him to shed ?


----------



## Deleted member 3 (Jul 19, 2008)

smartali89 said:


> can some one ask him to shed ?



If he reads this he will answer. 

Mind telling us what it's for? That way we could perhaps suggest other approaches.


----------



## smartali89 (Jul 19, 2008)

I am trying to create somewhat GPU performance calculator, for this reason I want to get details about the GPU, through the WMI Class I am able to get GPU Name, Driver, Memory etc.. But I want more details


----------



## Deleted member 3 (Jul 19, 2008)

smartali89 said:


> I am trying to create somewhat GPU performance calculator, for this reason I want to get details about the GPU, through the WMI Class I am able to get GPU Name, Driver, Memory etc.. But I want more details



I don't really see how you would calculate it in the first place? What unit are you using for performance?


----------



## smartali89 (Jul 19, 2008)

nothing different then in gpu-z, 

I want to calculate fillrate (pixel, texture), bandwidth etc. (I know how to calculate but I need to read the clock settings etc.)


----------



## Deleted member 3 (Jul 19, 2008)

smartali89 said:


> nothing different then in gpu-z,
> 
> I want to calculate fillrate (pixel, texture), bandwidth etc. (I know how to calculate but I need to read the clock settings etc.)



Why not use GPU-Z? Why reinvent the wheel?


----------



## smartali89 (Jul 19, 2008)

Programmers won't stop programming by saying "Microsoft is there why do we program?"


----------



## Deleted member 3 (Jul 19, 2008)

Interesting analogy considering you're using VS


----------



## Kreij (Jul 19, 2008)

DanTheBanjoman said:


> Interesting analogy considering you're using VS



LOL ... He has a point though Dan. Many people re-invent the wheel to learn more about programming. Once they do, they find new things that other programs do not offer and incorporate them into their own offering.

That being said, I just use the latest utilities as I have enough on my plate already in the programming arena


----------



## smartali89 (Jul 19, 2008)

Kreij said:


> LOL ... He has a point though Dan. Many people re-invent the wheel to learn more about programming. Once they do, they find new things that other programs do not offer and incorporate them into their own offering.



Absolutely Correct


----------



## Deleted member 3 (Jul 19, 2008)

Kreij said:


> LOL ... He has a point though Dan. Many people re-invent the wheel to learn more about programming. Once they do, they find new things that other programs do not offer and incorporate them into their own offering.



I wasn't suggesting he didn't. Though I think it is relevant to know if he's making something for his boss that requires to work in a certain way or if he's just playing around.


----------



## smartali89 (Jul 19, 2008)

not doing for boss 

I want to learn hardware level programming....


----------



## smartali89 (Jul 19, 2008)

so far got these info


----------

