How much CPU for a GPU WU?

Moderators: Site Moderators, FAHC Science Team

Post Reply
snapshot
Posts: 132
Joined: Thu Apr 09, 2009 7:25 pm
Location: Wiltshire, UK

How much CPU for a GPU WU?

Post by snapshot »

How much CPU power does FAH need to feed a GPU? I thought it was supposed to be one core and one PC is using around 25% of an old dual core/four thread i3 to feed a GTX 1060 which seems bear that out. But my new PC with a new six-core i5 is using around 30% to feed a GTX 1050 Ti which is more like two cores. Is there an explanation of this that I've forgotten about?
bruce
Posts: 20910
Joined: Thu Nov 29, 2007 10:13 pm
Location: So. Cal.

Re: How much CPU for a GPU WU?

Post by bruce »

The CPU utilization depends on several factors -- mostly on the driver. The original recommendation was allocate one free thread per GPU, and that's still a pretty good recommendation. If the GPU is powerful and the CPU is weak, that can limit GPU production. On the other hand, some recent versions of OpenMM can offload some of the calculations to the CPU which can increase total throughput -- but I think this is sill a rare phenomenon.

Is the 30% a constant load over time and does it go to 0% if you pause the GPU?
snapshot
Posts: 132
Joined: Thu Apr 09, 2009 7:25 pm
Location: Wiltshire, UK

Re: How much CPU for a GPU WU?

Post by snapshot »

Yes, it's constant with Task Manager showing FAHCore using about 28% and 4% for the rest. The 4% remains if I pause FAH.
Both PCs are on the same Nvidia driver but the one we're interested in is on W10, the other on W7. I'd happily blame W10.....
Come to think of it, the GTX 1050 didn't exhibit this behaviour when it was on W7. CPU usage under an i7 was the 12% or 13% one would expect.
MeeLee
Posts: 1375
Joined: Tue Feb 19, 2019 10:16 pm

Re: How much CPU for a GPU WU?

Post by MeeLee »

If your new CPU has Hyperthreading, the system may occasionally use 2 cores instead of one on a non-hyperthreaded CPU.
I would recommend using Linux for folding.
It's difficult to get it to work, but once it works, it works a lot better than windows. Especially for folding.
snapshot
Posts: 132
Joined: Thu Apr 09, 2009 7:25 pm
Location: Wiltshire, UK

Re: How much CPU for a GPU WU?

Post by snapshot »

No, the old i7 had hyperthreading, the i5 doesn't. What I actually see is the opposite of your suggestion.
Donkey's years ago I used to run Linux in a VM for folding but these days it's about as much use to me as a bicycle is to a fish.
bruce
Posts: 20910
Joined: Thu Nov 29, 2007 10:13 pm
Location: So. Cal.

Re: How much CPU for a GPU WU?

Post by bruce »

FAH will allocate one thread to each CPU. What it actually uses isn't equivalent to that.

With hyperthreading enabled, two threads are associated with the hardware that represents one CPU Core. Each CPU Core, whether on an i5 or an i7 is capable of doing about the same amount of work, but that's not the real question since the GPU drivers use spin-waits. That means the software that reports your CPU status will show 100% of a thread busy, whether it's actually doing necessary work or it's in a CPU-burning loop, wasting resources.

On an i5, one CPU will appear to be 100% busy.l On an I7 with hyperthreading enabled, one thread will appear to be 100% busy running the same Windows NV driver.

Spin-waits are distinctly different than when a CPU is used for actual 3D calculations, An i5 (or an i7 with HT disabled) will produce certain number of GFLOPS. Switch HT on, and the same hardware will produce the same number of GFLOPS but now two threads appear in the CPU monitoring program where there was only one. Those 2 threads can do about 15% more 3D calculations because threal CPU will be able to overlap 3D calculations with non-floating point operations.
MeeLee
Posts: 1375
Joined: Tue Feb 19, 2019 10:16 pm

Re: How much CPU for a GPU WU?

Post by MeeLee »

Since it's only 4% of a CPU core, I wouldn't lie awake over it.
It's probably system overhead. Read/Writes, system background activity.
Gets worse with Windows than Linux.
On my Xeon system it uses 95% of an entire thread extra (out of 20 threads).

Folding from VM is worse, as Windows still uses the resources the same way.
If Linux folds at 100% efficiency, and Windows at 90%; running Linux in a VM in Windows, will reduce your efficiency to <85%.
It gives a lot more overhead.
A VM is great to learn to use Linux, but you'll have to boot in Linux natively for best results.
snapshot
Posts: 132
Joined: Thu Apr 09, 2009 7:25 pm
Location: Wiltshire, UK

Re: How much CPU for a GPU WU?

Post by snapshot »

I don't give a monkey's about the 4%. My question has always been why is FAH using 28% when we're all agreed it should be 17%.
bruce
Posts: 20910
Joined: Thu Nov 29, 2007 10:13 pm
Location: So. Cal.

Re: How much CPU for a GPU WU?

Post by bruce »

snapshot wrote:I don't give a monkey's about the 4%. My question has always been why is FAH using 28% when we're all agreed it should be 17%.
Because newer versions of the software used in FAHCores have been enhanced to use assist the GPU bu use the CPU for additional portions of the calculations. The GPU drivers, themselves, will use up to 17% -- unless AMD/NVidia modify their drivers.

The FAHCore contains a variety of code segments, most of which can allocate a large number of parallel threads, but those segments are not uniform. It's not a good idea to have a GPU mostly idle when it's running a segment of the calculation that cannot use more that a few of shaders, so running that segment on a CPU allows the GPU to proceed with segments that are highly parallelizable.
Yavanius
Posts: 121
Joined: Thu Nov 03, 2016 4:55 am
Location: 92408

Re: How much CPU for a GPU WU?

Post by Yavanius »

Just for future reference... Task Manager does NOT give a true representation of everything that's running. There are processes (especially with VM) that don't show up on it. (Sofar as I know the ones with Linux distros do but there are so many distros it's impossible to say for certain.)

Here's an article for some alternatives, one of them being Process Explorer from Microsoft itself. Actually found about this couple years when I was running VirtualBox clients belonging to BOINC projects. We could tell there was an impact on the system but we couldn't see WHERE those resources were going to with just Task Manager (no sir, I don't know about any elephant in the room). I also came back to my system one day with my system swapping out memory like crazy. Couldn't find where the leak was coming from...
Post Reply