mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Software (https://www.mersenneforum.org/forumdisplay.php?f=10)
-   -   MfaktX Controller (Windows) (https://www.mersenneforum.org/showthread.php?t=18088)

Mini-Geek 2013-04-13 20:36

MfaktX Controller (Windows)
 
This is an app inspired by the [URL="http://www.mersenneforum.org/showthread.php?t=17873"]MFAKTx speed menu batch file[/URL]. It is a .Net 4.5 app that lets you choose the speed of mfaktx (slow/medium/fast) and start/stop it through a UI. Like the batch file, it requires you to set up slow/medium/fast .ini files, and it copies that into the real .ini file location. When you start it, it automatically begins at the Fast speed. A text area shows the output from mfaktx. It optionally detects when you're not using your PC by watching for the screen saver. A short time (checks every 15 seconds) after the screen saver comes on, it switches to Fast, and a short time after it goes away, it switches to Medium.

It's only been tested on my computer with mfaktc. I don't know enough about mfakto to tell you it will or won't work, but judging by the simplicity of the mfaktx speed menu batch file, I'm hopeful that it will. I'd expect everything except the idle detection to work on other platforms using Mono: the idle detection uses Windows APIs to check on the screensaver.

I'd recommend that you set the CheckpointDelay in your .ini's to 0 (immediate updates), since the controller will immediately close mfaktx instead of trying to close it nicely (I tried to do that, but it added a lot of complexity and didn't work well; Windows is surprisingly bad at the seemingly-simple task of programmatically nicely killing another process, and knowing when that's done). The speed gains you can get by having mfaktx run at its fastest speed when possible can easily outweigh the small losses of this partial work being lost.

Source and binaries are available at [url]https://github.com/Mini-Geek/mfaktx-controller[/url]

Mini-Geek 2013-04-13 21:11

1 Attachment(s)
.

swl551 2013-04-13 22:02

You can use and redistribute my SendCtrlCode.exe to handle the CTRL-C signalling to execute a graceful shutdown. Grab it from inside the lastest misfit release.

Run it from the command line to see expected parameter list.

swl551 2013-04-13 22:11

[QUOTE=Mini-Geek;336992].[/QUOTE]

Nice job by the way. Xyzzy will go CRAZY with joy!

Mini-Geek 2013-04-14 00:42

[QUOTE=swl551;336996]You can use and redistribute my SendCtrlCode.exe to handle the CTRL-C signalling to execute a graceful shutdown. Grab it from inside the lastest misfit release.

Run it from the command line to see expected parameter list.[/QUOTE]
Thanks. I had looked at that (and a similar program) earlier on, but I was on the wrong track and spun my wheels for a while - I don't need to keep track of when SendCtrlCode.exe closes, but when mfaktc.exe closes. :doh!: I've made use of that now, and added some other minor features. My recommendation of putting CheckpointDelay at 0 no longer stands. I've put the client build out on github:
[url]https://github.com/Mini-Geek/mfaktx-controller/blob/master/MfaktXController-win.zip[/url]
Since I'm past the time that I can edit my post, if any mods are reading this, I'd like if the zip I attached in the first post could be removed and the last line changed to: "Source and binaries are available at https://github.com/Mini-Geek/mfaktx-controller"
[QUOTE=swl551;336997]Nice job by the way. Xyzzy will go CRAZY with joy![/QUOTE]
Thanks. I hope more than myself will find a use for it. It seems like it's taken way more work than it's worth.

swl551 2013-04-14 11:40

[CODE]

[FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]bool[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] processStop()
{
[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000]//call must wrap this call in try/catch
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]bool[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] SentStopSignalOK = [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]false[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2];
[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] counter = 0;
[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]foreach[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] ([/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] pname [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]in[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] globals.cfg.settingStopProcessList) //list of process names found in your INI file
{
[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]Process[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][] processList = [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]Process[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].GetProcessesByName(pname);
[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] (processList.Length > 0)
{
[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]foreach[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] ([/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]Process[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] P [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]in[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] processList)
{
[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]ProcessStartInfo[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] Pinfo = [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]ProcessStartInfo[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]([/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]Globals[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].APP_CTRLC_SIGNAL, P.Id.ToString() + [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515]" 0"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]);
Pinfo.WindowStyle = [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]ProcessWindowStyle[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].Minimized;
[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]Process[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].Start(Pinfo);
counter++;
System.Threading.[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]Thread[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].Sleep(20);
}
}

}
[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] (counter > 0)
SentStopSignalOK = [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2];
[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]else
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]SentStopSignalOK = [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]false[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2];
[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]return[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] SentStopSignalOK;
}
[/SIZE][/FONT][/SIZE][/FONT]
[/CODE]

Xyzzy 2013-04-14 16:19

A very awesome program!

We did not notice any documentation but editing the XML file seems to explain everything.

We had to download the .Net 4.5 stuff but it prompted us to do this automatically.

By default it starts on the fast setting. Having a choice which speed to start with would be very cool.

We do not understand how to use the scroll buffer. If we scroll up the next update scrolls it back down. (How many lines can we reasonably buffer? 10,000? 100,000?)

We are unable to (using two separate directories) run two instances for two different video cards. Are we missing something?

Thanks a bunch!

:tu:

Xyzzy 2013-04-14 16:39

[QUOTE]We are unable to (using two separate directories) run two instances for two different video cards. Are we missing something?[/QUOTE]We renamed the mfaktc binary to different names and now both run!

:tu:

(We are tempted to try to get everything to run from one directory but it works right now, and we are lazy. Perhaps some rainy day we will revisit that.)

:smile:

swl551 2013-04-14 18:12

[QUOTE=Xyzzy;337064]We renamed the mfaktc binary to different names and now both run!

:tu:

(We are tempted to try to get everything to run from one directory but it works right now, and we are lazy. Perhaps some rainy day we will revisit that.)

:smile:[/QUOTE]
Just rememeber MISFIT does not support multiple MFAKTx installations in the same directory.

Mini-Geek 2013-04-14 19:36

[QUOTE=Xyzzy;337062]A very awesome program![/QUOTE]
Thank you. :smile:
[QUOTE=Xyzzy;337062]By default it starts on the fast setting. Having a choice which speed to start with would be very cool.[/QUOTE]
I can add that. The thought had crossed my mind, but I wasn't sure if it'd be used so I hadn't done it yet.
[QUOTE=Xyzzy;337062]We do not understand how to use the scroll buffer. If we scroll up the next update scrolls it back down. (How many lines can we reasonably buffer? 10,000? 100,000?)[/QUOTE]
Hm...maybe it should only automatically scroll down again if it was scrolled to the bottom when the new line came in. I'll see if I can improve this. I had based it off of the Windows command window, which does a similar thing.

The more lines you have, the more memory/CPU it'll take, and the harder it'll be to use the scroll bar (since it's scrolling through so much). I picked 300 as the default simply because that's what I had my mfaktc command window set at. I don't see any problem with 100,000 lines - it might take around 32 MB of memory extra (100,000 lines x 80 chars per line x 2 bytes per char x 2 places it's stored) and a similarly small amount (i.e. somewhere between trivial and large, in my opinion) of CPU. If you notice the updates being slow or the app hogging memory with it set like that, let me know and I'll see if I can make improvements.
[QUOTE=Xyzzy;337062]We are unable to (using two separate directories) run two instances for two different video cards. Are we missing something?

:tu:
...
We renamed the mfaktc binary to different names and now both run!

:tu:[/QUOTE]
There is a MaxInstances that should be set to 2 (or higher) in both config files (Edit: there's also MfaktXArguments where you should put your -d x mfaktc argument to specify the device). If that's already set correctly, could you tell me what doesn't work? I've only got one CUDA-capable GPU, so I haven't tested that.

Could you remove the attachment from the first post? I'd prefer it being somewhere I can update it (github). Also please change the last line to:
Source and binaries are available at [url]https://github.com/Mini-Geek/mfaktx-controller[/url]

Xyzzy 2013-04-14 22:16

[QUOTE]There is a MaxInstances that should be set to 2 (or higher) in both config files (Edit: there's also MfaktXArguments where you should put your -d x mfaktc argument to specify the device). If that's already set correctly, could you tell me what doesn't work? I've only got one CUDA-capable GPU, so I haven't tested that.[/quote]We overlooked "MfaktXArguments" but now we can see how it should work.

However, we are going to continue to use separate binary names because it works and because if we accidentally started a second instance in the same directory the safeguard will save us from ourselves.

[quote]Could you remove the attachment from the first post? I'd prefer it being somewhere I can update it (github). Also please change the last line to:
Source and binaries are available at [url]https://github.com/Mini-Geek/mfaktx-controller[/url][/QUOTE]Done.

FWIW, we have tested the screensaver option with both the DPMS screensaver (in the "Power Options" control panel) and with the "blank" screensaver (in the "Personalization" control panel) and neither worked.

We are using Windows 7, if that helps.

Finally, since you can detect that an instance is running, is it safe to assume that you can detect other things running? If you can, could you implement a "PauseWhileRunning" option?

It never hurts to ask!

:smile:

[SIZE="1"][B]Christmas List:[/B]
Option to start at a particular speed.
Option for "PauseWhileRunning".
Option to show which GPU is being used in the window and/or title bar.
Option to specify a font for the console output.[/SIZE]

Mini-Geek 2013-04-14 23:49

[QUOTE=Mini-Geek;337087]I can add that. The thought had crossed my mind, but I wasn't sure if it'd be used so I hadn't done it yet.

Hm...maybe it should only automatically scroll down again if it was scrolled to the bottom when the new line came in. I'll see if I can improve this. I had based it off of the Windows command window, which does a similar thing.[/QUOTE]
These are added. The scrolling can still be a bit wonky, but it's much improved. If you want to scroll around, select and copy text, etc. and avoid all weird behavior, check the Select Mode box.
[QUOTE=Xyzzy;337104]FWIW, we have tested the screensaver option with both the DPMS screensaver (in the "Power Options" control panel) and with the "blank" screensaver (in the "Personalization" control panel) and neither worked.

We are using Windows 7, if that helps.[/QUOTE]
That sounds exactly like my setup, but it works for me. I've made tweaks to that process recently (most recently in the build where I added the startup speed option), and I know I fixed a bug where it would go back to Medium when it switches from the Blank screensaver to the DPMS "screensaver" (screen off). If you were using an older build, upgrade and let me know if anything changes.

[QUOTE=Xyzzy;337104]Finally, since you can detect that an instance is running, is it safe to assume that you can detect other things running? If you can, could you implement a "PauseWhileRunning" option?

It never hurts to ask!

:smile:[/QUOTE]
Seems like I should be able to. I'll let you know when it's done, or I've decided it's unfeasible (for now). :smile:
[QUOTE=Xyzzy;337104][SIZE="1"][B]Christmas List:[/B]
Option to start at a particular speed.
Option for "PauseWhileRunning".
Option to show which GPU is being used in the window and/or title bar.
Option to specify a font for the console output.[/SIZE][/QUOTE]
The startup speed option has been added.

For the third, What exactly were you thinking would be shown? E.g. "GTX 560" (GPU model), "0" (the device number), something else? A simple way to implement this would be to add an option to set a string that I'll show in the app, so you could call them anything you like and I don't have to worry about determining what makes sense.
Would anyone running multiple instances always specify the device number with -d? I'm not sure how you were able to get it to work in two directories before you noticed the arguments option. :confused: I could look for the -d x option in the arguments and show that device number.

There's also now a font option.

Mini-Geek 2013-04-15 00:18

[QUOTE=Mini-Geek;337109]Seems like I should be able to. I'll let you know when it's done, or I've decided it's unfeasible (for now). :smile:[/QUOTE]

PauseWhileRunning has been added. Let me know how you like it. :smile:

Xyzzy 2013-04-15 00:47

Update:

We are using the original build and the screensaver part works. We perhaps did not give it enough time before. When we resumed working on the computer and looked at the screen buffer it showed the program switched from fast to medium.

:smile:

As for the card description, a variable that the user can specify will be fine. We just need a way to be able to tell which window is which card.

We will download the newest version to try all the cool stuff!

Thanks for the awesome work!

:tu:

Xyzzy 2013-04-15 00:57

[QUOTE]I'm not sure how you were able to get it to work in two directories before you noticed the arguments option. :confused:[/QUOTE]R. Heinlein once said, "Never underestimate the power of human stupidity."

:smile:

Mini-Geek 2013-04-15 01:17

[QUOTE=Xyzzy;337112]Update:

We are using the original build and the screensaver part works. We perhaps did not give it enough time before. When we resumed working on the computer and looked at the screen buffer it showed the program switched from fast to medium.

:smile:[/QUOTE]
Ok, good. It should have started switching within half a second, (at default settings) but it does switch so fast that it can be easy enough to not notice what's really going on without looking closely. Especially with scrolling issues possibly making you look at the wrong spot. Anyway, if you have more problems, try to let me know the circumstances (e.g. what combo of screensaver/powersaving do you have enabled, and what was active at the time).
[QUOTE=Xyzzy;337112]As for the card description, a variable that the user can specify will be fine. We just need a way to be able to tell which window is which card.[/QUOTE]
Ok, I've added that.
[QUOTE=Xyzzy;337112]We will download the newest version to try all the cool stuff!

Thanks for the awesome work!

:tu:[/QUOTE]
You're welcome. :smile:

Xyzzy 2013-04-15 14:33

1 Attachment(s)
Latest report:

The screensaver definitely works now, and very quickly. (Is there a lot of overhead to poll every half second?)

The option to stop the screen buffer to view the output works perfectly. We set ours to 10,000 lines and so far there is no problem. Being able to scroll back is just awesome.

The user-specified string to identify cards works well. If we had the option to tweak the window title name to just say the string and the speed then we would be able to tell the status of the cards from the task bar. Right now the program name takes up a little more than half of the button so we can see the user string if we keep it short. But, this is really not that important.

Since "PauseWhileRunning" works, would a "SlowWhileRunning" option be viable?

:bow:

Mini-Geek 2013-04-15 14:47

[QUOTE=Xyzzy;337180]The screensaver definitely works now, and very quickly. (Is there a lot of overhead to poll every half second?)[/QUOTE]
AFAIK there is not. Early in development I had accidentally set the interval at 3 milliseconds, and the app still used no noticeable resources (0% CPU time, totally responsive). I've since added a second call that's done each time (to check if the DPMS screensaver is off), so it might have more overhead than it did at that time, but hopefully not much worse.
[QUOTE=Xyzzy;337180]The user-specified string to identify cards works well. If we had the option to tweak the window title name to just say the string and the speed then we would be able to tell the status of the cards from the task bar. Right now the program name takes up a little more than half of the button so we can see the user string if we keep it short. But, this is really not that important.[/QUOTE]
I'll move the "MfaktX Controller" part to the end (like every other program does...apparently I should look for conventions like that :doh!:). I'll try to see whether the instance id before or after the status would work better.
[QUOTE=Xyzzy;337180]Since "PauseWhileRunning" works, would a "SlowWhileRunning" option be viable?[/QUOTE]
I knew that was coming. :smile: Shouldn't be too hard.

I'll be getting to these tonight, most likely.

Mini-Geek 2013-04-16 00:25

[QUOTE=Mini-Geek;337181]AFAIK there is not. Early in development I had accidentally set the interval at 3 milliseconds, and the app still used no noticeable resources (0% CPU time, totally responsive). I've since added a second call that's done each time (to check if the DPMS screensaver is off), so it might have more overhead than it did at that time, but hopefully not much worse.[/QUOTE]
Still not noticeable, even at 1 ms. :tu:
From running some simple speed tests, the idle check can run around 1.3 million times in a second - so even at 1 ms, it's nothing. The pause/slow check, however, can run about 800 times per second. Still insignificant at 500 ms intervals, but enough that I've decided that should have a configurable interval (and the other doesn't really need it).
[QUOTE=Mini-Geek;337181]I'll move the "MfaktX Controller" part to the end (like every other program does...apparently I should look for conventions like that :doh!:). I'll try to see whether the instance id before or after the status would work better.

I knew that was coming. :smile: Shouldn't be too hard.

I'll be getting to these tonight, most likely.[/QUOTE]

I've made these changes.

Xyzzy 2013-04-16 16:32

:bow:

Xyzzy 2013-04-16 18:02

We just tested the new version. It works perfectly.

With three profiles we are able to let our primary GPU run all of the time.

Fast = Screensaver on. (GPUSieveSize=128/GPUSieveProcessSize=8)
Medium = Normal computer usage, with no lag, ever. (GPUSieveSize=32/GPUSieveProcessSize=8)
Slow = Gaming at 60FPS with vertical sync on. (GPUSieveSize=4/GPUSieveProcessSize=8)

The taskbar title reordering is perfect as well.

:smile:

kracker 2013-04-16 18:07

Looks interesting. Will have to try it out later :smile:

Mini-Geek 2013-05-05 19:34

I fixed a [URL="https://github.com/Mini-Geek/mfaktx-controller/issues/9"]bug[/URL] and released a new version. As always, available at [url]https://github.com/Mini-Geek/mfaktx-controller[/url]

Xyzzy 2013-05-05 21:00

We have had your program go AFK but we have not mentioned it yet.

One instance is set to never change speed. It runs fine.

One instance is set to change speeds based on both conditionals and it changes speeds all of the time, for DPMS, gaming and general browsing. This instance, after a few days (Or cycles?) will get stuck on a speed and will not allow us to stop it or change the speed. (We kill it in the task manager.)

It only happens after several days so we are okay with rebooting occasionally.

The program still rocks and is the only way we can use the computer and do GPU work the way we want to.

:bow:

Mini-Geek 2013-05-06 01:03

[QUOTE=Xyzzy;339362]One instance is set to change speeds based on both conditionals and it changes speeds all of the time, for DPMS, gaming and general browsing. This instance, after a few days (Or cycles?) will get stuck on a speed and will not allow us to stop it or change the speed. (We kill it in the task manager.)

It only happens after several days so we are okay with rebooting occasionally.[/QUOTE]

Hm, I've never seen this behavior. When it's stuck, how does the instance look (a screenshot would be good)? If you try to press the buttons (including the X to close), what happens? Does it still update the output log text? Are you using separate mfaktc exe names with a MaxInstances value of 1 on each?

Xyzzy 2013-05-06 02:51

[QUOTE]When it's stuck, how does the instance look (a screenshot would be good)?[/quote]We will get a screen shot the next time it happens.

[quote]If you try to press the buttons (including the X to close), what happens?[/quote]Sometimes the buttons do not respond and sometimes it throws up an error about the max number of instances. If the "X" in the window corner closes the controller, the card continues to run and we have to kill the actual executable. (In our case, "0.exe".)

[quote]Does it still update the output log text?[/quote]Yes.

[quote]Are you using separate mfaktc exe names with a MaxInstances value of 1 on each?[/QUOTE]Yes.

:bow:

Mini-Geek 2013-05-06 17:15

When it's frozen, if you kill your mfaktc instance (0.exe) with the task manager, does the controller recover? (When running normally, it handles it well: the status changes to "Stopped" and you can start it again manually.)

Do you know what it was doing when it freezes? E.g. was it switching speeds, dealing with pause and/or slow while running apps running/opening/closing, running unattended, etc.? How much memory and CPU time does the controller use when it freezes, and how does that compare to the controller that always runs?

I don't really know what's up with this...a rather strange problem.

Xyzzy 2013-05-07 05:23

1 Attachment(s)
Here is a benign example. The Titan card is running at "Fast" even though we just came out of DPMS mode and it should be at "Medium". The display shows that no speed is selected, but the various buttons did respond when clicked.

Mini-Geek 2013-05-07 11:45

[QUOTE=Xyzzy;339524]Here is a benign example. The Titan card is running at "Fast" even though we just came out of DPMS mode and it should be at "Medium". The display shows that no speed is selected, but the various buttons did respond when clicked.[/QUOTE]

I'd noticed and (AFAIK) fixed, on Apr 19, the bug that makes it show "Running (Stopped)" as that screen shot shows. It's possible this is related to your freezing issue. Please update to the newest version (file's timestamp is on 5/5) and see if the problem is fixed.

Xyzzy 2013-05-07 23:22

Thanks!

:bow:

TObject 2013-05-11 02:06

Mini-Geek,

Looks like an excellent utility. Great job.

What is the [I]PropertyChanged[/I] namespace you are referencing in the [I]Controller.cs[/I], if you do not mind me asking?

If that is where you implement the [I]ImplementPropertyChanged[/I] attribute, that seems to be missing from the project on GitHub…

Thank you

Mini-Geek 2013-05-11 02:25

[QUOTE=TObject;340022]Mini-Geek,

Looks like an excellent utility. Great job.

What is the [I]PropertyChanged[/I] namespace you are referencing in the [I]Controller.cs[/I], if you do not mind me asking?

If that is where you implement the [I]ImplementPropertyChanged[/I] attribute, that seems to be missing from the project on GitHub…

Thank you[/QUOTE]

That comes from an external dependency, PropertyChanged.Fody. I had hoped it would automagically work, but apparently not. I've now added links on the readme at github: [url]https://github.com/Mini-Geek/mfaktx-controller[/url]

Xyzzy 2013-05-19 23:59

FWIW, the obscure errors we had with your program have stopped since we updated to the latest version.

:bow:

Mini-Geek 2013-05-20 00:00

[QUOTE=Xyzzy;340985]FWIW, the obscure errors we had with your program have stopped since we updated to the latest version.

:bow:[/QUOTE]

Excellent! :smile:

Mini-Geek 2013-07-27 17:26

1 Attachment(s)
I've added two new features today:
[LIST=1][*][B]Delay switching speed due to idle[/B]. Because I will sometimes accidentally let my screen saver become active when I'm at my computer - I move the mouse right away to cancel it, but the controller has already started swapping the speeds around. To prevent that annoying (though small) waste, it will wait for (default) 10 seconds after the screensaver comes on (or monitor goes off by power settings) before starting to switch to Slow. :smile:[*][B]In-UI modification of Pause/SlowWhileRunning[/B]. You know that comma-separated list in the config file that you have to restart the controller to modify? Now you can change it through the GUI, no restart required! You can type in new items yourself, or click Show List and it'll list your running processes, sorted by highest memory usage (by default), since I figured the sort of things you'd want to pause while running are typically high-memory usage processes (games, etc.). Look at the attached screenshot to see what I'm talking about.[/LIST]I could set up all of the config settings to be similarly modifiable thru the UI, but that'd be a good bit of extra work, and SlowWhileRunning is the only one that I've found myself modifying often. So unless there's demand for it, those will be the only ones you can modify through the UI.

Here are the client binaries: [URL="https://github.com/Mini-Geek/mfaktx-controller/blob/master/MfaktXController-win.zip?raw=true"]MfaktXController-win.zip[/URL]
Source available at [url]https://github.com/Mini-Geek/mfaktx-controller[/url]

Upgrade notes: "IdleDelayInterval" has been added to the config file. No other changes are necessary from the previous release's config file.

swl551 2013-07-28 14:42

Hospitality feature!
 
Mini,

Looks great, but I haven't used it... All my machines run dedicated.

Bummer the big guns won't release mfaktX with the [U]hospitality[/U] feature found in CudaLucas. If they did your implementation could become more specific on how GPU utilization is governed.

I'm still waiting for MFAKTC to implement file-locking. MFAKTO has had it for over a year now.

Someone once told me there were benefits to open source libraries and reusable code..... (not if it not taken advantage of!)

Anyway thanks for you efforts.

Scott

blahpy 2013-08-10 02:26

Hmm, Xyzzy linked me here earlier after I mentioned that I couldn't use my computer while running mfakto, but I'm having a bit of an issue...

With GPUSieveSize=64, GPU Utilization is 99%
With GPUSieveSize=32, GPU Utilization is 99%
With GPUSieveSize=16, GPU Utilization is 99%
With GPUSieveSize=8, GPU Utilization is 99%
Even with GPUSieveSize=4, GPU Utilization is still 99%

My GPU model is AMD Radeon HD 7650M

Mini-Geek 2013-08-10 02:35

[QUOTE=blahpy;348943]Hmm, Xyzzy linked me here earlier after I mentioned that I couldn't use my computer while running mfakto, but I'm having a bit of an issue...

With GPUSieveSize=64, GPU Utilization is 99%
With GPUSieveSize=32, GPU Utilization is 99%
With GPUSieveSize=16, GPU Utilization is 99%
With GPUSieveSize=8, GPU Utilization is 99%
Even with GPUSieveSize=4, GPU Utilization is still 99%

My GPU model is AMD Radeon HD 7650M[/QUOTE]

If you change the value manually, running without MfaktX Controller, do you see the same behavior or not? If it slows it down when you change it manually, the issue is with my tool. If not, maybe there's some other option that will make mfakto slow down or otherwise be more polite.

blahpy 2013-08-10 02:37

[QUOTE=Mini-Geek;348945]If you change the value manually, running without MfaktX Controller, do you see the same behavior or not? If it slows it down when you change it manually, the issue is with my tool. If not, maybe there's some other option that will make mfakto slow down or otherwise be more polite.[/QUOTE]

I did it manually, it's not your tool. I just thought your thread might be the best to offer advice.

kracker 2013-08-10 02:43

You have to change more than GPUSieveSize. if using gpu seiving, reduce almost everything.
GPUSievePrimes,GPUSieveSize,GPUSieveProcessSize.

blahpy 2013-08-10 02:48

[QUOTE=kracker;348947]You have to change more than GPUSieveSize. if using gpu seiving, reduce almost everything.
GPUSievePrimes,GPUSieveSize,GPUSieveProcessSize.[/QUOTE]

Okay. I tried setting all three to their minimum values. Still maximum GPU utilisation. Maybe I should just stick to running it at night

Mini-Geek 2013-09-10 01:15

I've added two new features to MfaktX Controller after beginning to use it with mmff (an mfaktc-based program):

1. For easier setup and configuration, [B]there is now a "Common" ini file option[/B]. How it works: typically, most of your settings stay the same with the different speeds, while you change 1 or 2 options. Now, instead of having to repeat the configuration in each (slow, med, fast) ini file, you put the parts that are always the same in an mfaktc.common.ini file, and only put the parts that change in the (slow, med, fast) ini files. When the MfaktX Controller runs, it will append the speed ini file to the common ini file to create the file that mfaktx actually uses.
2. There is now a [B]"Force Close Now" button[/B] available when Stopping. As you might expect, this kills the mfaktx process immediately. This can be especially useful when you are running mmff, where each class can take several minutes, because you can choose whether to change speeds immediately (by forcing it to close manually) or let it wait until the class is finished (with sufficient timeout in the config file). It could also be useful if the process has hung and you don't want to wait for the timeout.

Upgrade notes:
This config line:
[CODE] <add key="MfaktXIniFileName" value="mfaktc.ini" />[/CODE]
Has been replaced by:
[CODE] <!-- The selected speed's ini file is appended to the Common ini file to create the Target ini file, which is used by mfaktx. Using a Common ini file is optional, you can leave the field blank. -->
<add key="MfaktXTargetIniFileName" value="mfaktc.ini" />
<add key="MfaktXCommonIniFileName" value="mfaktc.common.ini" />[/CODE]
If you want to make use of the common.ini file, you'll have to move the bulk of your configuration to the common.ini file, and only leave the portions that are different in the slow, med, and fast ini files.

Here are the client binaries: [URL="https://github.com/Mini-Geek/mfaktx-controller/blob/master/MfaktXController-win.zip?raw=true"]MfaktXController-win.zip[/URL]
Source available at [url]https://github.com/Mini-Geek/mfaktx-controller[/url] (now licensed under LGPLv3; I realized that the CC license I put on there isn't suited for software, and I think the LGPL is fairly close to my intent)

TheMawn 2013-09-10 03:34

I've stopped using the speed controller. Instead, I have a mfaktc.med.ini and a mfaktc.fast.ini file and I just change them to mfaktc.ini depending on the speed I want.

For lightweight GPU usage like LoL or videos, I run med. For long stretches of not using the computer, I run fast. For heavier usage (I'm addicted to Skyrim. Again. :no:) I turn it off completely.

The reason I don't use the controller is whenever I change speed, it kills the mfaktc running on my other GPU. Is there a way to set to controller to only kill the one instance?

Mini-Geek 2013-09-10 11:41

[QUOTE=TheMawn;352557]The reason I don't use the controller is whenever I change speed, it kills the mfaktc running on my other GPU. Is there a way to set to controller to only kill the one instance?[/QUOTE]

It should only kill the one instance. I'll investigate this bug soon, and let you know what I figure out.

Mini-Geek 2013-09-10 23:17

[QUOTE=Mini-Geek;352595]It should only kill the one instance. I'll investigate this bug soon, and let you know what I figure out.[/QUOTE]

I haven't been able to reproduce it, and don't see how it could be happening.

The way I kill the process is by the PID (process ID), so it shouldn't be killing both just because the names are the same. I only have one CUDA-capable graphics card in my computer, so I'm testing this with a dummy program, not the real mfaktc, and I can't reproduce this issue. Can you provide more information, please, to help me track this bug down for you? Here are some of my thoughts of what might help me find this, or at least let you have a workaround:[LIST=1][*]Do both controllers' output logs show the 'received signal "SIGINT"...' message when you change speeds on one controller, or does the second controller show a different/no message?[*]Do you have two copies of the controller exe and config in separate directories, or are you trying to run it off of one copy?[*]Try naming your two mfaktc executables something different, and let me know if anything changes. (Xyzzy uses two controllers for his two mfaktc instances, which he gave different names and set "MaxInstances" to 1, and never reported having this issue. He uses different executable names.)[*]Can you confirm that the two mfaktc.exe processes run by the controllers have different PIDs? (in Task Manager, Processes tab, View > Select Columns you can enable the PID column)[*]If you run two mfaktc.exe instances manually, can you stop one via Ctrl+C without stopping both? Can you stop one with this command line, where 1234 is the PID of the one you want to stop (SendCtrlCode.exe is bundled with the controller)? "SendCtrlCode.exe 1234 0"[/LIST]

TheMawn 2013-09-11 04:35

You've got a bit more lingo in there than I care to try to figure out after thirteen and a half hours at school, but here's what I've got for you.

Ctrl+C closes only a single instance.

Both were named mfaktc.exe. I've changed the one running off my not-display GPU to mfaktc660ti.exe (and the path name in my batch file which forces it to run on the correct GPU). The speed controller now only closes the one instance.

I was not even using the controller on the 660Ti since I have no need to change its speed. The instance name was the same but of course it was in its own folder.

The process ID's are very different. At least, they are now.


Long story short it now works for me. If you want, I could rename the 660Ti instance back to mfaktc.exe and run through your list. Later.

Mini-Geek 2013-09-11 12:04

[QUOTE=TheMawn;352687]You've got a bit more lingo in there than I care to try to figure out after thirteen and a half hours at school, but here's what I've got for you.

Ctrl+C closes only a single instance.

Both were named mfaktc.exe. I've changed the one running off my not-display GPU to mfaktc660ti.exe (and the path name in my batch file which forces it to run on the correct GPU). The speed controller now only closes the one instance.

I was not even using the controller on the 660Ti since I have no need to change its speed. The instance name was the same but of course it was in its own folder.

The process ID's are very different. At least, they are now.


Long story short it now works for me. If you want, I could rename the 660Ti instance back to mfaktc.exe and run through your list. Later.[/QUOTE]

Hm...still not sure what's causing the problem, and I still haven't been able to reproduce it. At least you've got a workaround for now. Go through the list if you like, when you have time. Thanks for what you've done. :smile:

TheMawn 2014-02-17 17:09

I've noticed a couple of times (should happen more often) that the controller gives the running instance of mfaktc five seconds to close, which isn't always enough. For instance, I've ended up with a FAST and MEDIUM instance both running simultaneously, that is, until FAST finishes its current class. But by then, MEDIUM is already running, presumably on the class that FAST hadn't yet finished?

Very small potatoes here, I know. Just wondering if it's something I'm doing wrong.

Mini-Geek 2014-02-17 18:33

[QUOTE=TheMawn;367190]I've noticed a couple of times (should happen more often) that the controller gives the running instance of mfaktc five seconds to close, which isn't always enough. For instance, I've ended up with a FAST and MEDIUM instance both running simultaneously, that is, until FAST finishes its current class. But by then, MEDIUM is already running, presumably on the class that FAST hadn't yet finished?

Very small potatoes here, I know. Just wondering if it's something I'm doing wrong.[/QUOTE]
The controller doesn't try to let instances overlap like that, but there could be a bug to allow it. What is it you do that causes this to happen, e.g. are you coming in/out of idle, in/out of a pause/slow while running process, and/or manually trying to change the speed? Also, do you have MaxInstances set to 1 or something else? (and, if you have multiple GPUs, describe the setup of your MaxInstances and MfaktXExeFileName)

The config does contain a timeout of how long to wait for mfaktx to close (default 30 seconds), but when that time is up, it (forcibly) kills the process; this shouldn't be the mechanism that would allow both to run at once
[CODE] <!-- Time in milliseconds to wait for mfaktx to close before killing it -->
<add key="Timeout" value="30000" />[/CODE]
It shouldn't do what you're describing regardless of your configuration, just trying to narrow the possibilities...

TheMawn 2014-02-17 19:24

I'm away from my machine at the moment but I can get you started.

I have a GTX 670 in slot #1 and GTX 660 Ti in slot #0. Since the GTX 660 Ti doesn't control a monitor, I have no need for controlling its speed so it just runs off a .bat (so I can tell it which slot to use).

I use the speed controller for the GTX 670. When I'm not using the machine at all, I set it to fast (I just hit 3 on the controller). When I am using the machine for low-powered tasks like browsing, excel, word, videos, etc I run it on medium. If I'm playing a game I'll turn it off.

I just use 2, 3 and 4 to switch between medium, fast and off. Lately I've been using ctrl-c instead to allow mfaktc to close properly before starting the one I want.

TheMawn 2014-02-18 00:47

As far as I can remember, I have been using the original version of every file, with the exception of the following in the speed controller batch file.

[CODE]set MF=MFAKTC.EXE -d 1[/CODE]

I don't know what else I would have needed to tweak.

Mini-Geek 2014-02-18 13:07

[QUOTE=TheMawn;367220]As far as I can remember, I have been using the original version of every file, with the exception of the following in the speed controller batch file.

[CODE]set MF=MFAKTC.EXE -d 1[/CODE]

I don't know what else I would have needed to tweak.[/QUOTE]

With your latest posts, I realized that you're using the [URL="http://www.mersenneforum.org/showthread.php?t=17873"]batch file controller[/URL], which is something I didn't write. I assume it's with this batch file controller that you're having your problems.

I'd suggest that you change that instance to use my GUI controller. You can configure it to not have any automatic changes, which means it will function basically like the batch file does. Note that the ini file setup is a little different, see [url]http://www.mersenneforum.org/showpost.php?p=352544&postcount=42[/url] (if you're using the latest version of the GUI controller for your other instance, you'll already be familiar with that)

swl551 2014-02-18 18:27

if you are using Windows 8/8.1 with my SendCtrlCode.exe be sure it is version 1.5.2 which can be seen if you just double-click on that EXE.


However, Mini Geek's product is far superior.


All times are UTC. The time now is 08:17.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.