![]() |
|
|
#1 |
|
Hardcore Monkey Moderator
Join Date: Feb 2007
Location: Cheeseland (Wisconsin, USA)
Posts: 12,126 (5.27/day)
Thanks: 591
Thanked 5,494 Times in 2,938 Posts
|
GPU-Z Shared Memory Class in C#
I wrote a C# class that reads the shared memory from GPU-Z.
It doesn't use DLLImport or PInvoke (but it does require .Net 4), as it uses the new MemoryMappedFiles (MMF) namespace they added in 4.0 The problem is that I can't think of anything useful to do with it that I can't get from just running GPU-Z. :/ Any thought fellow coders and users of GPU-Z? I'll happily post the class source code when I nail down all the output requirements needed for any ideas you gents (and ladies) throw out.
__________________
Cloud (noun, singular): A dynamic arrangement of multiple potential single points of failure, with a user at one end and their data at the other. Get more tech news on a wide variety of topics at NextPowerUp
|
|
|
|
|
|
#2 |
|
"I go fast!1!11!1!"
Join Date: Oct 2008
Location: IA, USA
Posts: 10,583 (6.28/day)
Thanks: 1,755
Thanked 2,600 Times in 1,962 Posts
|
Graph clockspeeds and memory usage.
__________________
Golden Rule of Programming: Never assume. try { SteamDownload(); } catch (Steamception ex) { RageQuit(); } |
|
|
|
|
|
#3 |
|
Hardcore Monkey Moderator
Join Date: Feb 2007
Location: Cheeseland (Wisconsin, USA)
Posts: 12,126 (5.27/day)
Thanks: 591
Thanked 5,494 Times in 2,938 Posts
|
134 views and only one suggestion? (Thanks Ford)
You guys suck at ideas as much as I do.
__________________
Cloud (noun, singular): A dynamic arrangement of multiple potential single points of failure, with a user at one end and their data at the other. Get more tech news on a wide variety of topics at NextPowerUp
|
|
|
|
|
|
#4 |
|
Moderato®™
Join Date: Apr 2009
Location: Statesville, NC
Posts: 3,671 (2.45/day)
Thanks: 4,327
Thanked 2,322 Times in 1,153 Posts
|
Yea.. I'm drawing blanks.. Oh course I've not had my full dose of caffeine yet... But I'm working on it...lol but right now.. I got nothing...
__________________
“As long as I feel the warmth from the sun and breathe precious air…. I must ask questions to feed the Mind!” Battletag: Mindweaver#1523 |
|
|
|
|
|
#5 |
|
Hardcore Monkey Moderator
Join Date: Feb 2007
Location: Cheeseland (Wisconsin, USA)
Posts: 12,126 (5.27/day)
Thanks: 591
Thanked 5,494 Times in 2,938 Posts
|
I could always just toss the class code out and let people play with it.
I just wanted to get some ideas what output formats (Arrays, Lists, etc.) might be useful for others and add them as methods to the class. Curently what I have is .. Code:
void ReadSharedMemory() // Reads data from shared mem into classes List<KeyValuePair<string, string>> GetListOfRecords(); // Return a list of GPUZ_RECORD KeyValuePair<string, string>[] GetArrayOfRecords(); // Returns an array of GPUZ_RECORD List<GPUZ_SENSOR_RECORD> GetListOfSensors(); // Returns list of the sensor records. GPUZ_SENSOR_RECORD[] GetArrayOfSensors(); // Returns an array of sensor records. KeyValuePair<string, string> GetRecordByName (string name); GPUZ_SENSOR_RECORD GetSensorByName (string name); KeyValuePair<string, string> GetRecordByIndex (int index); GPUZ_SENSOR_RECORD GetSensorByIndex (int index); Launch program, hit button. See if records print out (no sensor records, just board records) Try with GPU-Z running and not (It should detect if GPU-Z is running). You need .Net 4 Thanks !!
__________________
Cloud (noun, singular): A dynamic arrangement of multiple potential single points of failure, with a user at one end and their data at the other. Get more tech news on a wide variety of topics at NextPowerUp
Last edited by Kreij; Apr 18, 2012 at 04:35 PM. |
|
|
|
|
|
#6 |
![]() Join Date: Sep 2008
Location: Weedopia
Posts: 1,169 (0.68/day)
Thanks: 114
Thanked 187 Times in 143 Posts
|
Without GPU-Z running:
![]() With GPU-Z Running:
__________________
|
|
|
|
| The Following User Says Thank You to Munki For This Useful Post: |
|
|
#7 |
![]() Join Date: Mar 2011
Location: Canada
Posts: 68 (0.08/day)
Thanks: 48
Thanked 23 Times in 17 Posts
|
Not running:
![]() Running:
|
|
|
|
| The Following User Says Thank You to TissueBox For This Useful Post: |
|
|
#8 |
|
Hardcore Monkey Moderator
Join Date: Feb 2007
Location: Cheeseland (Wisconsin, USA)
Posts: 12,126 (5.27/day)
Thanks: 591
Thanked 5,494 Times in 2,938 Posts
|
Thanks kids !!
Munki sent me a PM pointing out my incorrect use of "it's" instead of "its" in the error message. Please feel free to trash me if you are a grammar nazi. (it's been corrected in the code)If someone could try running it on a 32-bit box I would appreciate it. No need for screens, just let me know if you encounter any problems. @TissueBox : Welcome to P&W, our little corner of the world. Are you a coder?
__________________
Cloud (noun, singular): A dynamic arrangement of multiple potential single points of failure, with a user at one end and their data at the other. Get more tech news on a wide variety of topics at NextPowerUp
|
|
|
|
|
|
#9 | |
![]() Join Date: Sep 2008
Location: Weedopia
Posts: 1,169 (0.68/day)
Thanks: 114
Thanked 187 Times in 143 Posts
|
Quote:
![]() ![]() ![]() I'm far from a grammar Nazi. I was born and raised in Georgia, my grammar is horrid
__________________
|
|
|
|
|
|
|
#10 |
|
Hardcore Monkey Moderator
Join Date: Feb 2007
Location: Cheeseland (Wisconsin, USA)
Posts: 12,126 (5.27/day)
Thanks: 591
Thanked 5,494 Times in 2,938 Posts
|
Sorry Munki ... I meant to say "if y'all a grammar nazi"
![]() I coded the class in a separate class file and removed the MessageBox error. I replaced it with an accessor (property called GPUZ_Running) so you can handle the fact GPU-Z may not be running yourself. Code:
GPUZ_SHMEM shMem = new GPUZ_SHMEM();
if (!shMem.GPUZ_Running)
{
// handle it however you want
}
else shMem.ReadSharedMem();
Free Code Inside!
It's C# code, I just used the php tags to give it a little color. ![]() As always, comments and suggestions appreciated !
__________________
Cloud (noun, singular): A dynamic arrangement of multiple potential single points of failure, with a user at one end and their data at the other. Get more tech news on a wide variety of topics at NextPowerUp
Last edited by Kreij; Apr 18, 2012 at 05:47 PM. |
|
|
|
| The Following User Says Thank You to Kreij For This Useful Post: |
|
|
#11 | |
![]() Join Date: Mar 2011
Location: Canada
Posts: 68 (0.08/day)
Thanks: 48
Thanked 23 Times in 17 Posts
|
Quote:
Looked at the "New Forum Posts" and decided to contribute something here
|
|
|
|
|
|
|
#12 |
|
Chief Broken Rig
Join Date: Mar 2009
Location: 04578
Posts: 6,016 (3.95/day)
Thanks: 761
Thanked 2,225 Times in 1,559 Posts
|
hmm any chance you could set it to record and log memory usage kinda like fraps maybe? log min max avg memory usage i dont know lol maybe GPU-Z does that? i dont know drawing blanks just saying random shit that comes to mind
|
|
|
|
| The Following User Says Thank You to crazyeyesreaper For This Useful Post: |
|
|
#13 |
![]() Join Date: Jan 2012
Location: Dover, New Hampshire, USA
Posts: 4,272 (8.85/day)
Thanks: 1,282
Thanked 1,331 Times in 987 Posts
|
Can GPU-Z run silently or minimized on start? If that can be done you could use the C# application to launch and close GPU-Z as needed.
__________________
MyHeat |
|
|
|
| The Following User Says Thank You to Aquinus For This Useful Post: |
|
|
#14 | |
![]() Join Date: Jul 2011
Location: Kaunas, Lithuania
Posts: 469 (0.70/day)
Thanks: 309
Thanked 201 Times in 121 Posts
|
Quote:
As far as I remember, GPU-Z can't do that.
__________________
Why do you wear glasses if you're deaf? Code:
while (1) {
alone();
}
Last edited by Vinska; Apr 26, 2012 at 07:47 AM. |
|
|
|
|
| The Following User Says Thank You to Vinska For This Useful Post: |
|
|
#15 | ||||
|
Hardcore Monkey Moderator
Join Date: Feb 2007
Location: Cheeseland (Wisconsin, USA)
Posts: 12,126 (5.27/day)
Thanks: 591
Thanked 5,494 Times in 2,938 Posts
|
Quote:
![]() Quote:
Quote:
Quote:
One of the current issues is that if you open two instances of GPU-Z (say for crossfired cards) it still writes the data to the same shared memory and it's kind of hit or miss what card readings you are going to get. Maybe one of these days W1zz will add full multi-GPU functionality to GPU-Z
__________________
Cloud (noun, singular): A dynamic arrangement of multiple potential single points of failure, with a user at one end and their data at the other. Get more tech news on a wide variety of topics at NextPowerUp
Last edited by Kreij; Apr 19, 2012 at 11:48 AM. |
||||
|
|
|
|
|
#16 | |
![]() Join Date: Jul 2011
Location: Kaunas, Lithuania
Posts: 469 (0.70/day)
Thanks: 309
Thanked 201 Times in 121 Posts
|
Quote:
Monitor a user requested reading[s], with the ability to choose to trigger when going either below or above a user supplied value. First mode: alert as soon as it is below/above the threshold. Second mode: alert after it stays above/below the threshold longer than an interval which is also supplied by the user. When monitoring more than one thing, the modes should be set "per rule". for example, with two rules: "alert if the GPU temp stays above 75°C for more than 300 seconds & alert immediately, if it goes above 90°" or "immediately alert if the Vcore goes above 1.35V & alert if the GPU temp stays above 80°C for more than 60 seconds" and so on... P.S. The "below" setting could be useful, for example, to spot a fan failure.
__________________
Why do you wear glasses if you're deaf? Code:
while (1) {
alone();
}
Last edited by Vinska; Apr 26, 2012 at 07:47 AM. |
|
|
|
|
| The Following User Says Thank You to Vinska For This Useful Post: |
|
|
#17 |
|
Hardcore Monkey Moderator
Join Date: Feb 2007
Location: Cheeseland (Wisconsin, USA)
Posts: 12,126 (5.27/day)
Thanks: 591
Thanked 5,494 Times in 2,938 Posts
|
Another Stub
Here's another test stub.
It's should read the GPU Temp (only, not #1 - #3) for a single card or a crossfire pair. You need to have two instances of GPU-Z running if using more than one card (and of course not have both instances pointing at the same card )It reads the shared mem every 500ms (this is somewhat problematic as it's still a bit of a crap shoot what card will be in the shared mem slot). Anyone have a dual-GPU card they could try it on? EDIT : No error checking to see if GPU-Z is running. It will throw an exception if no GPU-Z is available. Thanks !
__________________
Cloud (noun, singular): A dynamic arrangement of multiple potential single points of failure, with a user at one end and their data at the other. Get more tech news on a wide variety of topics at NextPowerUp
|
|
|
|
|
|
#18 |
|
Chief Broken Rig
Join Date: Mar 2009
Location: 04578
Posts: 6,016 (3.95/day)
Thanks: 761
Thanked 2,225 Times in 1,559 Posts
|
well i was thinking more like if the card switches to 3D clocks then have it record memory usage,
GPU-Z tends to record constant makes it harder to pinpoint where Memory usage spikes im just being nitpicky tho as it would help pinpoint some of the harsher areas to test in games etc. Still pretty cool stuff your doing here Kreij |
|
|
|
| The Following User Says Thank You to crazyeyesreaper For This Useful Post: |
|
|
#19 |
|
Hardcore Monkey Moderator
Join Date: Feb 2007
Location: Cheeseland (Wisconsin, USA)
Posts: 12,126 (5.27/day)
Thanks: 591
Thanked 5,494 Times in 2,938 Posts
|
I assume you mean memory on the GPU?
I have to look into this as only one of my corssfired cards shows dedicated and dynamic memory usage. Does the memory usage show up if you only have one card in? I'm just throwing out little test programs right now to get a handle on what I can and cannot do with the shared memory.
__________________
Cloud (noun, singular): A dynamic arrangement of multiple potential single points of failure, with a user at one end and their data at the other. Get more tech news on a wide variety of topics at NextPowerUp
|
|
|
|
|
|
#20 |
|
Chief Broken Rig
Join Date: Mar 2009
Location: 04578
Posts: 6,016 (3.95/day)
Thanks: 761
Thanked 2,225 Times in 1,559 Posts
|
its no problem Kreij
and yea i ment Vram usage, example i dont care what vram usage is when lvl is loading in BF3 for instance, as my GPU clocks are idle at the time, same goes for SHogun 2 it takes 5-6 mins to load a battle, so if it could trigger logging ONLY during 3D clocks it would be amazing as aka run a benchmark we know how long it is, can use fraps for instance to test frame rates but at the same time, i can log just 3D vram usage on a second by second basis, might be way to hard to do, just something i find interesting. im only running 1 card right now and GPU-Z seems to be reporting memory usage properly |
|
|
|
|
|
#21 |
|
Join Date: Aug 2011
Posts: 1 (0.00/day)
Thanks: 0
Thanked 0 Times in 0 Posts
|
I've made an overlay info display (small but practical) to run over a game or app on a corner of the screen.
I can have realtime info of my gpu without leaving the game. Just an ideia.. |
|
|
|
|
|
#22 | |
![]() Join Date: Jul 2011
Location: Kaunas, Lithuania
Posts: 469 (0.70/day)
Thanks: 309
Thanked 201 Times in 121 Posts
|
Quote:
I checked how is that utility working... it doesn't look too well - monitors the max GPU clock reached. Yet, it looks promising, if ever going to be completed ;] I attached a screenshot:
__________________
Why do you wear glasses if you're deaf? Code:
while (1) {
alone();
}
|
|
|
|
|
|
|
#23 |
|
Hardcore Monkey Moderator
Join Date: Feb 2007
Location: Cheeseland (Wisconsin, USA)
Posts: 12,126 (5.27/day)
Thanks: 591
Thanked 5,494 Times in 2,938 Posts
|
LOL ... didn't do that before. Something must have changed in 0.6.2
I've put this project on hold at the moment. It's really unreliable for reading two cards, unfortunately. I'm hoping W1zz decides to add mutli-card support to the shared mem one of these days.
__________________
Cloud (noun, singular): A dynamic arrangement of multiple potential single points of failure, with a user at one end and their data at the other. Get more tech news on a wide variety of topics at NextPowerUp
Last edited by Kreij; May 27, 2012 at 02:26 PM. |
|
|
|
|
|
#24 |
|
"I go fast!1!11!1!"
Join Date: Oct 2008
Location: IA, USA
Posts: 10,583 (6.28/day)
Thanks: 1,755
Thanked 2,600 Times in 1,962 Posts
|
I noticed the NVIDIA Quadro driver (version 29#) had an option to install a WMI library. Has anyone taken a look into that?
__________________
Golden Rule of Programming: Never assume. try { SteamDownload(); } catch (Steamception ex) { RageQuit(); } |
|
|
|
|
|
#25 |
|
Join Date: Jun 2012
Posts: 2 (0.01/day)
Thanks: 0
Thanked 0 Times in 0 Posts
|
Hello!
Please tell me why do we have to deal with GPU-Z and SharedMem interface? Why don't just read sensors as GPU-Z does? Is there GPU-Z source code? Or source code for reading sensors? I'm not familiar with this stuff (sensors reading) hence such a question I asked. Thanks. Paul |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| GPU-Z Shared Memory Layout | W1zzard | GPU-Z | 31 | Jan 6, 2013 04:37 PM |
| GPU-Z Shared Memory C# Wrapper | JohnnyUT | GPU-Z | 6 | Apr 13, 2012 02:15 PM |
| exe to read GPU-Z shared memory data? | Irios | GPU-Z | 11 | Apr 13, 2012 01:50 AM |
| C# Shared Memory GPU-Z | symbiote_venom | GPU-Z | 0 | Mar 30, 2011 07:54 AM |
| ATITool Shared Memory Info!? | Smiko | ATITool | 2 | Nov 13, 2005 07:51 AM |