On limiting GPU usage

Moderators: Site Moderators, FAHC Science Team

Re: On limiting GPU usage

Postby foldy » Mon Apr 10, 2017 10:57 pm

Yes no OS and no hardware support that is why the App must do it ;-)
I try to reproduce some video lag and test the process sleep alternate.
foldy
 
Posts: 2008
Joined: Sat Dec 01, 2012 4:43 pm

Re: On limiting GPU usage

Postby davidcoton » Mon Apr 10, 2017 11:41 pm

It has been tried. There were legacy settings in (I think) FahControl 7.4.4. But, IIRC, the results were so bad that the feature was disabled before public release.
In any case throttling the CPU process does not have the desired effect, because the intervals between the GPU requests are too long.
A side effect of comparatively long slices of work/rest for the GPU is increased thermal cycling, which is usually regarded as highly detrimental to GPU lifespan.
Image
davidcoton
 
Posts: 1102
Joined: Wed Nov 05, 2008 4:19 pm
Location: Cambridge, UK

Re: On limiting GPU usage

Postby bruce » Tue Apr 11, 2017 1:37 am

There's a lot of valid information posted above. Let me add a bit more.

Suppose all of the GPU kernels for your project take an equal amount of processing. (This is NOT true since there are different kinds of equations being calculated, but there is a large number of one kind and then a few of another, so it's mostly true). Now suppose each kernel takes 100 ms on your GPU. Suppose it takes 40 ms to transfer the data to the GPU and 30 ms to return the results. (I don't know if these numbers are even close to valid, but it doesn't really matter. When the WU starts, the GPU shaders are idle for 40 ms before the first 100 ms of calculations start. Much like double buffering on a communications line, the second kernel can be sent while the first one is still processing and, can probably start processing before the first one is done, depending on how many shaders are still free and how they're allocated. For the most part, processing is overlapped with data transfers can be "hidden" by overlapping the transfers with the processing. Otherwise, there would be gaps between shader utilization slices.

To approach 100% processing, it makes sense to enqueuing a number of kernels whenever possible. Some parts of the calculations do require all outstanding kernels to be synchronized, so there are always going to be some calculation gaps. That's also probably the only time that the 30 ms for returning the data might be visible.

How much do those gaps detract from 100%? It all depends on the characteristics of your hardware. A faster GPU may not require 100 ms to do the same work and a slow PCIe may take longer that my assumed 40 ms. Also, the pauses to synchronize data may be terribly fast or terribly slow depending on the characteristics of your hardware.

OK, now back to the original questions (which also requires an understanding of your hardware).

If there are, say 10 kernels of 100 ms already queued up when you press a key that's supposed to update your screen, your OS will enqueue a 2ms kernel but it won't get to the GPU for a full second. Bad news! If, at any point, you suspend the CPU so data can't transfer, it can lengthen that wait unless the OS happens to ask for resources while the GPU only has one (or zero) 100 ms kernels. That nonexistent GPU OS might be able to give priority to the screen-update kernel and let it jump to the head of the queue, but that's not something that's going to happen any time soon. Once the kernel does get to the GPU, that same nonexistent OS also might be able to steal some of the shaders that would otherwise be busy doing FAH for the next 100 ms.

Clear? or Unclear?
bruce
 
Posts: 19990
Joined: Thu Nov 29, 2007 11:13 pm
Location: So. Cal.

Re: On limiting GPU usage

Postby JimboPalmer » Tue Apr 11, 2017 1:43 am

foldy wrote:Yes no OS and no hardware support that is why the App must do it ;-)
I try to reproduce some video lag and test the process sleep alternate.

No. Without an OS and hardware support, the App can't do it.

There is a reason no one is bitching about the CPU cores, they have a multi-tasking OS to schedule them.
Tsar of all the Rushers
I tried to remain childlike, all I achieved was childish.
A friend to those who want no friends
JimboPalmer
 
Posts: 2038
Joined: Mon Feb 16, 2009 5:12 am
Location: Greenwood MS USA

Re: On limiting GPU usage

Postby foldy » Tue Apr 11, 2017 3:50 pm

I like bruce example of the 10 FAH Kernels of 100ms runtime already queued before a screen update. If the FAH App supports limiting GPU usage then it would only queue one kernel then idle the specified amount of time. When now comes a screen update to be queued in - it is the next right after the one kernel. FAH then queues the next kernel after idle time is finished. So there is always a time slot free every 100ms where a screen update fits in. Without FAH limiting GPU it would wait a full second for 10 prequeued kernels instead as bruce showed.

There may be the problem that a kernel takes more time on a slow GPU than on a fast GPU as bruce mentioned. So even with FAH limiting GPU usage using idle times, long running kernels would block the UI in between. This is where FAH maybe can also alternating suspend and resume the kernel but I don't know if that is possible.

@JimboPalmer: I read your message "It's not possible", but can you tell me why?

@davidcoton: I agree long slices like 1 second will not work, so I try with short slices like 10 ms that means 100 slices with alternating on and off, so 50 idle slices to update screen with 60hz should nearly match.

Currently my problem is to generate lag that I can see on my screen. I tried youtube video and media player video, both with GPU HW acceleration on, but it is not lagging. Maybe a GPU benchmark will do where some 3D sequence is displayed.
Edit: I can produce lag with Unigine Heaven Benchmark. With FAH GPU slot running full I get 30fps with FAH alternating every 100ms I get 30 to 45 fps also alternating. So the benchmark can hook into the 100ms idle slots and speed up.
Last edited by foldy on Tue Apr 11, 2017 5:31 pm, edited 3 times in total.
foldy
 
Posts: 2008
Joined: Sat Dec 01, 2012 4:43 pm

Re: On limiting GPU usage

Postby bruce » Tue Apr 11, 2017 5:23 pm

foldy wrote:I like bruce example of the 10 FAH Kernels of 100ms runtime already queued before a screen update. If the FAH App supports limiting GPU usage then it would only queue one kernel then idle the specified amount of time. When now comes a screen update to be queued in - it is the next right after the one kernel. FAH then queues the next kernel after idle time is finished. So there is always a time slot free every 100ms where a screen update fits in. ithout FAH limiting GPU it would wait a full second for 10 prequeued kernels instead as bruce showed

There may be the problem that a kernel takes more time on a slow GPU than on a fast GPU as bruce mentioned....
I don't know if this is possible, but even if it is, it's not likely to ever be included in a FAHCore. What you're really asking for would significantly reduce FAH's performance day-and-night. A very significant goal of the programmers who develop OpenMM is to maximize performance and a requested "de-enhancement" to kill performance isn't likely to make it to the top of the list of potential changes. The only way that MIGHT happen is if somebody with the right kind of programming expertise actually wrote that code. (OpenMM is "open" so recommended changes can be submitted.)

On the other hand FAH has the option to turn the FAHCore on and off with the setting idle=true/false ... (like a screensaver that stops running when you move your mouse). Using that option would (A) suspend all FAH kernels when you're using the computer and (B) I'll bet the total production per day would be greater.

Yes, the slow/fast GPU is a very significant issue in this discussion. Personally, I run a wide variety of GPUs and I use browsers on many of the same computers. With something like Geforce GTX *80 or *90 (especially the high-end ones) the screen delay is negligible and FAH is configured to fold 24x7. With a Geforce GT *30 or *40 (especially the lower end ones) I use idle=true or I reconfigure my browser to use the CPU for rendering. The 100 ms number I've used (assuming my guess is a meaningful number) would be a lot different on a GPU that completes a kernel in 10 ms than one that takes 1000 ms.
bruce
 
Posts: 19990
Joined: Thu Nov 29, 2007 11:13 pm
Location: So. Cal.

Re: On limiting GPU usage

Postby foldy » Tue Apr 11, 2017 5:37 pm

You are right, we have all the workarounds and the GPU usage limit idea using idle time slice is only worth it, if we can show UI lag would be reduced and it is simple to implement without loosing much PPD. But it was interesting to think this through. :e)
foldy
 
Posts: 2008
Joined: Sat Dec 01, 2012 4:43 pm

Re: On limiting GPU usage

Postby cepal » Mon May 04, 2020 4:20 pm

This is what I've done - I have a hybrid GPU on my laptop, Intel HD and Nvidia. So I've set Nvidia Contorl Panel to use only Intel - I am NOT doing any complex graphical applications on my laptop, and then using MSI Afterburner, I REDUCED the maximum frequency of both memory and core, to limit the maximum heat. Windows apps / graphics is fast since it doesn't touch the Nvidia and the FAH GPU computation is running on max without overheating my GPU and without the GPU fan run-ing on irritatingly high 100% revs which was super-noisy.

The only other option would be allow the GPU tasks only when idle, which I believe is the default setting of FAHClient?
cepal
 
Posts: 2
Joined: Tue Apr 14, 2009 7:39 pm

Re: On limiting GPU usage

Postby PantherX » Tue May 05, 2020 3:36 am

Welcome to the F@H Forum cepal,

If you choose the Light setting on slider, then the GPU will only fold when the OS detects that it is idle. However, you can manually configure the GPU slot to be on idle via FAHControl (AKA Advanced Control).
ETA:
Now ↞ Very Soon ↔ Soon ↔ Soon-ish ↔ Not Soon ↠ End Of Time

Welcome To The F@H Support Forum Ӂ Troubleshooting Bad WUs Ӂ Troubleshooting Server Connectivity Issues
User avatar
PantherX
Site Moderator
 
Posts: 6733
Joined: Wed Dec 23, 2009 10:33 am
Location: Land Of The Long White Cloud

Re: On limiting GPU usage

Postby bruce » Tue May 05, 2020 3:55 am

cepal wrote:I've set Nvidia Contorl Panel to use only Intel.
The only other option would be allow the GPU tasks only when idle.


Is it your intent to run FAH? Telling your hybrid to use only Intel will probably be the equivant of disabling FAH entirely since FAH cannot run on the Intel. (I don't have that hardware, so I can't verify my guess.) What do you find? Does that setting only apply to other applications?
bruce
 
Posts: 19990
Joined: Thu Nov 29, 2007 11:13 pm
Location: So. Cal.

Re: On limiting GPU usage

Postby MeeLee » Tue May 05, 2020 8:49 pm

If your intent is to lower internal case temperatures, reduce power consumption, like mentioned, lowering the power through MSI afterburner, or EVGA XOC is the easiest way to do this.
Doing this, will also reduce all other performance (including desktop use).

On/Off cycling of WUs, will not help fluid desktop experience. It will worsen it.

The best possible solution, is to just buy another GPU, and run your desktop from that.
My experience, if you just want to watch youtube videos of 1080p or less, and use the desktop fluidly, a GT 730 is probably your best bet!
They go for $25-35 online, and offer plenty of basic functionality.
Fold on your GPU, and work on the GT730 (it's too slow to finish WUs before the deadline, so it makes no sense to use it for folding anyway), and it uses roughly 20-25W (20W for the newer ones that are also faster than the older ones).
MeeLee
 
Posts: 1086
Joined: Tue Feb 19, 2019 11:16 pm

Re: On limiting GPU usage

Postby cepal » Wed May 06, 2020 2:34 pm

To answer the responses above:
- I switched the actual desktop programs to use the Intel, not in BIOS. So the OS still can see both graphics, and can have programs use the Nvidia. So to reserve Nvidia just for FAH, I set all the rest to preferably use Intel (FAH will ignore that preference, right?) Before that, the 3D desktop graphics operations pathed through the Nvidia were actually significantly slowed down due to the GPU being busy doing FAH
- I can't buy another GPU as we're talking about laptop here; I don't mind the Nvidia running full throttle (as long as it's not overheating), and the desktop applications to use the Intel one - I am a Linux engineer, don't need fancy 3D graphics to open a SSH text console, or to open a ticket, GIT, or an Excel spreadsheet ;-), and even videos are playable ONLY via the Intel actually, so no use of Nvidia there...
cepal
 
Posts: 2
Joined: Tue Apr 14, 2009 7:39 pm

Re: On limiting GPU usage

Postby PantherX » Thu May 07, 2020 10:10 am

I am not sure if the client will ignore that preference or not since I don't have any Nvidia Optimus system to check. However, feel free to post an update :)
User avatar
PantherX
Site Moderator
 
Posts: 6733
Joined: Wed Dec 23, 2009 10:33 am
Location: Land Of The Long White Cloud

Re: On limiting GPU usage

Postby MeeLee » Thu May 07, 2020 6:08 pm

cepal wrote:To answer the responses above:
- I switched the actual desktop programs to use the Intel, not in BIOS. So the OS still can see both graphics, and can have programs use the Nvidia. So to reserve Nvidia just for FAH, I set all the rest to preferably use Intel (FAH will ignore that preference, right?) Before that, the 3D desktop graphics operations pathed through the Nvidia were actually significantly slowed down due to the GPU being busy doing FAH
- I can't buy another GPU as we're talking about laptop here; I don't mind the Nvidia running full throttle (as long as it's not overheating), and the desktop applications to use the Intel one - I am a Linux engineer, don't need fancy 3D graphics to open a SSH text console, or to open a ticket, GIT, or an Excel spreadsheet ;-), and even videos are playable ONLY via the Intel actually, so no use of Nvidia there...

You do what is best for you.
However, few laptops inside have an available PCIE slot (usually in the form of an m.2 slot, PCIE x1, x2, or x4).
On most other laptops the Wifi card is plugged in there.
If your laptop has an Ethernet port, you could plug in the Laptop to the Ethernet port, and use a powered riser on a ribbon cable going inside the laptop's m.2 slot (or mobile pcie).
That way you can run a desktop GPU powered by your laptop.
You can look up the procedure in Youtube if you like.
Just an idea ;)
MeeLee
 
Posts: 1086
Joined: Tue Feb 19, 2019 11:16 pm

Previous

Return to V7.4.4 Public Release Windows/Linux/MacOS X (deprecated)

Who is online

Users browsing this forum: No registered users and 2 guests

cron