It is currently July 14th, 2024, 1:08 pm

Usage Monitor Plug-in and Roundlines/Dedicated GPU Process Memory Usage/Having Trouble With the Values.

Get help with creating, editing & fixing problems with skins
User avatar
Thinkr8
Posts: 86
Joined: November 14th, 2020, 2:36 pm
Location: Washington DC

Usage Monitor Plug-in and Roundlines/Dedicated GPU Process Memory Usage/Having Trouble With the Values.

Post by Thinkr8 »

I took it upon myself to create one of the most accurate MSI Afterburner GPU skins, after what I thought was a completed skin I realized there was something wrong with the Category and Counter I was using for the Memory Usage, Memory Clock and Core CLock, so I changed them to the correct ones, which are, "Category=GPU Process Memory and "Counter=Dedicated Usage but now the roundlines don't work as they should when running a game. I'm aware we can never get a 100% true accurate measure when working with MSI Afterburner and Rainmeter but I believe we can get as close as possible and from what my research as gathered there is none, anywhere. If there is a fully loaded MSI GPU skin I'm unaware of it and wouldn't mind knowing where it is so I can use it as a sample learning tool.

SIDENOTE: I had CoPilot help me three times editing some code and all three times it got it wrong but we worked it out and got it right. Point Is; AI will not get the Rainmeter code right the first time.

I'm aware that not everyone has the same GPU and if need be I will add settings so the end user's card RAM size and any other values (such as SourceID numbers) needed to be entered by the end user will be available so the measures will be as accurate as possible.

(when working with GPU Process Memory I'm not sure of the values I should enter, so I did what I think should be entered. MaxV is the total amount of memory the GPU has, in this case, mine is 2GB -250MB memory used the color should be 75,216,19, above 250MB and lower than 500MB the color should turn to 247,138,5, and between 1Gb and 1Gb the color should turn 247,180,5, above 1GB and MaxV the color should turn to 247,17,5 but the roundline colors don't fluctuate the colors when I'm playing a game. The roundline color stays at 0,200,0. Not to mention I'm still have problems with the other roundlines and their values changing colors too. All the measures, SourceID and meters -I believe- are correct, all the Categories and Counters are correct as well. My best guess as to what the issue is, its in the IfCondition(s) value and the IfTrueAction(s) values).

One more thing I should add: I know the organization of the code in the document "Extended GPU Data (MSI).inc" isn't Ideal so I plan on re-arranging it.

Image

Code: Select all

[GPU0MemoryUsage]
Measure=Plugin
Plugin=MSIAfterburner.dll
GPU=0
SourceId=49
UpdateDivider=2
MinValue=0
MaxValue=#MaxV#

[GPU0Roundline3]
Meter=ROUNDLINE
MeasureName=MeasureRing
LineColor=255,216,0,100
LineWidth=6.0
LineLength=55
LineStart=50
X=395r
Y=0r
AntiAlias=1
Solid=1
Group=Details

[GPU0MemUsage]
Meter=ROUNDLINE
MeasureName=GPU0MemoryUsage
LineColor=184,32,15
LineWidth=6.0
LineLength=55
LineStart=50
StartAngle=(Rad (270))
RotationAngle=(Rad (360))
X=0r
Y=0r
AntiAlias=1
Solid=1
Group=Details

[mGPU0MU]
Measure=Plugin
Plugin=UsageMonitor
Category=GPU Process Memory
Counter=Dedicated Usage
Index=0
IfCondition=(mGPU0MU < 250)
IfTrueAction=[!SetOption GPU0MemUsage LineColor "75,216,19"]
IfCondition2=(mGPU0MU >= 250) && (mGPU0MU < 500)
IfTrueAction2=[!SetOption GPU0MemUsage LineColor "247,138,5"]
IfCondition3=(mGPU0MU >= 1024) && (mGPU0MU < 1024)
IfTrueAction3=[!SetOption GPU0MemUsage LineColor "247,180,5"]
IfCondition4=(mGPU0MU >= 1024) && (mGPU0MU < #MaxV#)
IfTrueAction4=[!SetOption GPU0MemUsage LineColor "247,17,5"]
MSI GPU_SampleTest_1.rmskin
You do not have the required permissions to view the files attached to this post.
Last edited by SilverAzide on July 10th, 2024, 11:38 am, edited 1 time in total.
Reason: Please use code tags when posting code. It's the </> button.
Someone said, "Your thinking too much, so I thought more."
User avatar
Yincognito
Rainmeter Sage
Posts: 7723
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Usage Monitor Plug-in and Roundlines/Dedicated GPU Process Memory Usage/Having Trouble With the Values.

Post by Yincognito »

A few things:
- the roundlines and colors work fine, like you can see if you temporarily comment out the relevant part of the bodies of the current measures and replace them with some basic incrementing Calc measures (notice how I forced MeasureRing to have a percentual value of 1 aka 360/360, and how the other 2 measures use the same values and update dividers to be in sync as I assume you want; the SkinWidth and SkinHeight are just a replacement of your skin being larger in this test sample, as are the X and Y in the 1st meter):

Code: Select all

[Variables]
MaxV=2048
GPU0mv=2

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
BackgroundMode=2
SolidColor=128,128,128,255
SkinWidth=300
SkinHeight=300

---Measures---

[MeasureRing]
Measure=Calc
Formula=360
MinValue=0
MaxValue=360

[GPU0MemoryUsage]

Measure=Calc
Formula=(GPU0MemoryUsage+10)

; Measure=Plugin
; Plugin=MSIAfterburner.dll
; GPU=0
; SourceId=49
; UpdateDivider=2

MinValue=0
MaxValue=#MaxV#

[mGPU0MU]

Measure=Calc
Formula=(mGPU0MU+10)

; Measure=Plugin
; Plugin=UsageMonitor
; Category=GPU Process Memory
; Counter=Dedicated Usage
; Index=0

IfCondition=(mGPU0MU < 250)
IfTrueAction=[!SetOption GPU0MemUsage LineColor "75,216,19"]
IfCondition2=(mGPU0MU >= 250) && (mGPU0MU < 500)
IfTrueAction2=[!SetOption GPU0MemUsage LineColor "247,138,5"]
IfCondition3=(mGPU0MU >= 1024) && (mGPU0MU < 1024)
IfTrueAction3=[!SetOption GPU0MemUsage LineColor "247,180,5"]
IfCondition4=(mGPU0MU >= 1024) && (mGPU0MU < #MaxV#)
IfTrueAction4=[!SetOption GPU0MemUsage LineColor "247,17,5"]

---Meters---

[GPU0Roundline3]
Meter=ROUNDLINE
MeasureName=MeasureRing
StartAngle=0
RotationAngle=(PI*2)
LineColor=255,216,0,100
LineWidth=6.0
LineLength=55
LineStart=50
; X=395r
; Y=0r
X=150
Y=150
AntiAlias=1
Solid=1
Group=Details

[GPU0MemUsage]
Meter=ROUNDLINE
MeasureName=GPU0MemoryUsage
LineColor=184,32,15
LineWidth=6.0
LineLength=55
LineStart=50
StartAngle=(Rad (270))
RotationAngle=(Rad (360))
X=0r
Y=0r
AntiAlias=1
Solid=1
Group=Details
- apparently, the GPU memory usage in the 2nd measure is not the same as the dedicated GPU memory usage by all processes in the 3rd measure; don't ask me why, just find the correct equivalent to the former in PerfMon.exe, if any, so that they both represent the same thing (if that's what you want, of course)
- like said earlier, if you wanted the 2nd and 3rd measure to represent the same thing, you should have made sure that they have the same value and are updated using the same update divider to be in sync

That being said, it's not exactly clear what you want to show. The MSI AB measure is fine, I use more or less the same in my skins, but the UsageMonitor one needs a bit of looking into it depending on what you want to represent there. And yeah, Windows doesn't make it easy for the user to identify which is which when it comes to some counters, although I'm pretty sure the math checks out if using the formulas they use (and which we can only guess).
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Thinkr8
Posts: 86
Joined: November 14th, 2020, 2:36 pm
Location: Washington DC

Re: Usage Monitor Plug-in and Roundlines/Dedicated GPU Process Memory Usage/Having Trouble With the Values.

Post by Thinkr8 »

Thanks Yincognito, I'll back to you on that, I may have bit off more than I can chew. The entire quest might be put on hold or scrapped all together.
My goal to have the most accurate MSI GPU skin may be a futile attempt, so I'm re-thinking what I got myself into, thanks.
Someone said, "Your thinking too much, so I thought more."
User avatar
Thinkr8
Posts: 86
Joined: November 14th, 2020, 2:36 pm
Location: Washington DC

Re: Usage Monitor Plug-in and Roundlines/Dedicated GPU Process Memory Usage/Having Trouble With the Values.

Post by Thinkr8 »

Yes, for now I've scrapped the project, no need for any further assistance, thank you.
Someone said, "Your thinking too much, so I thought more."
User avatar
Yincognito
Rainmeter Sage
Posts: 7723
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Usage Monitor Plug-in and Roundlines/Dedicated GPU Process Memory Usage/Having Trouble With the Values.

Post by Yincognito »

Thinkr8 wrote: July 10th, 2024, 3:09 pm Thanks Yincognito, I'll back to you on that, I may have bit off more than I can chew. The entire quest might be put on hold or scrapped all together.
My goal to have the most accurate MSI GPU skin may be a futile attempt, so I'm re-thinking what I got myself into, thanks.
Not necessarily, you don't have to be that pessimistic. For me, after making the code like this (disregard the meters, just look at the measure values in the log in this rudimentar sample; at the left is PerfMon.exe after adding all related counters for this):

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
BackgroundMode=2
SolidColor=128,128,128,255
SkinWidth=300
SkinHeight=300

---Measures---

[GPU0MemoryUsage]
Measure=Plugin
Plugin=MSIAfterburner.dll
GPU=0
SourceId=49

[GPUAdapterMemoryDedicatedUsageTotal]
Measure=Plugin
Plugin=UsageMonitor
Category=GPU Adapter Memory
Counter=Dedicated Usage
Index=0

[GPULocalAdapterMemoryLocalUsageTotal]
Measure=Plugin
Plugin=UsageMonitor
Category=GPU Local Adapter Memory
Counter=Local Usage
Index=0

[GPUNonLocalAdapterMemoryNonLocalUsageTotal]
Measure=Plugin
Plugin=UsageMonitor
Category=GPU Non Local Adapter Memory
Counter=Non Local Usage
Index=0

[GPUProcessMemoryDedicatedUsageTotal]
Measure=Plugin
Plugin=UsageMonitor
Category=GPU Process Memory
Counter=Dedicated Usage
Index=0

[GPUProcessMemoryLocalUsageTotal]
Measure=Plugin
Plugin=UsageMonitor
Category=GPU Process Memory
Counter=Local Usage
Index=0

[GPUProcessMemoryNonLocalUsageTotal]
Measure=Plugin
Plugin=UsageMonitor
Category=GPU Process Memory
Counter=Non Local Usage
Index=0

---Meters---

[GPU0Roundline3]
Meter=ROUNDLINE
StartAngle=0
RotationAngle=(PI*2)
LineColor=255,216,0,100
LineWidth=6.0
LineLength=55
LineStart=50
X=150
Y=150
AntiAlias=1
Solid=1
Group=Details
GPUMemory.jpg
it became obvious that, in my case, the memory usage reported by MSI AB precisely equals the value for the luid_0x00000000_0x0000FB33_phys_0 instance name from Performance Monitor > GPU Adapter Memory > Dedicated Usage (divide the 173580288 Bytes to 1024 x 1024 and you'll get 165.53906 MBytes), or, put in UsageMonitor options:

Code: Select all

[GPU0AdapterMemoryDedicatedUsageTotal]
Measure=Plugin
Plugin=UsageMonitor
Category=GPU Adapter Memory
Counter=Dedicated Usage
Name=luid_0x00000000_0x0000FB33_phys_0
So, if I sum up the Performance Monitor > GPU Adapter Memory > Dedicated Usage for all the pid_NNNN_luid_0x00000000_0x0000FB33_phys_0 instance names (i.e. the sum of all processes having a NNNN process ID that belong to the luid_0x00000000_0x0000FB33_phys_0 adapter or video card) in the screenshot, I should get the same 165.53906 MBytes.

Now, of course, for you that luid_... might differ, but should be the same principle. How to identify that luid_... or how to sum up only values for the instance names ending in that luid_..., that's another matter as you'd probably need to use some sort of wildcards / whitelist in the UsageMonitor options, if that's even entirely possible. Regardless of how you'd attempt to do it (if you do, that is), things will then make sense.

That's exactly what I said earlier, it isn't that your skin is not accurate (since, after all, it does accurately present the retrieved data), it's just that it lacks a bit of coherence so that the value(s) you measure in [GPU0MemoryUsage] match what you measure in [GPU0AdapterMemoryDedicatedUsageTotal] above (or your individual process values), that's all. ;-)
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Thinkr8
Posts: 86
Joined: November 14th, 2020, 2:36 pm
Location: Washington DC

Re: Usage Monitor Plug-in and Roundlines/Dedicated GPU Process Memory Usage/Having Trouble With the Values.

Post by Thinkr8 »

I still don't understand what advice you're giving me. I know what the advice is, I just know how this is related to my question which was; the roundlines aren't changing colors as they should with the assigned values when I play a game. In the screenshot above the Memory Usage says "460.2MB" but the roundline is green, it should be yellow. And memory clock and core clock act the same way, the colors don't change when gaming.

It's un-clear to me as to what is needed to have it work correctly.

After further thought I think this is a futile attempt because any GPU skin working with MSI will never be the same on someone else's system.
Each end user of any GPU MSI would have to do some manually configuring and I was going to make an attempt to try and avoid that for the end user but I may have took on more than my knowledge will allow. So thanks. And this forum takes more work than I like in order to be understood properly. :(
Someone said, "Your thinking too much, so I thought more."
User avatar
Yincognito
Rainmeter Sage
Posts: 7723
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Usage Monitor Plug-in and Roundlines/Dedicated GPU Process Memory Usage/Having Trouble With the Values.

Post by Yincognito »

Thinkr8 wrote: July 10th, 2024, 5:29 pm I still don't understand what advice you're giving me. I know what the advice is, I just know how this is related to my question which was; the roundlines aren't changing colors as they should with the assigned values when I play a game. In the screenshot above the Memory Usage says "460.2MB" but the roundline is green, it should be yellow. And memory clock and core clock act the same way, the colors don't change when gaming.

It's un-clear to me as to what is needed to have it work correctly.
Well, I already explained that part in my first reply, but I'll be even more precise this time: your [GPU0MemUsage] and [mMemoryUsage] meters from Extended GPU Data (MSI).inc are based on the [GPU0MemoryUsage] measure value to display data (i.e. the total memory usage for GPU 0). By comparison, setting the colors in your [mGPU0MU] measure is based on the [mGPU0MU] measure value (i.e. the GPU Process Memory > Dedicated Usage for all processes, which is for all video cards in the system). In short, there are 2 problems:
- the value of [mGPU0MU] is different than the value of [GPU0MemoryUsage] (this is how my 2nd reply / screenshot relates to your question)
- the value of [mGPU0MU] is not scaled properly in the comparison (mGPU0MU is in bytes, and the numbers you used are megabytes)
So, in code, you'd need something like:

Code: Select all

IfCondition2=(mGPU0MU/1048576 >= 250) && (mGPU0MU/1048576 < 500)
to scale mGPU0MU to the unit used for the 250 and 500 numbers, but even so, mGPU0MU will be different and bigger than GPU0MemoryUsage, the latter of which is displayed in your skin as "460.2MB" and as a roundline, because mGPU0MU is the sum of the dedicated memory usage for all processes on all GPUs. I have no idea which of them is what you want to use, I'm just saying they're different and if you use the UsageMonitor value that needs to be scaled for the IfConditions to work.
Thinkr8 wrote: July 10th, 2024, 5:29 pm After further thought I think this is a futile attempt because any GPU skin working with MSI will never be the same on someone else's system.
Each end user of any GPU MSI would have to do some manually configuring and I was going to make an attempt to try and avoid that for the end user but I may have took on more than my knowledge will allow. So thanks. And this forum takes more work than I like in order to be understood properly. :(
Not quite. Unlike the old HWiNFO way of getting data using the Shared Memory Viewer (which indeed required user / system specific configuration), MSI AB has a consistent syntax for the MSI AB plugin measure options, irrespective of system (I'm talking about the syntax of options like SourceId, DataSource, GPUDescriptor, etc). If you're talking about configuring how much memory the GPU has or similar, you can already get that using wmic (which is a bit obsolete by now) or PowerShell's Get-CimInstance from a RunCommand measure, similar to how you did in your R1 and R2 measures.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Thinkr8
Posts: 86
Joined: November 14th, 2020, 2:36 pm
Location: Washington DC

Re: Usage Monitor Plug-in and Roundlines/Dedicated GPU Process Memory Usage/Having Trouble With the Values.

Post by Thinkr8 »

I apologize if I'm sounding like I'm a little rough around the edge's. I do realize you're help and I have no doubt your method will work, and I'm very grateful for your advice. I will have to take a day or two so I can implement the changes and hopefully understand it a little more.

Thanks, you guy's rock.
(make sense then, about MSI Afterburner, thank you.)
Someone said, "Your thinking too much, so I thought more."
User avatar
Yincognito
Rainmeter Sage
Posts: 7723
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Usage Monitor Plug-in and Roundlines/Dedicated GPU Process Memory Usage/Having Trouble With the Values.

Post by Yincognito »

Thinkr8 wrote: July 10th, 2024, 8:40 pm I apologize if I'm sounding like I'm a little rough around the edge's. I do realize you're help and I have no doubt your method will work, and I'm very grateful for your advice. I will have to take a day or two so I can implement the changes and hopefully understand it a little more.

Thanks, you guy's rock.
(make sense then, about MSI Afterburner, thank you.)
Yeah, no worries and no need to apologize, your question about how my 2nd reply was related to your OP was perfectly legitimate. The bottom line was that you set colors based on a different (and not scaled) value compared to the value you displayed as text and roundline.

I doubt you'll be able to implement summing up only the memory usage of processes using a certain GPU in the UsageMonitor measure like described in my 2nd reply, given that both the Blacklist and the Whitelist options in UsageMonitor lack wildcards like * but that's how one should approach it.

It would help to know exactly what you wanted to return in mGPU0MU (in your own words), as this is a little blurry at the moment.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Thinkr8
Posts: 86
Joined: November 14th, 2020, 2:36 pm
Location: Washington DC

Re: Usage Monitor Plug-in and Roundlines/Dedicated GPU Process Memory Usage/Having Trouble With the Values.

Post by Thinkr8 »

Yincognito wrote: July 10th, 2024, 10:09 pm It would help to know exactly what you wanted to return in mGPU0MU (in your own words), as this is a little blurry at the moment.
Well, I slept on that question and I'm not sure what return in mGPU0MU I want, lol. So I have to look at the meter name the MU in mGPU0MU stands for Memory Usage so I was thinking "Dedicated Usage" is the choice. I'll be working on it on and off today and I'm not sure how much I'll get done, TY :)

What is the most popular choice the end user would like to have? Do you have any idea or is that a far reaching question?

Also after a night of sleep I realized I don't know very much about the inner working's of a GPU and thought tells me it would help to know. :)

One last question; after all these some odd years of Rainmeter why hasn't a GPU plug-in been created so we don't have to use third party software to gather the info we want? I'm not intelligent enough to build one, if I was, I'd do it. Lol.
Someone said, "Your thinking too much, so I thought more."