Rainmeter plugin for MSI Afterburner

Discussion in 'MSI AfterBurner Application Development Forum' started by stangowner, Apr 12, 2010.

  1. stangowner

    stangowner Guest

    Messages:
    607
    Likes Received:
    11
    GPU:
    2xMSI N550GTX-Ti Cy II OC
    Thanks for sharing!
     
  2. eminaguil

    eminaguil Member

    Messages:
    29
    Likes Received:
    9
    GPU:
    Saphire 5700/Byksi
    Hi,
    Thanks stangowner for this skin, I've modified a little the configuration.
    Can anyone help me to configure the correct display of the framerate, as shown in my screen capture all the lectures are displayed but the framerate.

    This is my first post, hope I don't get banned for posting the link to my image.

    fs1.directupload.net/images/141213/7kdrm4o3.png
     
  3. stangowner

    stangowner Guest

    Messages:
    607
    Likes Received:
    11
    GPU:
    2xMSI N550GTX-Ti Cy II OC
    Hi,

    All that should be needed is to:
    1. Install RTSS along with Afterburner. Did you keep that selected when installing?
    2. Enable framerate in the afterburner settings on the monitoring tab by checking it
    3. Open a 3d application

    Do you see the framerate in Afterburner's monitoring graphs?
     
  4. Yincognito

    Yincognito Member

    Messages:
    23
    Likes Received:
    1
    GPU:
    AMD Radeon HD 7610M / 1GB
    Hi,

    I have a question for Stangowner : is it possible to get GPU card's REGISTRY KEY with your plugin? I mean it's already possible to get BIOS info, driver info...what about the registry location for the GPU data? It's right there next to the VendorId and DeviceId in MSI Afterburner's Information panel, so I suppose that string is also available for grabbing, just like the other GPU descriptors...

    I want to find out the registry location for GPU card data so that I can use HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Video\{1AFE4FAC-D3A2-4B7B-B558-C0754BC15FEF}\0000\HardwareInformation.MemorySize to display video card's memory size in my skins (and use it for computing), and I absolutely need the {1AFE4FAC-D3A2-4B7B-B558-C0754BC15FEF} part, as the Registry option in Rainmeter takes only fixed (static) registry paths (that is, it can't "search" for things in registry). This part is "volatile", it is different from system to system, so the best way to get it would be by grabbing the <Registry key> text from the same place as the other GPU descriptors.

    Right now my only option is to manually set GPU memory size(s) in my Variables.inc file, but that's so annoying, especially when you have the desired info right under your nose, in the Windows registry...

    So, is it possible? And if not, could this be integrated in the plugin? I guess it would only take 2-3 lines of code, as the grabbing method should be the same as the one for VendorId or DeviceId.

    By the way, exceptional job with your plugin, mr. Stangowner! Having MSI Afterburner, RivaTuner Statistics Server and Rainmeter with your plugin I'm able to always monitor things on my laptop regardless of what I'm doing (Windows/applications or Full screen/games).

    Thank you.
     

  5. stangowner

    stangowner Guest

    Messages:
    607
    Likes Received:
    11
    GPU:
    2xMSI N550GTX-Ti Cy II OC
    Hi,

    No, this is not possible. This plugin accesses all information in the MSI Afterburner's SDK via shared memory. The registry path and adapter GUIDs are not available at this time.

    However, WMI makes it easier to grab some of this information rather than parsing the registry. So for instance, the Video Memory can be obtained through:
    Code:
    C:\Users\Nick>[B]WMIC path Win32_VideoController get Name,AdapterRAM[/B]
    AdapterRAM  Name
    1073741824  NVIDIA GeForce GTX 550 Ti
    1073741824  NVIDIA GeForce GTX 550 Ti
    C:\Users\Nick>
    I'm pretty sure Rainmeter can do WMI, maybe through the PerfMon plugin or similar. I'd try this route first I think.

    Hope this helps.

    - Nick
     
  6. Yincognito

    Yincognito Member

    Messages:
    23
    Likes Received:
    1
    GPU:
    AMD Radeon HD 7610M / 1GB
    Thank you for responding, Nick, but I already figured it out myself. I was kind of busy with the coding, that's why I didn't post on this earlier.

    No, it can't do WMI by itself. Maybe through scripting or LUA, but I wouldn't bet on it. I don't want to use scripting in my skins anyway, so, even if possible, this is out of the question.

    But I managed to do it solely by manipulating the registry.
    As I said, I needed the {1AFE4FAC-D3A2-4B7B-B558-C0754BC15FEF} string to be able to pass the correct parameter to Rainmeter. I got an idea and searched for this string only throughout the registry, and it seems not only this, but the whole registry path that I needed is saved in HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\VIDEO\Device\Video<N>, where <N> is a number ranging from 0 to the number of video devices installed in the system.

    All I had to do is:
    - parse through HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\VIDEO\Device\Video0 to Video20, for example, to get the registry paths containing the {1AFE4FAC-D3A2-4B7B-B558-C0754BC15FEF}-like strings for ALL the video devices in the system
    - check each of the above paths for the condition <RegistryPath>\Settings\Device Description = your plugin's DisplayName. If that was true, then the respective path would be the GPU's one, and I could further check <RegistryPath>\HardwareInformation.MemorySize to get the GPU's memory size.

    So that was it. No WMI, no scripting, no LUA. Just your plugin and manipulating the registry a bit and voila. It takes a lot more text than your code, but that's just because I need to check every video device in the system to see if that's the video card (so it's basically a lot of copy/paste/modify).

    I already had the code for adaptively displaying either one or two GPU information (by hiding the meter of the "not found" GPU), so everything is automated now :
    - skin detects and displays only one or both GPUs, depending on the system's configuration
    - skin automatically gets and displays the GPU(s) memory size(s) for the video card(s) in the system.

    Now I would like to do the same for the active network connections in the system, let's see if this can be done the same, by just manipulating the registry. Theoretically it should be possible, but I guess it'll be more complicated (not every present network is an active one, a bit different from the GPU situation).

    Thanks again for your response, and for your great plugin! Great job, Nick!
     
  7. stangowner

    stangowner Guest

    Messages:
    607
    Likes Received:
    11
    GPU:
    2xMSI N550GTX-Ti Cy II OC
    Great, glad you got it going. Thanks for the details on how you tracked it down.
     
  8. Yincognito

    Yincognito Member

    Messages:
    23
    Likes Received:
    1
    GPU:
    AMD Radeon HD 7610M / 1GB
    No problem, Nick - I posted the details in case anyone is curious about how this was done. There were so many times I took advantage of some forum posts to solve problems, that I thought it was good to give something back, whenever possible.

    P.S. By the way, I managed to do the same for network cards - and I was wrong, this was easier than for video cards.
    The magic registry key is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards. No need for condition checking, just some cosmetics on the strings, so that PerfMon would correctly get the instance name (e.g. replacing "(" with "[", etc.).
     
  9. RazielNomack

    RazielNomack Guest

    Messages:
    1
    Likes Received:
    0
    GPU:
    GeForce GTX660 Ti 3GB
    I have made a Skin for MSI. Unfortunately, I cant post Links or Images since I´m a new User.

    rainmeter(dot)net/forum/viewtopic(dot)php?f=27&t=20809
     
  10. Yincognito

    Yincognito Member

    Messages:
    23
    Likes Received:
    1
    GPU:
    AMD Radeon HD 7610M / 1GB
    Nice skin, friend.

    I'll have my set of skins (based on MSI Afterburner too for temps) posted in a few days also. Those will bring something new : adaptive hardware detection. I don't cycle weather data though (I use mouse click on the day name for the next day/night), but I do cycle top processes data every second, the cycle duration being adjustable.
     

  11. Astrix_au

    Astrix_au Active Member

    Messages:
    78
    Likes Received:
    0
    GPU:
    MSI RX VEGA 64 Wave
    The Gnometer MSI Afterburner one I posted no longer works. All the info for Afterburner is missing.

    Edit: I got it working, I didn't put the afterburner.dll file in the plugins folder of Rainmeter after updating.
     
    Last edited: Apr 15, 2015
  12. Astrix_au

    Astrix_au Active Member

    Messages:
    78
    Likes Received:
    0
    GPU:
    MSI RX VEGA 64 Wave
    I got it working, I didn't put the afterburner.dll file in the plugins folder of Rainmeter after updating.
     
  13. Yincognito

    Yincognito Member

    Messages:
    23
    Likes Received:
    1
    GPU:
    AMD Radeon HD 7610M / 1GB
    Nick (aka Stangowner), I finally decided to use the WMI to do the detection of the video cards, instead of the registry one. I need to do a conditional checking though, so that I can correlate the data I get from MSI AB to the correct GPU provided by the WMI query.

    In short, I need some unique identifiers of the GPUs (both in MSI AB and WMI) to match.

    I tried doing that by comparing MSI AB's GpuId to WMI's PNPDeviceID, but finally realised that the GpuId is not unique, at least for multiple identical GPUs (while PNPDeviceID seems to be unique, due to the string after its last "\"). So I thought of comparing both MSI AB's GpuId and DeviceNum to WMI's PNPDeviceID and DeviceID (DeviceID is obtainable by a "wmic path Win32_VideoController get deviceid").

    So here goes my question : is MSI AB's DeviceNum in any way related to WMI's DeviceID? For example if DeviceNum=0 does this mean that WMI's DeviceID=VideoController1 and, likewise, if DeviceNum=1 then WMI's DeviceID=VideoController2?
     
  14. Unwinder

    Unwinder Ancient Guru Staff Member

    Messages:
    17,189
    Likes Received:
    6,816
    Afterburner's GPU are always sorted by bus / device / function. OS enumerates GPUs by display connection so GPU order can be different depending on OS and depending on connected displays order. Sorting in AB is done to make GPUs order independent of that.
     
  15. Yincognito

    Yincognito Member

    Messages:
    23
    Likes Received:
    1
    GPU:
    AMD Radeon HD 7610M / 1GB
    Thank you, Alexey, for your useful and informative reply - and great work with your application, by the way!

    The only reason for me to check this with WMI (previously using the registry) is to get the video card memory size. As you probably know, MSI AB doesn't always return that, especially on mobile ATI/AMD GPUs like mine is. The WMI is also buggy sometimes, by returning a negative memory size due to integer overflow, but at least it returns something...

    By the way, why doesn't MSI AB return the full (unique) PNP Device ID of the GPU, like WMI or OS utilities? I understand it uses a different order and has to show bus / device / function, but to me the :

    could be instead

    Code:
    GpuId
    VEN_1002&DEV_6742&SUBSYS_FB311179&REV_00&BUS_1&DEV _0&FN_0
    PNPDeviceId
    PCI\VEN_1002&DEV_6742&SUBSYS_FB311179&REV_00\4&F8AE2CB&0&0008
    as the separate VendorId, DeviceId, SubSystem, Revision, Bus, DeviceNum and FunctionNum can be easily obtained by string manipulation of the GpuId...

    This way, most of the MSI AB information could be correlated with other data grabbed by the OS, registry, other utilities, etc.

    P.S. Or maybe you know a way of getting the Bus, DeviceNum and FunctionNum in WMI as well, so that one could compare them with the values got from MSI AB?
     

  16. Unwinder

    Unwinder Ancient Guru Staff Member

    Messages:
    17,189
    Likes Received:
    6,816
    That "full" device ID is not really useful for anything but OS specific mapping between physical GPU and logical Windows display.
    And no, you cannot extract bus, device and function number from that string ID directly. But SetupApi allows you to get location info and reconcile logical displays (identified by OS IDs) and physical GPUs.
    All tools working with GPUs at lower level always use PCI location info instead of it.
     
    Last edited: May 19, 2015
  17. Yincognito

    Yincognito Member

    Messages:
    23
    Likes Received:
    1
    GPU:
    AMD Radeon HD 7610M / 1GB
    I see. Well, I guess I'll just settle with the "no" then :)

    Possibly, but, you know, I'm only designing a skin for Rainmeter, not doing a C++/C# application. I thought I could work with the info provided by various sources (MSI AB, HWiNFO, OS, WMI, registry, etc.) to display the necessary stuff in a Rainmeter skin, not reinventing the wheel by making a new application instead.

    So you're telling me that the bold numbers from VEN_1002&DEV_6742&SUBSYS_FB311179&REV_00&BUS_1&DEV _0&FN_0 don't represent the Bus, DeviceNum and FunctionNum? Oh well, you know best, but surely that was my impression. I was probably wrong then...
     
  18. Unwinder

    Unwinder Ancient Guru Staff Member

    Messages:
    17,189
    Likes Received:
    6,816
    They do in AB's GPUID string, which I format myself, that's my own identifier. But they are NOT included into any ID strings used by OS.
     
  19. Yincognito

    Yincognito Member

    Messages:
    23
    Likes Received:
    1
    GPU:
    AMD Radeon HD 7610M / 1GB
    Yes, that was what I was also talking about. ;) Having both your formatted GPUID string and its separate parts seemed a little redundant to me, that's why I suggested the OS GPUID could be grabbed (instead of the separate parts of your string). Then one would have both your string and the OS one.

    But you already said no, so I won't insist further on this. :)
     
    Last edited: May 19, 2015
  20. Yincognito

    Yincognito Member

    Messages:
    23
    Likes Received:
    1
    GPU:
    AMD Radeon HD 7610M / 1GB
    Update - This is what you get if you don't take no for an answer (like myself). I found a way to correlate the WMI's PNPDeviceID to the MSI AB's GpuId. It doesn't involve SetupApi or anything "fancy". In fact, it's pretty straightforward, and involves using the good ol' registry for it :

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\[WMI's PNPDeviceID]\LocationInformation

    would provide something like "@system32\drivers\pci.sys,#65536;PCI bus %1, device %2, function %3;(1,0,0)". The numbers in paranthesis are just what I need (aka Bus, DeviceNum and FunctionNum).

    Now I can easily (using some string manipulation/RegEx, of course) do my comparison and GPU identification using unique identifiers in both WMI and MSI AB, which is what I wanted in the first place. Thank you, Alexey, for putting my stubbornness/tenacity to work - I'm always motivated by a "it can't be done" approach. :thumbup:

    P.S. I know you didn't say that directly, but it sounded like that :)
     

Share This Page