Guru3D.com Forums

Go Back   Guru3D.com Forums > Affiliates > MSI AfterBurner Overclock Application Discussion forum
MSI AfterBurner Overclock Application Discussion forum This forum is intended for MSI customers for questions on the AfterBurner Overclock Utility based off Rivatuner. In this section the users help each other out with answers as well as support staff from MSI.



Reply
 
Thread Tools Display Modes
Old
  (#26)
stangowner
Master Guru
 
stangowner's Avatar
 
Videocard: 2xMSI N550GTX-Ti Cy II OC
Processor: Intel Core i7-3960X
Mainboard: MSI X79A-GD45
Memory: 16GB Corsair Vengence
Soundcard: X-Fi Plat Fatal1ty Champ
PSU: Antec 850w
Default 04-07-2012, 23:28 | posts: 586 | Location: MA

Quote:
Originally Posted by adibe View Post
Could you please implement the frequency boost options present in the MSI Afterburner 2.2.0 beta 15?
....
I plan on adding that. But its going to be a bit before I can get to it.
   
Reply With Quote
 
1.1.0 Released
Old
  (#27)
stangowner
Master Guru
 
stangowner's Avatar
 
Videocard: 2xMSI N550GTX-Ti Cy II OC
Processor: Intel Core i7-3960X
Mainboard: MSI X79A-GD45
Memory: 16GB Corsair Vengence
Soundcard: X-Fi Plat Fatal1ty Champ
PSU: Antec 850w
Default 1.1.0 Released - 05-02-2012, 10:14 | posts: 586 | Location: MA

This library has been updated to include the new power limit control, core clock boost control and memory clock boost control that were added in MSI Afterburner 2.2.0. The links in the first post have been updated.

- Nick
   
Reply With Quote
Old
  (#28)
VultureX
Banned
 
Videocard: MSI GTX970 SLI
Processor: Core i7 2700K @4.8GHz H2O
Mainboard: Asrock Z68 Extreme3 Gen3
Memory: 8GB G.Skill 2133MHz CL9
Soundcard: Xonar Essence ST - Z-5500
PSU: Corsair TX850 V2
Default 07-10-2012, 00:15 | posts: 2,577 | Location: Netherlands

Nice libarary. It annoys me that Afterburner does not work in 64-bit applications. In theory one could create a costum overlay for 64-bit applications using this class library and some other APIs, which would be pretty neat, but would also cause massive overhead.

On another note:
Is it possible to add functionality to send commands to Afterburner, such as 'take a screenshot', 'show overlay' and such?
I'm trying to work around an issue that prevents screenshots from being taken if Ctrl is also pressed at the same time.

Hmm, it might be easier, but less challenging to post this in the bug thread instead, but I assume I don't have a choice. :p
   
Reply With Quote
Old
  (#29)
basco
Member Guru
 
Videocard: 560tfII
Processor: 2500k
Mainboard: ud4
Memory:
Soundcard:
PSU: 300sfx-bequiet
Default 07-11-2012, 12:57 | posts: 107 | Location: austria

thanks very much for your time + effort!
   
Reply With Quote
 
Old
  (#30)
stangowner
Master Guru
 
stangowner's Avatar
 
Videocard: 2xMSI N550GTX-Ti Cy II OC
Processor: Intel Core i7-3960X
Mainboard: MSI X79A-GD45
Memory: 16GB Corsair Vengence
Soundcard: X-Fi Plat Fatal1ty Champ
PSU: Antec 850w
Default 07-12-2012, 01:02 | posts: 586 | Location: MA

Quote:
Originally Posted by VultureX View Post
On another note:
Is it possible to add functionality to send commands to Afterburner, such as 'take a screenshot', 'show overlay' and such?
No sorry, this library can't help you with that.

Quote:
Originally Posted by basco View Post
thanks very much for your time + effort!
You're welcome. And as always, thanks to Unwinder for making this possible.
   
Reply With Quote
Old
  (#31)
easperhe
Newbie
 
Videocard: nVidia / GeForce 8200
Processor: AMD Phenom
Mainboard:
Memory:
Soundcard:
PSU:
Default 11-14-2012, 19:37 | posts: 15

Thanks for the effort here! I will be trying this out shortly and will provide feedback.
   
Reply With Quote
Old
  (#32)
easperhe
Newbie
 
Videocard: nVidia / GeForce 8200
Processor: AMD Phenom
Mainboard:
Memory:
Soundcard:
PSU:
Default 11-15-2012, 18:36 | posts: 15

Stangowner, All,

I would like to open AB, set a voltage, then exit AB. And I want to do this several times within the same C# program. The problem I'm seeing is that this only works on the first instance of AB. After that, the subsequent instances of AB are not working.

It seems like C# control memory object is updated for the 1st instance of AB but continues to point to this first instance (which really doesn't exist anymore) after that instance of AB is closed and another instance of AB is opened. See below for the core of an example C# program that shows the issue.

How can I make this work? I can try to use just an initial instance of AB. But, I consider this less robust since AB might close of the user might accidently close AB. Since the C# code has not closed, it could open a new AB instance but this wouldn't work due to this issue.

Thanks!


string[] gpu_volt_values = new string[] { "1.05", "1.15", "1.20" };

Double newDouble;
UInt32 gpu_volt_value_new;

foreach (string gpu_volt_value in gpu_volt_values) {

if (Double.TryParse(gpu_volt_value, out newDouble)) {
gpu_volt_value_new = Convert.ToUInt32(newDouble * 1000);
try {

// Start MSI AfterBurner
ProcessStartInfo info = new ProcessStartInfo(@"C:\Program Files (x86)\MSI Afterburner\MSIAfterburner.exe");
info.UseShellExecute = false;
info.WorkingDirectory = @"C:\Program Files (x86)\MSI Afterburner";

Process prog = Process.Start(info);
Thread.Sleep(2000);

// Attach to MSI AfterBurner shared memory
macm = new ControlMemory();
macm.Connect();

macm.GpuEntries[0].CoreVoltageCur = gpu_volt_value_new;
macm.CommitChanges();
System.Threading.Thread.Sleep(2000);
macm.ReloadAll();
macm.Disconnect();


} catch (Exception e) {
Console.WriteLine(e.Message);
}

// Kill the MSI Afterburner task
ProcessStartInfo info2 = new ProcessStartInfo(@"taskkill.exe");
info2.UseShellExecute = false;
info2.Arguments = " /F /IM " + "\"" + @"MSIAfterburner.exe" + "\"" + " /T ";

Process prog2 = Process.Start(info2);
prog2.WaitForExit();


}
}
   
Reply With Quote
Old
  (#33)
stangowner
Master Guru
 
stangowner's Avatar
 
Videocard: 2xMSI N550GTX-Ti Cy II OC
Processor: Intel Core i7-3960X
Mainboard: MSI X79A-GD45
Memory: 16GB Corsair Vengence
Soundcard: X-Fi Plat Fatal1ty Champ
PSU: Antec 850w
Default 11-16-2012, 18:24 | posts: 586 | Location: MA

Quote:
Originally Posted by easperhe View Post
Stangowner, All,

I would like to open AB, set a voltage, then exit AB. And I want to do this several times within the same C# program. The problem I'm seeing is that this only works on the first instance of AB. After that, the subsequent instances of AB are not working.

It seems like C# control memory object is updated for the 1st instance of AB but continues to point to this first instance (which really doesn't exist anymore) after that instance of AB is closed and another instance of AB is opened. See below for the core of an example C# program that shows the issue.

How can I make this work? I can try to use just an initial instance of AB. But, I consider this less robust since AB might close of the user might accidently close AB. Since the C# code has not closed, it could open a new AB instance but this wouldn't work due to this issue.

Thanks!


string[] gpu_volt_values = new string[] { "1.05", "1.15", "1.20" };

Double newDouble;
UInt32 gpu_volt_value_new;

foreach (string gpu_volt_value in gpu_volt_values) {

if (Double.TryParse(gpu_volt_value, out newDouble)) {
gpu_volt_value_new = Convert.ToUInt32(newDouble * 1000);
try {

// Start MSI AfterBurner
ProcessStartInfo info = new ProcessStartInfo(@"C:\Program Files (x86)\MSI Afterburner\MSIAfterburner.exe");
info.UseShellExecute = false;
info.WorkingDirectory = @"C:\Program Files (x86)\MSI Afterburner";

Process prog = Process.Start(info);
Thread.Sleep(2000);

// Attach to MSI AfterBurner shared memory
macm = new ControlMemory();
macm.Connect();

macm.GpuEntries[0].CoreVoltageCur = gpu_volt_value_new;
macm.CommitChanges();
System.Threading.Thread.Sleep(2000);
macm.ReloadAll();
macm.Disconnect();


} catch (Exception e) {
Console.WriteLine(e.Message);
}

// Kill the MSI Afterburner task
ProcessStartInfo info2 = new ProcessStartInfo(@"taskkill.exe");
info2.UseShellExecute = false;
info2.Arguments = " /F /IM " + "\"" + @"MSIAfterburner.exe" + "\"" + " /T ";

Process prog2 = Process.Start(info2);
prog2.WaitForExit();


}
}
Hi,

I can't personally test this for another week or so. I'm traveling in Europe right now and I don't have access to my home PC.

A few things to note though:
  1. There is no need to call macm.ReloadAll(), because you are just disconnecting right afterwards. You don't need to refresh all the properties in the object..... it is just wasting a few clock cycles
  2. You should not just kill MSI Afterburner like that. It is not letting the application do its proper shutdown procedure, which includes removing the shared memory (or flagging it as dead if other apps have a handle open to it)
  3. Are you sure that 2 seconds is long enough for Afterburner to start before using this library?
Let me know your thoughts on the above, and/or if you do more testing/changes before I return home.

Thanks,
Nick
   
Reply With Quote
Old
  (#34)
easperhe
Newbie
 
Videocard: nVidia / GeForce 8200
Processor: AMD Phenom
Mainboard:
Memory:
Soundcard:
PSU:
Default 11-28-2012, 18:09 | posts: 15

Stangowner,

Below are answers to your thoughts. For how, I'll keeping MSI AB open all the time. I start it at windows startup and keep it minimized in the taskbar so the user doesn't see it. This is OK for now. But, I would like to figure out how to get this to work properly if MSI AB does die for some reason and I have to relaunch MSI AB.

Thanks, easperhe


1. There is no need to call macm.ReloadAll(), because you are just disconnecting right afterwards. You don't need to refresh all the properties in the object..... it is just wasting a few clock cycles

-- OK. I was just trying everything to see is something worked.

2. You should not just kill MSI Afterburner like that. It is not letting the application do its proper shutdown procedure, which includes removing the shared memory (or flagging it as dead if other apps have a handle open to it)

-- How do you suggest shutting down MSI AB?

3. Are you sure that 2 seconds is long enough for Afterburner to start before using this library?

-- I've had no problems so far.
   
Reply With Quote
Old
  (#35)
stangowner
Master Guru
 
stangowner's Avatar
 
Videocard: 2xMSI N550GTX-Ti Cy II OC
Processor: Intel Core i7-3960X
Mainboard: MSI X79A-GD45
Memory: 16GB Corsair Vengence
Soundcard: X-Fi Plat Fatal1ty Champ
PSU: Antec 850w
Default 12-03-2012, 11:39 | posts: 586 | Location: MA

Quote:
Originally Posted by easperhe View Post
2. You should not just kill MSI Afterburner like that. It is not letting the application do its proper shutdown procedure, which includes removing the shared memory (or flagging it as dead if other apps have a handle open to it)

-- How do you suggest shutting down MSI AB?
I'm not sure if there is a command line argument for that. I tried the basics (/x, /q, /exit, /quit) and none of them worked. Perhaps Unwinder can tell us if there is an argument to exit the application.

- Nick
   
Reply With Quote
Old
  (#36)
Unwinder
Moderator
 
Videocard:
Processor:
Mainboard:
Memory:
Soundcard:
PSU:
Default 12-03-2012, 13:03 | posts: 12,971 | Location: Taganrog, Russia

Quote:
Originally Posted by stangowner View Post
I'm not sure if there is a command line argument for that. I tried the basics (/x, /q, /exit, /quit) and none of them worked. Perhaps Unwinder can tell us if there is an argument to exit the application.

- Nick
There is no such command line switch, Nick.


Alexey Nicolaychuk aka Unwinder, RivaTuner creator
   
Reply With Quote
Old
  (#37)
stangowner
Master Guru
 
stangowner's Avatar
 
Videocard: 2xMSI N550GTX-Ti Cy II OC
Processor: Intel Core i7-3960X
Mainboard: MSI X79A-GD45
Memory: 16GB Corsair Vengence
Soundcard: X-Fi Plat Fatal1ty Champ
PSU: Antec 850w
Default 12-03-2012, 16:13 | posts: 586 | Location: MA

Quote:
Originally Posted by Unwinder View Post
There is no such command line switch, Nick.
Thanks for the reply!

Quote:
Originally Posted by easperhe View Post
2. You should not just kill MSI Afterburner like that. It is not letting the application do its proper shutdown procedure, which includes removing the shared memory (or flagging it as dead if other apps have a handle open to it)

-- How do you suggest shutting down MSI AB?
Sorry, but I don't have a good suggestion for this.
   
Reply With Quote
Old
  (#38)
danielkza
Newbie
 
Videocard: Shappire HD4830
Processor: Core 2 Duo E7300
Mainboard: MSI P45 Neo-F
Memory: 2x2GB DDR2-960
Soundcard: Realtek ALC888
PSU: Corsair VX550W
Default 01-21-2013, 08:30 | posts: 7 | Location: São Paulo, Brazil

Quote:
Originally Posted by stangowner View Post
Thanks for the reply!


Sorry, but I don't have a good suggestion for this.
Sending a WM_QUIT message to Afterburner should be enough.

---

Now for my own issue: I just recently changed from an MSI GTX 570 to an MSI NGTX680 Lightning, and I cannot get an accurate memory amount through the .NET API. I always get a value of 0.

I'm using Powershell, and everything seems to work fine, except for retrieving the memory amount (which is unfortunately critical for my program). Here is a simple test script, followed by it's output (you need to place the API DLL in the same folder as the script):

Code:
$baseFolder = Split-Path -parent $script:MyInvocation.MyCommand.Path

Add-Type -Path $baseFolder\MSIAfterburner.NET.dll

$cmem = New-Object MSI.Afterburner.ControlMemory
Write-Host ("MSI Afterburner (API version {0})" -f $cmem.Header.GetVersionText())
    
$hmon = New-Object MSI.Afterburner.HardwareMonitor

foreach($gpu in $hmon.GpuEntries)
{
    Write-Host ("GPU #{0}" -f ($gpu.Index+1))
    Write-Host ("  Device: {0}" -f $gpu.Device)
    Write-Host ("  Driver Version: {0}" -f $gpu.Driver)
     Write-Host ("  Memory: {0}" -f ($gpu.MemAmount))
}
Code:
MSI Afterburner (API version 2.0)
GPU #1
  Device Version: MSI N680GTX Lightning
  Driver: 310.70
  Memory: 0MB
Can anyone reproduce this issue with other cards?

Thanks,
Daniel

Last edited by danielkza; 01-21-2013 at 08:34.
   
Reply With Quote
Old
  (#39)
timiman
Newbie
 
Videocard: 2xR9-290 Asus DCU-II
Processor: AMD FX-8320@4.1GHz
Mainboard: Asus M5A99X EVO R2.0
Memory: 16GB/DDR3-1866
Soundcard:
PSU: Corsair 1KW
Default 01-22-2013, 11:56 | posts: 37 | Location: Greece

I'm having a scenario in which I came along using the .dll .

1.MSI Afterburner is already running.
2.My application (.net vb) starts.
-Recognizes all data from .dll and can get values
3.MSI Afterburner closes.
4.Try to retrieve again from the .dll the MSIAfterburner data, and gets nothing.
5.Re-open MSIAfterburner
6.Try to retrieve again from the .dll and I get a message of "Connected to a shared memory that is flagged dead".

Only reopening my application fixes the issue, but it has to be something that I'm doing wrong here.

My code is like that:
Code:
    Sub Find_Avail_GPUS()
        Try
            Dim HardwareMonitorMSIAft = New HardwareMonitor
            Form1.gpus_found = HardwareMonitorMSIAft.GpuEntries.Count
            HardwareMonitorMSIAft = Nothing
        Catch ex As Exception
            Form1.gpus_found = 0
        End Try
    End Sub
The exception happens when I'm trying to "Dim HardwareMonitorMSIAft..." on step 6. Firstly, I thought that by using a "HardwareMonitorMSIAft=nothing" on "Catch" will be fine, but the scope of the HardwareMonitorMSIAft wont get inside "Catch". Then, I've tried with a global HardwareMonitorMSIAft to overcome the scope problem, but then the exception happens if my application starts and MSIAfterburner is not running.

Is there a more "handled" and "crash-free" approach to check if MSIAfterburner is running or not? Because the declaration "Dim HardwareMonitorMSIAft = New HardwareMonitor" is trying to connect also, if I'm getting it correctly.

Thanks in advance.
   
Reply With Quote
Old
  (#40)
stangowner
Master Guru
 
stangowner's Avatar
 
Videocard: 2xMSI N550GTX-Ti Cy II OC
Processor: Intel Core i7-3960X
Mainboard: MSI X79A-GD45
Memory: 16GB Corsair Vengence
Soundcard: X-Fi Plat Fatal1ty Champ
PSU: Antec 850w
Default 01-23-2013, 11:08 | posts: 586 | Location: MA

Quote:
Originally Posted by timiman View Post
I'm having a scenario in which I came along using the .dll .

1.MSI Afterburner is already running.
2.My application (.net vb) starts.
-Recognizes all data from .dll and can get values
3.MSI Afterburner closes.
4.Try to retrieve again from the .dll the MSIAfterburner data, and gets nothing.
5.Re-open MSIAfterburner
6.Try to retrieve again from the .dll and I get a message of "Connected to a shared memory that is flagged dead".
Hi Timiman,

There is a Disconnect() method which releases the handle to shared memory. Try calling that before you set the HardwareMonitorMSIAft object to nothing. I think the handle to shared memory is being left open when you set the HardwareMonitorMSIAft object to nothing. You don't need to call Connect(), because the constructor already calls that and populates the classes.

I think the root issue is I don't have the proper destructor for that class in place. The destructor should release the file handle if it is still valid, so you don't have to call Disconnect() explicitly. I'll look at updating that.

Concerning the question on the trapping the error, can't you just define your variable outside the try block, but not initialize it until you are in the block?
Code:
Dim HardwareMonitorMSIAft
Try
    HardwareMonitorMSIAft = New HardwareMonitor
    ...
Catch ex As Exception
    ...
End Try
I raise errors if the class initialization can not connect to Afterburner's shared memory, so you should be able to catch those and take appropriate action. This includes when Afterburner is not running.

Thanks,
Nick
   
Reply With Quote
Old
  (#41)
stangowner
Master Guru
 
stangowner's Avatar
 
Videocard: 2xMSI N550GTX-Ti Cy II OC
Processor: Intel Core i7-3960X
Mainboard: MSI X79A-GD45
Memory: 16GB Corsair Vengence
Soundcard: X-Fi Plat Fatal1ty Champ
PSU: Antec 850w
Default 01-23-2013, 11:16 | posts: 586 | Location: MA

Quote:
Originally Posted by danielkza View Post
Now for my own issue: I just recently changed from an MSI GTX 570 to an MSI NGTX680 Lightning, and I cannot get an accurate memory amount through the .NET API. I always get a value of 0.
Yes, I receive 0 too. I think Afterburner only returns that value for some cards. I have a pair of 550Ti s and they return 0 too. If memory serves.....I think it should show in information dialog in Afterburner. If its missing there, then you'll get 0 from this API too.

Using C# code that dumps the complete .net class:
Code:
***** MSI AFTERBURNER GPU 0 *****
GpuId = VEN_10DE&DEV_1244&SUBSYS_26101462&REV_A1&BUS_2&DEV_0&FN_0
Family = GF116
Device = GeForce GTX 550 Ti
Driver = 306.97
BIOS = 70.26.18.00.00
MemAmount = 0

***** MSI AFTERBURNER GPU 1 *****
GpuId = VEN_10DE&DEV_1244&SUBSYS_26101462&REV_A1&BUS_3&DEV_0&FN_0
Family = GF116
Device = GeForce GTX 550 Ti
Driver = 306.97
BIOS = 70.26.18.00.00
MemAmount = 0
And using your .ps1 code:
Code:
MSI Afterburner (API version 2.0)
GPU #1
  Device: GeForce GTX 550 Ti
  Driver Version: 306.97
  Memory: 0
GPU #2
  Device: GeForce GTX 550 Ti
  Driver Version: 306.97
  Memory: 0
- Nick
   
Reply With Quote
Old
  (#42)
timiman
Newbie
 
Videocard: 2xR9-290 Asus DCU-II
Processor: AMD FX-8320@4.1GHz
Mainboard: Asus M5A99X EVO R2.0
Memory: 16GB/DDR3-1866
Soundcard:
PSU: Corsair 1KW
Default 01-23-2013, 12:00 | posts: 37 | Location: Greece

Quote:
Originally Posted by stangowner View Post
Hi Timiman,

There is a Disconnect() method which releases the handle to shared memory. Try calling that before you set the HardwareMonitorMSIAft object to nothing. I think the handle to shared memory is being left open when you set the HardwareMonitorMSIAft object to nothing. You don't need to call Connect(), because the constructor already calls that and populates the classes.
No luck here. I've just tried that and I'm still getting the "dead shared memory" message. I also removed the "=nothing" and got the same results.

Quote:
Originally Posted by stangowner View Post
Concerning the question on the trapping the error, can't you just define your variable outside the try block, but not initialize it until you are in the block?
Code:
Dim HardwareMonitorMSIAft
Try
    HardwareMonitorMSIAft = New HardwareMonitor
    ...
Catch ex As Exception
    ...
End Try
I raise errors if the class initialization can not connect to Afterburner's shared memory, so you should be able to catch those and take appropriate action. This includes when Afterburner is not running.
I forgot to mention this in my post. I have an issue about the "HardwareMonitorMSIAft" because originally it is declared as object, if no datatype is set there. When I'm using "HardwareMonitorMSIAft = New HardwareMonitor" and then get the "HardwareMonitorMSIAft.GpuEntries.Count" I get no values at all. This one has to do with bad automated casting from Object to HardwareMonitor, i think. So, I left this solution out from "day 1".
   
Reply With Quote
Old
  (#43)
stangowner
Master Guru
 
stangowner's Avatar
 
Videocard: 2xMSI N550GTX-Ti Cy II OC
Processor: Intel Core i7-3960X
Mainboard: MSI X79A-GD45
Memory: 16GB Corsair Vengence
Soundcard: X-Fi Plat Fatal1ty Champ
PSU: Antec 850w
Default 01-23-2013, 14:20 | posts: 586 | Location: MA

Quote:
Originally Posted by timiman View Post
No luck here. I've just tried that and I'm still getting the "dead shared memory" message. I also removed the "=nothing" and got the same results.
OK, I'll try to look into it further in the next few days.

Quote:
Originally Posted by timiman View Post
I forgot to mention this in my post. I have an issue about the "HardwareMonitorMSIAft" because originally it is declared as object, if no datatype is set there. When I'm using "HardwareMonitorMSIAft = New HardwareMonitor" and then get the "HardwareMonitorMSIAft.GpuEntries.Count" I get no values at all. This one has to do with bad automated casting from Object to HardwareMonitor, i think. So, I left this solution out from "day 1".
Even if you Dim As? Sorry, I haven't really used VB since VB6.
Code:
Dim HardwareMonitorMSIAft As HardwareMonitor
   
Reply With Quote
Old
  (#44)
timiman
Newbie
 
Videocard: 2xR9-290 Asus DCU-II
Processor: AMD FX-8320@4.1GHz
Mainboard: Asus M5A99X EVO R2.0
Memory: 16GB/DDR3-1866
Soundcard:
PSU: Corsair 1KW
Default 01-23-2013, 16:52 | posts: 37 | Location: Greece

Quote:
Originally Posted by stangowner View Post
OK, I'll try to look into it further in the next few days.
OK. Thanks. I'm available if you want any help about tests etc.

Quote:
Originally Posted by stangowner View Post
Even if you Dim As? Sorry, I haven't really used VB since VB6.
Code:
Dim HardwareMonitorMSIAft As HardwareMonitor
If I use the "Dim HardwareMonitorMSIAft As HardwareMonitor" with MSI Afterburner closed, I get the exception of "MSI Afterburnrer is not running" without been able to handle it. That's why I'm using the Try..Catch.
Just an idea, I will try to use an "AddHandler" on HardwareMonitorMSIAft when I get home and see if this will help at all.
   
Reply With Quote
Old
  (#45)
danielkza
Newbie
 
Videocard: Shappire HD4830
Processor: Core 2 Duo E7300
Mainboard: MSI P45 Neo-F
Memory: 2x2GB DDR2-960
Soundcard: Realtek ALC888
PSU: Corsair VX550W
Default 01-24-2013, 05:47 | posts: 7 | Location: São Paulo, Brazil

@stangowner

Thanks for the confirmation. I resorted to going through the video controllers in WMI and matching them with the device IDs provided by Afterburner. I don't have a setup with two identical cards to confirm it works, but it should if all my assumptions were right.


$abMonitor is an instance of HardwareMonitor, and $abControl is an instance of ControlMemory. The final result is an array of memory sizes in MB where the indexes correspond to the Afterburn GPU indexes.


Code:
Function Get-WmiGPUMem($abMonitor)
{
    $gpuEntries = $abMonitor.GpuEntries
    $gpuMemories = @(0) * $gpuEntries.Length
  
    $videoControllers = Get-WmiObject "Win32_VideoController"

    # Look through the video controllers, convert their device IDs to a format comparable to Afterburner's,
    # then select the one that matches the selected GPU

    foreach($vc in $videoControllers)
    {
        $driver = Get-WmiObject "Win32_PnPSignedDriver" | ? {$_.DeviceID -eq $vc.PNPDeviceID}
        if($driver.Location -match 'PCI Bus (?<bus>\d+), device (?<device>\d+), function (?<function>\d+)')
        {
            $bus = $Matches['bus']
            $dev = $Matches['device']
            $fn = $Matches['function']

            if($vc.PNPDeviceID -match 'PCI\\([^\\]+)')
            {
                $abDevID = $Matches[1] + ('&BUS_{0}&DEV_{1}&FN_{2}' -f $bus,$dev,$fn)

                for($i=0; $i -lt $gpuEntries.Length; $i++)
                {
                    if($gpuMemories[$i] -ne 0)
                    {
                        continue
                    }

                    if($abDevID -eq $gpuEntries[$i].GpuID)
                    {
                        $gpuMemories[$i] = $vc.AdapterRAM / (1024 * 1024)
                        break
                    }
                }
            }
        }
    }

    return $gpuMemories
}

Function Get-GPUMem($abMonitor, $abControl)
{
    $gpuMemories = @(0) * $abMonitor.GpuEntries.Length
    $wmiGpuMemories = $null

    for($i=0; $i -lt $abMonitor.GpuEntries.Length; $i++)
    {
        $gpuMonitor = $abMonitor.GpuEntries[$i]
        $gpuControl = $abControl.GpuEntries[$i]

        if($gpuMonitor.MemAmount -gt 0) {
            $gpuMemories[$i] = $gpuMonitor.MemAmount / 1024
        } else {
            if($WmiGPUMemories -eq $null) {
                #Write-Warning "Failed to detect GPU RAM from Afterburner. Reverting to WMI method."
                $WmiGPUMemories = Get-WmiGPUMem $abMonitor.GpuEntries
            }

            $gpuMemories[$i] = $WmiGPUMemories[$i]
        }
    }

    return $gpuMemories
}
And if I'm not asking too much, I noticed you have two GTX 500 cards. Would you mind testing the full script? I only have one GTX 600 card, and I would like to know if everything works as expected before launching it 'officially'. The script is here, and the needed files are here. You also need the MSI.Afterburner.NET.dll obviously. (everything in the same folder)

The script has a bunch of options but you don't need to change any of them if you don't want, except -gpuIndex and possibly -testIterations (so you don't waste much of your time). By default the script will start with the default clocks and raise them 200Mhz at a time, and halves the step each time a test fails.

Thanks in advance.

Last edited by danielkza; 01-24-2013 at 06:04.
   
Reply With Quote
Old
  (#46)
stangowner
Master Guru
 
stangowner's Avatar
 
Videocard: 2xMSI N550GTX-Ti Cy II OC
Processor: Intel Core i7-3960X
Mainboard: MSI X79A-GD45
Memory: 16GB Corsair Vengence
Soundcard: X-Fi Plat Fatal1ty Champ
PSU: Antec 850w
Default 01-28-2013, 10:18 | posts: 586 | Location: MA

Quote:
Originally Posted by danielkza View Post
And if I'm not asking too much, I noticed you have two GTX 500 cards. Would you mind testing the full script? I only have one GTX 600 card, and I would like to know if everything works as expected before launching it 'officially'. The script is here, and the needed files are here. You also need the MSI.Afterburner.NET.dll obviously. (everything in the same folder)

The script has a bunch of options but you don't need to change any of them if you don't want, except -gpuIndex and possibly -testIterations (so you don't waste much of your time). By default the script will start with the default clocks and raise them 200Mhz at a time, and halves the step each time a test fails.

Thanks in advance.
Hi,

I've started this twice, once with some parameters and once without. The results are
Code:
PS E:\temp\powershell> .\MemTestG80_AutoOC.ps1
GPU #0
  Device: GeForce GTX 550 Ti
  Driver: 306.97
  Memory Clock (default): 2150MhzMhz
  Memory Clock (current): 2150MhzMhz
  Memory Size: 1023.6875MB
GPU #1
  Device: GeForce GTX 550 Ti
  Driver: 306.97
  Memory Clock (default): 2150MhzMhz
  Memory Clock (current): 2150MhzMhz
  Memory Size: 1023.6875MB
False
Trying 2350Mhz with 1023.6875MB and 50 iterations: SUCCESS
Trying 2550Mhz with 1023.6875MB and 50 iterations: SUCCESS
Trying 2750Mhz with 1023.6875MB and 50 iterations: SUCCESS
Trying 2950Mhz with 1023.6875MB and 50 iterations: clock_too_high
SUCCESS
Trying 3150Mhz with 1023.6875MB and 50 iterations: clock_too_high
SUCCESS
Trying 3350Mhz with 1023.6875MB and 50 iterations: clock_too_high
SUCCESS
Trying 3550Mhz with 1023.6875MB and 50 iterations: clock_too_high
SUCCESS
......
Trying 50550Mhz with 1023.6875MB and 50 iterations: clock_too_high
SUCCESS
Trying 50750Mhz with 1023.6875MB and 50 iterations: clock_too_high
SUCCESS
Trying 50950Mhz with 1023.6875MB and 50 iterations: clock_too_high
SUCCESS
Trying 51150Mhz with 1023.6875MB and 50 iterations: clock_too_high
SUCCESS
Trying 51350Mhz with 1023.6875MB and 50 iterations: clock_too_high
SUCCESS
Trying 51550Mhz with 1023.6875MB and 50 iterations: clock_too_high
PS E:\temp\powershell>
In both instances, I pressed CtrlC to stop it. I have no idea why the clock keeps climbing 200 Mhz each test....I was under the assumption it was going to climb 200, 200, 200, fail, -100, 50, 25, fail, -12, etc until it found the most stable frequency. Am I not understanding this properly?

Also, Afterburner said an external profile was applied when I started the script, but I did not notice any changes. And it only said it once. Just so you are aware, when applying changes via the API, it takes one second for the changes to be applied, but the script processes the iterations faster then that.

Let me know your thoughts. I'll test it for you again if you want.
- Nick
   
Reply With Quote
Old
  (#47)
danielkza
Newbie
 
Videocard: Shappire HD4830
Processor: Core 2 Duo E7300
Mainboard: MSI P45 Neo-F
Memory: 2x2GB DDR2-960
Soundcard: Realtek ALC888
PSU: Corsair VX550W
Default 02-05-2013, 21:24 | posts: 7 | Location: São Paulo, Brazil

@stangowner:

You got it right, it was supposed to go up 200 MHz and then slowly back out on failure, but I've seem to have not tested my logic enough. Thanks very much for your help, I'll work on it a bit more. At least I know it's not blowing up completely with two GPUs, it's already a start!
   
Reply With Quote
Old
  (#48)
stangowner
Master Guru
 
stangowner's Avatar
 
Videocard: 2xMSI N550GTX-Ti Cy II OC
Processor: Intel Core i7-3960X
Mainboard: MSI X79A-GD45
Memory: 16GB Corsair Vengence
Soundcard: X-Fi Plat Fatal1ty Champ
PSU: Antec 850w
Default 02-13-2013, 11:16 | posts: 586 | Location: MA

Quote:
Originally Posted by timiman View Post
No luck here. I've just tried that and I'm still getting the "dead shared memory" message. I also removed the "=nothing" and got the same results.
Timiman, mind doing me a favor? I've been trying to track down this handle to dead memory issue. I think I may have found the problem.

I created a simple app using your snippet as a base to reproduce the problem. Fortunately I can reproduce it quite easily.
Code:
Imports System.Threading
Imports MSI.Afterburner

Module Module1

    Sub Main()
        Dim i As Integer

        While i < 40
            Try
                Dim mahm = New HardwareMonitor
                Console.Write(mahm)
                mahm.Disconnect()
                mahm = Nothing
            Catch ex As Exception
                Console.WriteLine(ex.Message)
            End Try
            i = i + 1
            Thread.Sleep(800)
        End While

    End Sub

End Module
However, after stepping through the code several times and even trying several things, I could not for the life of me figure out why it was happening. So thinking it may be a garbage collection issue, I changed the sleep timer in the loop. Sure enough, anything under 1000-1500ms can cause the issue, meanwhile anything over 1500ms does not. Simply increasing that makes the issue go away.

So my question to you is can you insert an artificial delay of 2 seconds into your application whenever you are disconnecting/disposing one of these objects? Please let me know if this solves it for you too.

I have placed a GC.Collect() in the end of the Disconnect() method the HardwareMonitor class. This forces the garbage collector to run, and seems to resolve the issue. I can now run my test code in a loop at 100 ms, or even comment out the delay and let it run full speed, and I no longer see the issue. I can update the classes with this change once you confirm and I do more testing.

Thanks,
Nick
   
Reply With Quote
Old
  (#49)
timiman
Newbie
 
Videocard: 2xR9-290 Asus DCU-II
Processor: AMD FX-8320@4.1GHz
Mainboard: Asus M5A99X EVO R2.0
Memory: 16GB/DDR3-1866
Soundcard:
PSU: Corsair 1KW
Default 02-15-2013, 10:38 | posts: 37 | Location: Greece

stangowner,

I've added a 2000ms delay (even 4000ms) on my application and the problem remains as it was.
On the other hand your snippet works without any message of "dead shared memory" at all.

Maybe my logic of the sensors reading needs some changes, too.
For example, the init of the available sensors runs every second. (during the test above, this timer was set to 10000ms).
Also, every second I call a GC.Collect() to clear memory, too,
knowing that the GC.Collect() is not always really fired, but "pushed" to be fired sooner.

To get more realistic results with your idea, it won't be a bad idea to send me a test version of your .dll. If it is OK with you, of course.
   
Reply With Quote
Old
  (#50)
stangowner
Master Guru
 
stangowner's Avatar
 
Videocard: 2xMSI N550GTX-Ti Cy II OC
Processor: Intel Core i7-3960X
Mainboard: MSI X79A-GD45
Memory: 16GB Corsair Vengence
Soundcard: X-Fi Plat Fatal1ty Champ
PSU: Antec 850w
Default 02-15-2013, 10:52 | posts: 586 | Location: MA

Sure, just let me just update the ControlMemory class too, test it, and then I'll send you link to download.

Thanks for testing with me.
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com
Copyright (c) 1995-2014, All Rights Reserved. The Guru of 3D, the Hardware Guru, and 3D Guru are trademarks owned by Hilbert Hagedoorn.