It is currently March 19th, 2024, 6:33 am

UsageMonitor Discussions

Share and get help with Plugins and Addons
User avatar
tjhrulz
Developer
Posts: 267
Joined: October 13th, 2016, 1:28 am
Location: Earth
Contact:

Re: UsageMonitor Discussions - GPU oddity?

Post by tjhrulz »

SilverAzide wrote:Hello,

A question for the devs: I've noticed an oddity with the new UsageMonitor plugin... if you monitor the Rainmeter process, it appears that Rainmeter does use GPU, but the memory used is 0 bytes. Is this really true? (PerfMon shows the same thing, by the way...)

Code: Select all

[Rainmeter]
AccurateText=1
DynamicWindowSize=1
Update=1000

[MeasureGPU]
Measure=Plugin
Plugin=UsageMonitor
Alias=GPU
Percent=0
Name=Rainmeter

[MeasureVRAM]
Measure=Plugin
Plugin=UsageMonitor
Alias=VRAM
Percent=0
Name=Rainmeter

[MeasureVRAMShared]
Measure=Plugin
Plugin=UsageMonitor
Alias=VRAMSHARED
Percent=0
Name=Rainmeter

[MeterText]
Meter=String
SolidColor=0,0,0,255
FontColor=255,255,255,255
FontSize=16
Padding=8,8,8,8
X=0
Y=0
Text="Rainmeter: [MeasureGPU:2]%, [MeasureVRAM:]B, [MeasureVRAMShared:]B"
DynamicVariables=1
There are a few small parts of Rainmeter that do use GPU, most of them reference data allocated on your CPU so thus there is no memory on the GPU allocated for them.
buckb
Posts: 64
Joined: February 12th, 2018, 12:47 am

Re: UsageMonitor Discussions

Post by buckb »

I have finally had a chance to experiment with the UsageMonitor plugin. Some testing led me to the following note in the Rainmeter documentation:
Note: Any Index which returns a current value of 0 will return an empty string as the string value. An instance without a value can't be sorted, and can't exist in this indexed list, as it is indistinguishable from all other instances that are 0.
If I understand correctly, the indexed list of counter instances maintained by the plugin does not include any counter instance whose current value is zero. So there is no way to distinguish between a non-existant instance of a counter, and a counter whose current value is zero? For example, using UsageMonitor alone, I cannot tell if a given program is running but currently using zero percent processor, versus not running at all?

If I am missing something, a *light* tap to the head would be appreciated.

--buckb
User avatar
jsmorley
Developer
Posts: 22632
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: UsageMonitor Discussions

Post by jsmorley »

buckb wrote:I have finally had a chance to experiment with the UsageMonitor plugin. Some testing led me to the following note in the Rainmeter documentation:



If I understand correctly, the indexed list of counter instances maintained by the plugin does not include any counter instance whose current value is zero. So there is no way to distinguish between a non-existant instance of a counter, and a counter whose current value is zero? For example, using UsageMonitor alone, I cannot tell if a given program is running but currently using zero percent processor, versus not running at all?

If I am missing something, a *light* tap to the head would be appreciated.

--buckb
You can tell if a program is running by using the name of the program in Name, and getting the PID for it. If the PID is "0", it's not running.

You can using the program name in Name, and get the amount of CPU it is using, but as you say, that doesn't tell if it is just "parked" or "not running".
buckb
Posts: 64
Joined: February 12th, 2018, 12:47 am

Re: UsageMonitor Discussions

Post by buckb »

jsmorley wrote:You can using the program name in Name, and get the amount of CPU it is using, but as you say, that doesn't tell if it is just "parked" or "not running".
Thanks for figuring out what I was getting at, despite my poor example. Allow me to try again with a real-world example.

I have a skin that uses PhysicalDisk counters. I find it useful to distinguish between removable drives that are "offline" (instance does not exist) versus "online" but with no data transfers occurring (counter values of zero). I had hoped to be able to do this using UsageMonitor alone.

If UsageMonitor could return all instances of a given counter, even for counters whose values are zero, then a skin could more easily build a list of online LogicalDisks or PhysicalDisks. Or obtain a list of all running processes. Or do something else useful based upon retrieving a list of all valid Instances for a given Category.


--buckb
rxtd
Posts: 100
Joined: April 30th, 2017, 11:51 am

Re: UsageMonitor Discussions

Post by rxtd »

I have old skin that uses PerfMon plugin to read disk information. Particularly total disk transfer since last boot.
Using PerfMon it looks like this:

Code: Select all

[Measure]
Measure=Plugin
Plugin=PerfMon.dll
PerfMonObject=PhysicalDisk
PerfMonCounter="Disk Read Bytes/sec"
PerfMonInstance="_Total"
PerfMonDifference=0
Without "PerfMonDifference=0" perfmon gives me current value and with it — total since boot.

I can't find anything like it in the new UsageMonitor plugin. There is no "total read since boot" counter, there is no option in UsageMonitor plugin similar to "PerfMonDifference".
If I use "RawValue=1" with this counter then number value of measure is 0.

NomFerp plugin also had the ability to retrieve total value using "Mode=Normal".

Any help?
rxtd
Posts: 100
Joined: April 30th, 2017, 11:51 am

Re: UsageMonitor Discussions

Post by rxtd »

Can blacklist be changed using bangs?
When I try to do it measure's values become 0.0/''.
Here is simple test skin:

Code: Select all

[test]
Measure=Plugin
Plugin=UsageMonitor
Category=PhysicalDisk
Counter=% Idle Time
Index=1
OnUpdateAction=[!SetOption test Blacklist "_Total|Idle|0 E:"]
;Blacklist=_Total|Idle|0 E:
DynamicVariables=1

[background]
meter=image
w=100
h=100
SolidColor=000000
If I remove ";" from "Blacklist" option and add it before "OnUpdateAction" option then everything works.
User avatar
sn00ze
Posts: 5
Joined: May 12th, 2019, 12:15 am

Re: UsageMonitor Discussions

Post by sn00ze »

Can someone please tell me how to get the total number of processes running from UsageMonitor?
User avatar
sn00ze
Posts: 5
Joined: May 12th, 2019, 12:15 am

Re: UsageMonitor Discussions

Post by sn00ze »

Just when I'd given up, I found the answer :oops:

For anyone else having this question:

Code: Select all

[TotalProcesses]
Measure=Plugin
Plugin=UsageMonitor
Category=System
Counter=Processes
Index=0
UpdateDivider=4

[MeterTotalProcesses]
Meter=String
Text=[TotalProcesses:0]
DynamicVariables=1
edited: added DynamicVariables=1 as per balala post, thanks
Last edited by sn00ze on May 14th, 2019, 1:17 am, edited 2 times in total.
User avatar
balala
Rainmeter Sage
Posts: 16091
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: UsageMonitor Discussions

Post by balala »

sn00ze wrote: May 13th, 2019, 5:53 am For anyone else having this question:
Good solution, however there is a missing option. You have to add a DynamicVariables=1 option to the [MeterTotalProcesses] meter, because it uses a section variable and due to this, it requires to set the dynamic variables.
User avatar
ZipD
Posts: 37
Joined: September 10th, 2017, 4:31 pm

Re: UsageMonitor Discussions

Post by ZipD »

I was trying to get current and total VRAM usage by following this example from the UsageMonitor documentation page:

Code: Select all

[TotalVRAM]
Measure=Plugin
Plugin=UsageMonitor
Alias=VRAM
Index=0
MinValue=0
MaxValue=4831838208
However, this value does not show actual VRAM usage of your GPU because it stacks both Dedicated VRAM and Shared VRAM together resulting in a total value that far exceeds your GPU's physical VRAM. Dedicated VRAM is the actual GPU VRAM utilized. You can check these values against the Performance tab in Task Manager, click on the GPU 0 meter. The following code better reflects this:

Code: Select all

[MeasureTotalGPUVRAM]
Measure=Plugin
Plugin=UsageMonitor
Category=GPU Adapter Memory
Counter=Dedicated Usage
A more complete example with commonly used sensors:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
BackgroundMode=2
SolidColor=0,0,0,1

---------------------------------------------------------------------------------------------------
; VARIABLES
---------------------------------------------------------------------------------------------------
[Variables]
@Include=#@#\Variables.inc
BackgroundWidth=360
FontName=Segoe UI
FontSizeNormal=12
FontColor=255,255,255,255

---------------------------------------------------------------------------------------------------
; MEASURES
---------------------------------------------------------------------------------------------------
[MeasureTopGPUEngine]
Measure=Plugin
Plugin=UsageMonitor
Alias=GPU
Index=1
MinValue=0
MaxValue=100
Blacklist=dwm|csrss

[MeasureTopGPUVRAM]
Measure=Plugin
Plugin=UsageMonitor
Alias=VRAM
Index=1

[MeasureTopGPUVRAMScaled]
Measure=Calc
Formula=MeasureTopGPUVRAM

[MeasureTopGPUVRAMFiltered]
Measure=Plugin
Plugin=UsageMonitor
Alias=VRAM
Index=1
Blacklist=_Total|Idle|dwm|wmpnetwk|csrss|svchost|lsass|System|system|Memory Compression|wininit|RemindersServer|spoolsv|IpOverUsbSvc|Rainmeter|#Browser#

[MeasureTopGPUVRAMScaledFiltered]
Measure=Calc
Formula=MeasureTopGPUVRAMFiltered

[MeasureTotalGPUUsage]
Measure=Plugin
Plugin=UsageMonitor
Alias=GPU

[MeasureTotalGPUUsageScaled]
Measure=Calc
Formula=MeasureTotalGPUUsage

[MeasureTotalGPUVRAM]
Measure=Plugin
Plugin=UsageMonitor
Category=GPU Adapter Memory
Counter=Dedicated Usage

[MeasureTotalGPUVRAMScaled]
Measure=Calc
Formula=MeasureTotalGPUVRAM

---------------------------------------------------------------------------------------------------
; METER STYLE
---------------------------------------------------------------------------------------------------
[AllStyle]
FontFace=#FontName#
FontSize=#FontSizeNormal#
FontColor=#FontColor#
AntiAlias=1
DynamicVariables=1
Padding=2,0,2,0

[RightStyle]
X=(#BackgroundWidth#-2)
StringAlign=Right
;Padding=Left,Top,Right,Bottom
Padding=2,0,2,0

---------------------------------------------------------------------------------------------------
; METERS
---------------------------------------------------------------------------------------------------
[MeterTopGPULabel]
Meter=String
MeterStyle=AllStyle
Y=0
Text=Top GPU

[MeterTopGPUValues]
Meter=String
MeterStyle=AllStyle | RightStyle
Y=0r
Text=[MeasureTopGPUEngine] : [MeasureTopGPUEngine:1] %

[MeterTopGPUVRAMLabel]
Meter=String
MeterStyle=AllStyle
Y=0R
Text=Top VRAM

[MeterTopGPUVRAMValues]
Meter=String
MeterStyle=AllStyle | RightStyle
MeasureName=MeasureTopGPUVRAMScaled
Y=0r
AutoScale=1
NumOfDecimals=1
Text=[MeasureTopGPUVRAM] : %1B

[MeterTopGPUVRAMLabelFiltered]
Meter=String
MeterStyle=AllStyle
Y=0R
Text=Top VRAM (Filtered)

[MeterTopGPUVRAMValuesFiltered]
Meter=String
MeterStyle=AllStyle | RightStyle
MeasureName=MeasureTopGPUVRAMScaledFiltered
Y=0r
AutoScale=1
NumOfDecimals=1
Text=[MeasureTopGPUVRAMFiltered] : %1B

[MeterTotalGPULabel]
Meter=String
MeterStyle=AllStyle
Y=10R
Text=Total GPU Used

[MeterTotalGPUValue]
Meter=String
MeterStyle=AllStyle | RightStyle
MeasureName=MeasureTotalGPUUsageScaled
Y=0r
AutoScale=1
NumOfDecimals=1
Text=Total : %1%

[MeterTotalGPUVRAMLabel]
Meter=String
MeterStyle=AllStyle
Y=0R
Text=Total VRAM Used

[MeterTotalGPUVRAMValue]
Meter=String
MeterStyle=AllStyle | RightStyle
MeasureName=MeasureTotalGPUVRAMScaled
Y=0r
AutoScale=1
NumOfDecimals=1
Text=Total : %1B
Note that GPU utilization in Windows Performance Monitor (which is what UsageMonitor is using) does not show the same values as other GPU monitoring software such as GPU-Z, HWiNFO and MSI Afterburner (all 3 show the same % values among themselves). I don't know why this is the case.
Post Reply