FoldingAtHome / fah-issues

49 stars 9 forks source link

"Only when idle" should not go by CPU cycles or usage %, it should go by mouse or keyboard inputs. #1483

Open N1NAZ opened 4 years ago

N1NAZ commented 4 years ago

Environment

What were you trying to do

folding does not start when inputs are idle

What happened

To Reproduce

TunaErtemalp commented 4 years ago

I concur. Here is some data I just observed. One host I have is a 4 core / 8 thread i7-2600 with one GTX TITAN X. FAHClient is using 7 out of 8 threads on CPU Slot0, plus the GPU Slot1. I set the CPU to churn OnIdle, and started watching TaskManager Performance tab for the CPU & GPU load as well as the FAH Advanced Control. While the CPU was in the "Paused:waiting for idle" state, it was being used by FAHcore_22.exe at about 15% (to do GPU0: COPY operations) with other background things (like TaskManager, HFM, Windows Security, and various other Win10 system background tasks) adding 0-30% to that 15% momentarily with NOTHING else happening on the machine, with my hands and feet off the keyboard & mouse. That meant, even after waiting for 5+ minutes, the CPU was never getting to work on its own WU since the machine was always too busy to be counted as idle, mostly because of the FAH's own GPU work's CPU usage.

That doesn't sound right. It is like chasing tails... :)

Tuna

zecanard commented 4 years ago

A similar issue exists on macOS. Folding@home, when set to running on idle, always stopped running after 5–10 minutes. I’d wake my computer (which was only set to sleep the display) in the morning, only to find that Folding@home had run for about 10 minutes all night.

I ended up writing my own process monitor to start and stop the FAHClient.

PantherX commented 4 years ago

Please note that F@H uses the values from various OS to detect the idle state. Thus, you need to see what the idle state is for each OS. On Windows, it is when you setup a screensaver so you can setup a blank one: https://www.howtogeek.com/225305/how-to-find-and-set-screen-savers-on-windows-10/

TunaErtemalp commented 4 years ago

Wow. Thanks for the clarification.

Screensaver on Windows only comes up if the user has not touched the mouse/keyboard, and it has nothing to do with the load on the CPU. In other words, it is about the USER being idle, not the COMPUTER being idle.

So, I looked at my screensaver timeout, and it was set to 15 minutes (and, yes, I hadn't waited 16 minutes, and even if I had, I wouldn't have seen the CPU graph in the Task Manager Perf tab due to the screensaver). So, I changed it to 1 minute, set the FAH CPU slot to "On Idle", watched the Task Manager CPU perf graph dwindle down, waited for a minute, screensaver kicked in, waited 15-20 seconds, got out of screensaver, and saw that the CPU perf graph had gone back up to 100% for those 15-20 seconds and back down as soon as I got out of the screensaver. Confirmed.

Soooooo...... If the "On Idle" option on any slot means "run it when the screensaver kicks in", then THAT is what it needs to say. At a minimum, that option should be called "Only when Screensaver is active" or "During ScreenSaver".

However... "On Idle" really means "when the resources are idling at an acceptable level, I will kick in to use those unused resources". It doesn't mean "I'll use the resources only when the screensaver is on". Especially since the screensaver might use resources that FAH could have used (except for blank screen saver), which is also the reason why on 90% of my machines I have no screensaver set. Only one machine with a monitor has one, and that is running the FAHViewer, just for beauty.

In reality, if I am just running Word or Notepad or browsing the internet, I would like to have FAH/BOINC use the modern CPU that can carry that load. But, if I end up running some lengthy computation/simulation, then I don't want to reach to the FAHControl to manually pause it.

BOINC has a three-fold solution to it: 1) First, if set to run "On Idle" instead of "Always", it detects keyboard/mouse events and suspends while the USER is not idle, and allows the user define in cc_config.xml the minimum number of seconds after the last USER activity to unsuspend, regardless if there is a screensaver on or not.

2) It allows the user set a list of process names that would put either the CPU or GPU or both to suspended. That is the issue #1480 I opened recently.

3) And, it allows the definition of a CPU usage%, and if the current usage% of CPU minus the sumtotal of FAHClient*.exe CPU usage%s dips below that user-set minimum "leave it free for me" level, then it suspends the CPU.

By any measure, that is the right way of implementing such "On Idle" control for all various definitions of idleness.

So, I would now consider the title of the current feature a BUG, and the implementation of a real "On Idle" an ENHANCEMENT.

Thanks for listening Tuna

PS: And, a lot of the framework problems such as this would just go away if a group of people would look into integrating the actual domain smarts of FAH into the BOINC platform to deal with all sorts of host machine & project/workunit-management & stats etc. I know it was looked at YEARS ago, but man.... A LOT changed since then. I hope this is not another case of Berkeley vs Stanford... And, I say this being a Stanford'90 MSCS... LOL!

ejoepan1 commented 4 years ago

I tried to us the F@HScreeenSaver (the molecule in its glory) and it flashes on the screen and immediately vanishes. All other screensavers I tried pop up and stay up.

TunaErtemalp commented 4 years ago

Just as a note: the FAH screen saver does work on my Win10 machine. So, this might be an issue with the version of Win10 or some other hardware/software config/setting.

shorttack commented 4 years ago

"Defect" is documentation needs to clarify how idle works and how user can engage processing-on-idle.

arnileibovits commented 4 years ago

I've noticed that "Only when idle" works only when the display gets turned off (power settings), not when a screensaver is activated. However, if you use the "FAH screensaver", it will also be detected as idle.

I cannot use the "FAH screensaver" though, because it messes up my HDR color settings.

I'm using Windows 10 v2004.

bb30994 commented 4 years ago

"idle" is defined by your OS. Windows/Linux/MacOS don't all define it the same way and FAH is not responsible for trying to redefine it. FAH accepts notifications from the OS when idle begins and when it ends.